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 %; }'