开发者

Lost my file in linux [closed]

Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 11 years ago.

Improve this question

In linux terminal, I accidentally mistyped

sudo mv myfile.zip /~

My purpose was to move under the home folder but it was not there.

Although I tried to find it by both

sudo find / -name 'myfile.zip'

and

sudo locate myfile.zip

could not find it. Where it can b开发者_Python百科e?

Thanks in advance.


You might be surprised to find a file named ~ right under /.


It's called /~. That's a perfectly valid filename (remember, shell only expands ~ at the * beginning* of a path and you typed it in the middle, so the shell left it at that).


You moved it to /~ --- it is at root and named ~.


Your file is now no longer named myfile.zip, but ~. You should find it exactly where you told it to go, at: /~


It will be under / and its name will be ~.

You'll be surprised that unlike Windows, Unix-like systems can take a lot of things very literally, you can even create a file with the name *.* if you quote properly. The system won't complain about it, and it will even work.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜