0

I've tried to move a file to an upper directory but I forgot the final slash / and now I can't find it.

What exactly have I done?

1

The slash is irrelevant. Your file will be in the parent directory:

$ ls
file
$ mv file ..
$ ls
$ ls ../
bar  file

I have no idea why you don't find it. Perhaps you just missed it? Or maybe it's a hidden file (name begins with a dot) and you need ls -a to see it.

| improve this answer | |
  • It apperaed... but in the parent of the parent directory! I'm thinking that it is due to the parent directory is a symbolic link. Could be? I don't know. Thanks anyway! – Luis Díaz Jun 30 '17 at 12:43
  • @LuisDíaz yes. Symbolic links act strangely, it depends on how you accessed the daughter directory. Try this: cd linkToDir; pwd and compare to cd targetOfLink; pwd. – terdon Jun 30 '17 at 12:47

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.