Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Automate the creation of a portable iTunes library' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Automate the creation of a portable iTunes library
Authored by: quasma on Jan 25, '07 10:29:18AM

It would be better to do:

rm -f path/to/folder/*

rather than

cd path/to/folder
rm -r *



[ Reply to This | # ]
Automate the creation of a portable iTunes library
Authored by: taxi on Jan 29, '07 04:06:05AM

Both of these are potentially dangerous.

Consider this:
cd /
cd /Alphabet/Soup/Tastes/Nice
rm -r *

(Naturally, /Alphabet/Soup/Tastes/Nice doesn't exist). I think this is the instance the previous poster suggests. No second 'cd' occurs, resulting in everything on the disk being removed.

Alternately, what about:
cd /
rm -r /Alphabet/Soup/Tastes/Nice/ *

You might notice the space in there. It's fairly easy in coding to have a space remaining on a string that you didn't mean to leave there. Bye-bye contents of / again.

rm -r * is dangerous, although running as a low-privs user makes it somewhat safer. As does backing stuff up.

[ Reply to This | # ]