How do I remove certain files from a different directory than $PWD using the bash shell script.
Looking at the documentation for rm, it appears that rm only works in $PWD.
Am I forced to use this method:
oDir=$PWD
cd directorytoremovefiles
rm files
cd oDir
rmcertainly does work for deleting files in another directory.Whatever gave you that idea from the man page, I certainly hope it’s not this:
The documentation you refer to, talks only about having write & execute permission to the directory you are deleting from.
So you only need: