I want to see what files will be deleted when performing an
rm in linux. Most commands seem to have a dry run option to show just such information, but I can't seem to find such an option for
rm. Is this even possible?
Say you want to run:
You can just run:
echo rm *.txt
or even just:
to see what files
rm would delete, because it's the shell expanding the
The only time this won't help you is for
If you want to remove files and directories recursively, then you could use
find instead of
rm -r, e.g.
find . -name "*.txt" -print
then if it does what you want, change the
find . -name "*.txt" -delete