Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question
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
add comment

1 Answer 1

up vote 8 down vote accepted

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.

share|improve this answer
2  
Awesome "what if" question :-) –  Matt Simmons Apr 17 '10 at 18:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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