xargs to copy file from text files to another directory 1

xargs to copy file from text files to another directory

xargs -a file_list.txt mv -t /path/to/dest

Here is what the above code is Doing:
1. The find command is used to find all files in the current directory and subdirectories that have a .txt extension.
2. The -print0 option is used to print the full path of each file, followed by a null character instead of a newline.
3. The output of the find command is piped to the xargs command.
4. The -a option is used to read items from the file_list.txt file.
5. The -t option is used to display the command on the terminal before it is executed.
6. The mv command is used to move all the files to the /path/to/dest directory.

Similar Posts