Assuming the file list is in the 1.txt file, follow these steps:
xargs rm -r <1.txt
The -r option calls recursion to any directories named in 1.txt .
If any files are read-only, use the -f option to force delete:
xargs rm -rf <1.txt
Be careful about entering any tool that performs program deletions. Make sure that the files specified in the input file really need to be deleted. Be especially careful with seemingly simple typos. For example, if you enter a space between a file and its suffix, it will be two separate file names:
file .txt
there are actually two separate files: file and .txt .
This may not seem so dangerous, but if a typo looks something like this:
myoldfiles *
Then, instead of deleting all files starting with myoldfiles , you delete myoldfiles and all non-fuel files and directories in the current directory. Probably not what you wanted.
aks Jan 23 '14 at 7:26 2014-01-23 07:26
source share