4

I tried something on my vm ubuntu and managed to mess it up... luckily I made a snapshot not too long a go.

I renamed a file to ,,, and tried to mv ,,, *. The entire content of the dir disappeared. Can someone please explain to me what happened?

Thank you.

  • 1
    +1 for a seriously "WTF" command. seewiously. ",,," is apparently a legal filename but just seems like a bad idea. Then lets move it to '*'. XD – Cory J Apr 17 '10 at 18:44
8

The shell expands * into the entire contents of the current directory (modified by shell options). If the last entry in the current directory is itself a directory, then everything will be moved into that directory.

  • 2
    Awesome "what if" question :-) – Matt Simmons Apr 17 '10 at 18:50

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.