MetaChat is an informal place for MeFites to touch base and post, discuss and
chatter about topics that may not belong on MetaFilter. Questions? Check the FAQ. Please note: This is important.
11 October 2005
eventually, unix will make you cry→[More:]Don't type "mv foo/* ." and accidentally hit the spacebar between "foo" and "/".
Especially don't do it on a hosted production site.
Sadly not. It moves foo to the current directory. Then it begins moving everything from the root directory into the current directory. At some point, that fails, but in my case not before /lib was moved, which means you can't run any command that depends on ld-linux.so. Which is basically everything other than what's built into the shell. So you can't log in to move it back. You can sit in an existing shell and cd, pwd, and tab-complete to your heart's content, but that's no way to run a business.
Fortunately, we were able to boot from a Knoppix disk and move everything back. I need to lie down in a dark room.
Didn't that just move foo to a directory literally called *?
Even if it weren't for the dot, that's still not what it would have done: it would have moved foo, and then all the files/directories under / except the last one to be expanded into the last one to be expanded.
Everything would end up living in /var, or something.
Everything would end up living in /var, or something.
Hmm, you are correct, sir. But I swear I remember making similar typos before where I've ended up with asterisks in filenames. I can't seem to duplicate it now though.