HomeОбразованиеRelated VideosMore From: theurbanpenguin

Using xargs in Linux

196 ratings | 12153 views
More videos like this online at http://www.theurbanpenguin.com The Linux philosophy is pretty much have lots of small apps so we can pipe the pu8tput of one command to another and build a custom effective program to meet our needs. Xargs is one of those programs that make this happen allowing use to control the input into the redirected application as required
Html code for embedding videos on your blog
Text Comments (14)
hello moto (2 months ago)
The period Is the parent or source, If you want to go deeper then you could use the parent of which would be a period period, and so on, Its pretty equal to maxdepth
Brandon Pierce (1 year ago)
This cleared up xargs substantially for me. I am going for my LPIC-1 exam and this command was extremely hard to grasp. I'm still somewhat unsure but at least I am using it in commands and getting the desired output. Thanks for the elementary level video.
Learn Linux (1 year ago)
I love using xargs! So freaking useful.
Ohmeko Ocampo (1 year ago)
What I don't understand is why do you need xargs if you have a pipes? I don't really understand for example why xargs is needed in this command: ps | grep -ie $1 | awk '{print $1}' | xargs kill -9
Learn Linux (1 year ago)
Ohmeko Ocampo In that one, xargs kills all processes that may exist with the PID specified in the first positional parameter. Xargs uses pipes because, like anything else that uses pipes, it does something with the output of the previous command. Xargs puts the output at the end (unless -i{} is used to place the ouput elsewhere, like with mv or cp) so a regular kill command would be kill PID. Xargs uses the output from the previous command to get the PID based on everything that led up to it. A simple exec would've sufficed IF there would be only one instance of that PID. Hope that helps. (or someone else, if you already know all this now) Actually, I don't think the PID is in the first column, so either that's not gonna work, or I'm too tired to remember the layout. xD PIDs are unique actually, IIRC. Okay, I think that's intended to be killall and to kill the process(es) based off the name. Sorry, I've just woken up and I'm not by my puter to test.
Common Yunus (1 year ago)
Excellent and Thanks.
pavan medam (2 years ago)
Thank You Very Much Sir
Victor Cappuccio (3 years ago)
haha pretty boxes :)
Brace expansion was new to me. Thanks a million!
lmind2 (3 years ago)
mushhushshu> The period tells find to look in the current directory.
arda7an (4 years ago)
+mushhushshu tishpak it means the current dir.
mushhushshu tishpak (4 years ago)
what is the purpose of the point behind the find command?
good to learn new tricks :)
whiteblazing (5 years ago)
Have I mentioned that this is the BEST Linux channel on YouTube?

Would you like to comment?

Join YouTube for a free account, or sign in if you are already a member.