≡ Menu

Bash Clobbering

HowTo Keep Files Safe From Accidental Overwriting With noclobber BASH Shell Option

The general format for redirecting output on Bash/ksh shell is:

command > output.txt
command > /dev/device

However, you may end up overwriting file accidentally using > operator. For example:

$ ls -l *.c > output.txt
[click to continue…]

Sysadmin because even developers need heroes!!!