Linux Training : 1. Dangerous Commands or procedures

[ rm ] [ overwriting files ] [ dd ]

rm

rm is a remove or delete command. Linux, like other UNIX variants assumes you know what you are doing and will allow you to totally wreck the system as root.

rm -rf * will delete EVERYTHING in the filetree from where you currently are.

Test all rm commands first by substituting ls to see what will be deleted. Recovering deleted files is basically a futile process. In Linux, delete means delete

overwriting files

echo "stuff" > myfile will overwrite myfile instead of appending unlike echo "stuff" >> myfile. This is a common mistake and very frustrating.

The > and >> are IO redirection

See c. Command Prompt and IO redirection

dd

dd is a type of file copy command with (as root) the ability to write anywhere on a hard drive with no regard to files or file structure. dd if=/dev/zero of=/dev/sda bs=512 count=1 will obliterate the master boot record of the hard drive sda making the system unbootable.