MetaChat REGISTER   ||   LOGIN   ||   IMAGES ARE OFF   ||   RECENT COMMENTS




artphoto by splunge
artphoto by TheophileEscargot
artphoto by Kronos_to_Earth
artphoto by ethylene

Home

About

Search

Archives

Mecha Wiki

Metachat Eye

Emcee

IRC Channels

IRC FAQ


 RSS


Comment Feed:

RSS

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.

Especially don't do it as root.

Sigh.
ps aux
posted by Divine_Wino 11 October | 17:21
ouch
posted by dodgygeezer 11 October | 17:27
"man sudo"

Might give you some time to think over what you typed in.
posted by AlexReynolds 11 October | 17:28
Sometimes you only see what you meant, not what you typed.
Sudo would only help if it made me type the command again.
posted by Armitage Shanks 11 October | 17:42
I have done such things. It's a major drag.

But alas, life goes on. Are any backups to be had?

But Unix is like a Jennifer Lopez or something. You'll love it -- but it will hurt you, eventually.
posted by teece 11 October | 17:55
But Unix is like a Jennifer Lopez or something. You'll love it -- but it will hurt you, eventually.


teece, that's awesome.
posted by Frisbee Girl 11 October | 18:01
welcome
posted by andrew cooke 11 October | 18:07
But alas, life goes on. Are any backups to be had?

Yeah, it's all backed up. I knew 15 years ago that I'd do this at least once. In a way, I'm surprised it took this long.

welcome

I have an original copy of that book complete with barf bag :)
posted by Armitage Shanks 11 October | 18:42
Unix will make you cry eventually. Other operating systems make you cry incessantly.
posted by Wolfdog 11 October | 18:46
Didn't that just move foo to a directory literally called *?
posted by danostuporstar 11 October | 19:29
Oh, I missed the last dot in the correct command. Yuck.
posted by danostuporstar 11 October | 19:39
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.
posted by Armitage Shanks 11 October | 19:42
eventually, operating systems will make you unix.
posted by wendell 11 October | 21:42
You got your unix in my peanut butter!
posted by mosch 11 October | 21:59
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.
posted by kenko 12 October | 01:59
Add this to your root shell profile:

alias cp 'cp -i'
alias mv 'mv -i'
alias rm 'rm -i'

Then you'll quickly find out if your command will hose your system. Good luck next time.
posted by AlexReynolds 12 October | 02:42
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.
posted by danostuporstar 12 October | 11:10
Backslashes'd do it.

Or single quotes.
posted by kenko 12 October | 12:53
Apostrophes are non-standard markup!
posted by danostuporstar 12 October | 14:45
I am being driven slowly but surely insane || Demon

HOME  ||   REGISTER  ||   LOGIN