Friday, 10 May 2013

Copying and Deleting the Files in unix/Linux using the text files as Input


To Delete the list of files with input as text file

We can use 'xargs' command to do that.

    >xargs rm <  input_file.txt

use -rf in case of deleting the folders as

    >xargs rm -rf  <  input_file.txt

To Copying/moving the list of files from the text file

    >cp  $(cat input_file.txt)  /destination_path

No comments:

Post a Comment