Applying xargs

Posted by Scott_Ruecker on Feb 24, 2011 1:17 PM EDT
Linux Journal; By Johan Thelin
Mail this story
Print this story

There are some commands that turn out to be more useful than first meets the eye. In my opinion, xargs is one of those commands. It takes the standard input and uses it to build a command line. It's nothing fancy, but it's very handy in some situations. As soon as you have a list of files, you can easily do something to them. A favorite, common enough to have a shell script of its own on my machine, is clean-titles.sh. It simply locates all backup files using the pattern *~, and then passes them on to rm. The result is a nice and clean current working directory and sub-tree.

Full Story

  Nav
» Read more about: Story Type: Editorial; Groups: Linux

« Return to the newswire homepage

This topic does not have any threads posted yet!

You cannot post until you login.