User Tools

Site Tools


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 13:09 by peter

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki