Pass Argument Lists to Commands in Xargs


show more xargs: Passing argument lists to commands provides you with in-depth training on IT. Taught by Kevin Skoglund as part of the Unix for Mac OS X Users show less
please wait ...

xargs: Passing argument lists to commands

In this movie we'll learn to use xargs to pass argument lists to commands. xargs is kind of a funny name. It's short for execute as arguments. What xargs does is it parses an input stream into items and then it loops through each item in that list and passes it to a command. I think it's easier to understand if we actually see it in action. So you remember that we had the wc command before for word count. So if we do word count on our lorem_ipsum.txt file that's inside our Unix files directory, you see that it comes back and it tells us the number of lines, words, and characters that are in lorem_ipsum.

Now, let's try a variation on this. Let's say if we want to echo lorem_ipsum .txt and we want to pipe that into wc. Now what it's doing is it's saying not the file lorem_ipsum.txt, but this string, this actual text lorem_ipsum.txt, how many characters does that have? There is 16. So that's what it's doing. It's not looking at the file. It's looki...

xargs: Passing argument lists to commands
Video duration: 7m 25s 6h 35m Beginner

Viewers:

xargs: Passing argument lists to commands provides you with in-depth training on IT. Taught by Kevin Skoglund as part of the Unix for Mac OS X Users

Subject:
IT
Software:
Mac OS X Unix
Author:
please wait ...