-1

I am having a problem with something seemingly very simple in Unix. I used the following code to move a file to another directory:

mv genes.gtf ./ ../..

The file is no longer in the original directory, but it has not shown up in the destination directory either! Has anyone experienced a similar thing before? What is causing the problem? Is it possible for it to take a while for a file to be moved, so it shows up in the destination directory with a big delay?

mshum
  • 257
  • 3
  • 15
  • This isn't really on topic here, but - `mv` takes two arguments, source and target. You have three. – Pekka Feb 08 '16 at 15:16
  • Oh wow... Thanks @Pekka웃. very silly mistake on my part. Any idea where the file might have gone though? – mshum Feb 08 '16 at 15:19
  • In the root directory perhaps? Not sure what `./` translates to – Pekka Feb 08 '16 at 15:20
  • Doesn't look like it's there either--guess I will re-download it. Just to clarify, what do you mean by "This isn't really on topic here..."? I'm pretty new to Stack Overflow, so I'm still learning these things. – mshum Feb 08 '16 at 15:50
  • 1
    SO is generally focused on *programming* questions. Questions on how to use the Unix/Linux command line have a better home on http://unix.stackexchange.com – Pekka Feb 08 '16 at 15:52

1 Answers1

1

When 3 arguments are passed to mv, the first two are considered sources, and the last one is considered the destination. It seems you moved both genes.gtf and the current directory (./) to ../..

I think what you meant to write was mv genes.gtf ../..

As far as what happened to your file, I have no idea; I've never attempted to move ./ anywhere in unix/linux before.

amanning
  • 64
  • 2
  • Thanks for the explanation, @amanning. Definitely meant `mv genes.gtf ../..`... rough Monday morning, hah. The original directory is in the same place as before, but the file is gone. Think the best thing to do at this point is just re-download the file. – mshum Feb 08 '16 at 15:44