Shell Magics

xargs

xargs pipes output of previous command as list of input to next command.

What we can do is for each output from previous we can execute perticular command.

Example to move all files in a given folder to a subfolder inside.

ls -a | grep -v new_path | xargs -I % sh -c "mv % new_path"

Magics Revealed: