topic

Dangerous Commands

Commands worth understanding before copying from the internet.

4 checked fixes

Commands in this topic

Dangerous Commands Dry run

Preview What Rsync Would Delete

`rsync --delete` is useful. It is also how people erase the wrong side.

rsync -avhn --delete ./source/ ./backup/ | grep '^deleting'
Dangerous Commands Deletes data

Print a Dry-Run Removal Script

The reviewable cleanup command is the one you print before you run.

find /var/tmp/uploads -xdev -type f -mtime +7 -printf 'rm -i -- %p\n' 2>/dev/null