3

I am running Linux Mint.I tried to copy a file with the file manager. It looked like it hung. I can see the file in the directory with ls -l:

-rwxr-xr-x 1 mike domain^users 20 Mar 1 08:57 'output (copy 1).txt'

It has char quotes around it. However, I cannot move it, remove it, cat, etc. For any of these commands, I get a similar error message. For rm *, I get:

rm: cannot remove 'output (copy 1).dat':No such file or directory.

I moved every other file out of the directory except this one and tried rm * and rm -f *. Same error.

I tried

$ rm "'output (copy 1).dat'"
rm: cannot remove ''\''output (copy 1).dat'\''': No such file or directory

I tried

$ mv * test
mv: cannot move 'output (copy 1).txt' to 'test': No such file or directory.

I can't rmdir, it says the directory is not empty.

Ideas?

terdon
  • 234,489
  • 66
  • 447
  • 667
mshepard
  • 31
  • 2
  • 1
    What is the exact command you are using to remove `output (copy1).dat`? – jesse_b Mar 01 '19 at 14:46
  • 1
    Possibly related: https://unix.stackexchange.com/q/258679/237982 – jesse_b Mar 01 '19 at 14:48
  • No. Same error with escape backslashes. – mshepard Mar 01 '19 at 14:49
  • I tried rm 'output (copy 1).dat', then emptied the directory and tried rm * and rm -f *. No success – mshepard Mar 01 '19 at 14:51
  • 1
    Show the command you're using. [Edit] your question. – Kusalananda Mar 01 '19 at 14:51
  • Emptied of all files except this file – mshepard Mar 01 '19 at 14:54
  • What is the output of: `for f in *; do echo "$f"; done` when run in that directory? – jesse_b Mar 01 '19 at 14:57
  • group name seems a bit peculiar, if you didn't mess `/etc/group` you might have a faulty filesystem. have you tried `fsck` (File System Consistency Check) it ? – Archemar Mar 01 '19 at 14:57
  • 1
    _What commands_ did you use? – Kusalananda Mar 01 '19 at 15:00
  • I just tried the for f in *; do echo "$f"; done The result is output (copy 1).dat with no quotes. – mshepard Mar 01 '19 at 15:01
  • 1
    @mshepard: Cool, so I think it's safe to say the quotes _have_ been added by `ls`. Now it would help if you [edit](https://unix.stackexchange.com/posts/503802/edit) your question to include all of the commands you have tried so far and the error messages that each gave. – jesse_b Mar 01 '19 at 15:03
  • I edited the question to include what I consider the most important command: rm * As noted in the comments, I tried rm with double quotes around the single quote file name. It still says no such file or directory. Are there other commands that may be of use? – mshepard Mar 01 '19 at 15:06
  • 1
    You just mentioned a file called `output (copy 1).dat` in comments, but in the question you have `output (copy1).dat`. This is different. Try removing the directory that holds this file (assuming you'd want to remove everything in this directory) with `rm -rf dirname`, where `dirname` is the name of the directory. – Kusalananda Mar 01 '19 at 15:14
  • I tried rm -rf processes (that's the folder) and got rm: cannot remove 'processes': Directory not empty. – mshepard Mar 01 '19 at 15:21
  • What Unix are you actually running here? You've tagged it with Linux. Are you on an embedded system? An error message from `rm` usually does not contain the word `rmdir`. – Kusalananda Mar 01 '19 at 15:23
  • Sorry - I mistyped at first. – mshepard Mar 01 '19 at 15:26
  • 2
    SOLVED: The directory was on a network drive. I connected to it with a windows 10 machine and had no problem deleting the file. Thanks for all your suggestions. – mshepard Mar 01 '19 at 15:50

0 Answers0