The xargs command is one that many Unix users take advantage of in only some familiar context, such as using it along with a find command to do something with the particular files once you find them. But it can used for doing a lot of other things on the command line that might surprise you.

Xargs is generally used to take input generated by some other commands and then using it to create and run other commands. This can be a big time saver. When used with the find command, for example, xargs allows you to create commands to manipulate the found files in some way. You might want to find all files in the certain folder that end with .pl or .sh and make them executable. Or you might want to remove all files that end in .old. These tasks are very easy to do with an xargs command appended to your find command. Here are some simple examples:

To read this article in full or to leave a comment, please click here

Source: COMPUTER WORLD