2 ms·
If I'm going to be doing something major to a lot of files, I often write a script that outputs the commands to execute, so I can verify what's going to be done
by barrkel 15y ago
If I'm going to be doing something major to a lot of files, I often write a script that outputs the commands to execute, so I can verify what's going to be done. Then I reexecute and pipe to bash.
It's not quite applicable to something used as off-handedly as rm, though it could be done. Something like:
make-rm -rf /*
might produce output like:
rm /usr/bin/a
rm /usr/bin/b
# ...
rmdir /usr/bin
rm /usr/lib/a
#...
And so on. That can then be piped to bash as a confirmation.