It's hard to search for special characters on google, which is why I'm posting this here.
I recently ran (as root) a mv /tmp/folder/* /*
when I meant to run mv /tmp/folder/* ./
Big mistake!
Things broke! A lot of files got mixed up and placed into strange places, none of the normal unix commands worked (ls, dir, cat, etc) and once you logged off, you couldn't ssh back in -- it would give you a prompt, but not accept the old passwords.
Running ls /*
shows me that it performs ls on every directory in /
. If I tried to draw a parallel, then mv
should have simply moved (or copied?) the files to every directory in /
. Instead, really weird things happened, and I was just curious what exactly was going on.
More info: The files in /tmp/folder had been transferred from a windows machine, and had been named file (#).txt, where (#) is a number up to two digits, with a space between file and the parenthesis. There were ~40 of these text files.
/*
were not a directory, nothing would have happened. – lgeorget Jun 18 '13 at 19:03/var
, not/var/www
. Doecho /*
orls -d /*
to see the list. You probably didls
without the-d
, which causesls
to list the contents of each directory given as an argument. – derobert Jun 18 '13 at 19:40ls /*
to be sure. >.< – lgeorget Jun 18 '13 at 20:06