slavik
September 10th, 2007, 03:23 PM
The idea is simple, pick a tool/command that you find very useful/neat and start a thread on it, describing it's usefulness and neatnet. I'll start. :)
I'll start with xargs.
basic xargs usage:
xargs <command>
explanation:
xargs reads from stdin and calls the command with what it read as the argument to the command.
simple usage:
echo filename | xargs rm
complex use:
if, for example, you need to find files that match a certain criteria (and there are a lot of them) and remove them, you could run find and then pipe the find output to xargs with rm being the command.
basically, xargs will call <command> on each arguement for <command> but not only that, it will try to fit as many argument to <command> as allowed by the shell. so, in example, rm could be run with 1000 files, if their names fit :)
I'll start with xargs.
basic xargs usage:
xargs <command>
explanation:
xargs reads from stdin and calls the command with what it read as the argument to the command.
simple usage:
echo filename | xargs rm
complex use:
if, for example, you need to find files that match a certain criteria (and there are a lot of them) and remove them, you could run find and then pipe the find output to xargs with rm being the command.
basically, xargs will call <command> on each arguement for <command> but not only that, it will try to fit as many argument to <command> as allowed by the shell. so, in example, rm could be run with 1000 files, if their names fit :)