ubuntu:xargs:run_multiple_commands_with_xargs
Ubuntu - xargs - Run Multiple commands with xargs
To run multiple commands with xargs, use the -I option.
command1 | xargs -I % sh -c '[command-1] %; [command-2] %'
Example
echo "file1 file2 file3 file4" | xargs -t -I % sh -c '{ touch %; ls -l %; }'
ubuntu/xargs/run_multiple_commands_with_xargs.txt · Last modified: 2021/06/22 12:09 by peter