2

I have a few files in a certain directory that appear in ls, but any attempts to delete, move, or open them direction (via terminal or GUI) are met with a "No such file or directory" error.

Trying to remove them based on pattern matching the filename doesn't throw an error but also does not remove them:

vpillar@Burnell:/mnt/People/vpillar/DataArchive/Backups/CHESS_July2015/empty$ rm -f *error
vpillar@Burnell:/mnt/People/vpillar/DataArchive/Backups/CHESS_July2015/empty$ ls *error
empty_1_1degmerged_002_np_anisoavg.asc:r.scale.error  empty_1_1degmerged_022_np_anisoavg.asc:r.scale.error  empty_1_1degmerged_022_npavg.rf:r.scale.error
empty_1_1degmerged_002_npavg.asc:r.scale.error        empty_1_1degmerged_022_npavg.asc:r.scale.error

I wondered whether the colon in the filename is causing a problem, but there were plenty of other files with similar names (just different numbers than 002 and 022) that I deleted with rm without any issues. Any ideas what's going on here? All I want to do with these files is delete them, so I could simply not do that and carry on living with minor clutter in this particular directory...but it seems like there should be a way to clean them up.

Edit: directory listing with -la (bizarre)

vpillar@Burnell:/mnt/People/vpillar/DataArchive/Backups/CHESS_July2015/empty$ ls -la *error
ls: 'empty_1_1degmerged_002_np_anisoavg.asc:r.scale.error': No such file or directory
ls: 'empty_1_1degmerged_002_npavg.asc:r.scale.error': No such file or directory
ls: 'empty_1_1degmerged_022_np_anisoavg.asc:r.scale.error': No such file or directory
ls: 'empty_1_1degmerged_022_npavg.asc:r.scale.error': No such file or directory
ls: 'empty_1_1degmerged_022_npavg.rf:r.scale.error': No such file or directory
-rw-rw-r-- 1 vpillar users  2 Sep 25  2015 empty_1_1degmerged_002_np_anisoavg.asc:r.scale.error
-rw-rw-r-- 1 vpillar users  2 Sep 22  2015 empty_1_1degmerged_002_npavg.asc:r.scale.error
-rw-rw-r-- 1 vpillar users 19 Sep 25  2015 empty_1_1degmerged_022_np_anisoavg.asc:r.scale.error
-rw-rw-r-- 1 vpillar users 18 Sep 24  2015 empty_1_1degmerged_022_npavg.asc:r.scale.error
-rw-rw-r-- 1 vpillar users  2 Sep 24  2015 empty_1_1degmerged_022_npavg.rf:r.scale.error

Edit2: I can create files with the same names as these files and no errors are thrown, and as far as I can tell (printing the filenames in various ways, copying from ls output, etc.) they really do have the same exact name--the system seems to think the new one I created is the only one that exists, although ls still lists both (and adds a + at the end of the list of permissions, though getfacl doesn't show any extra permissions).

  • Please show us the directory listing again, using ls -la – user535733 Oct 17 '17 at 17:36
  • Added--good question. I don't know what to make of the output. – Veronica Pillar Oct 17 '17 at 17:46
  • 1
    The fact that you are in a directory that starts with /mnt suggests you are trying to delete files on a remote filesystem - sometimes these can get out of sync. Do you know what filesystem it is, and how it is mounted? – steeldriver Oct 17 '17 at 17:48
  • Yes, it is on a remote filesystem (I hadn't even thought about the effects of that)--hosted on a different machine in the same local network as my own, mounted with cifs. Could it help to unmount and remount it ? – Veronica Pillar Oct 17 '17 at 17:50
  • TBH I don't know - it may help to play with the cache mode in your mount options - see the cache= section of the mount.cifs manpage – steeldriver Oct 17 '17 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.