If we want to delete all files and directories we use, rm -rf *
.
But what if i want all files and directories be deleted at a shot, except one particular fi
mv subdir/preciousfile ./
rm -rf subdir
mkdir subdir
mv preciousfile subdir/
This looks tedious, but it is rather safe
rm -rf *
, its results depend on your current directory (which could be /
;-)*
: its expansion is limited by ARGV_MAX.