cat hosts | xargs -I{} ssh root@{} hostname
glad to know this one :-) echo y | xargs -Ix echo x
how tricky! cat hosts | xargs -I{} ssh root@{} hostname
glad to know this one :-) echo y | xargs -Ix echo x
how tricky!As the article mentions, especially useful when combined with the -P flag for paralellism.
cat urlpaths.txt | xargs -I{} -P wget domain.com/{}
Another handy trick, is to use `sh -c` or `bash -c` to include multiple commands with xargs. cat dirs.txt | xargs -I{} sh -c 'cd {}; touch file;'