Xargs Should Be In Your Command Line Toolbag

  Рет қаралды 99,828

DistroTube

DistroTube

Күн бұрын

Xargs is an important shell utility to know because it allows you to execute to pass standard input as an argument to another command. While many command line programs allow standard input to be used as a parameter (things like grep, sed, awk etc.), many other programs do not allow for this (such as echo and rm). This is where Xargs comes in handy.
REFERENCED:
► man7.org/linux...
WANT TO SUPPORT THE CHANNEL?
💰 Patreon: / distrotube
💳 Paypal: www.paypal.com...
🛍️ Amazon: amzn.to/2RotFFi
👕 Teespring: teespring.com/...
DONATE CRYPTO:
💰 Bitcoin: 1Mp6ebz5bNcjNFW7XWHVht36SkiLoxPKoX
🐶 Dogecoin: D5fpRD1JRoBFPDXSBocRTp8W9uKzfwLFAu
📕 LBC: bMfA2c3zmcLxPCpyPcrykLvMhZ7A5mQuhJ
SOCIAL PLATFORMS:
🗨️ Mastodon: distrotoot.com...
👫 Reddit: / distrotube
📽️ LBRY/Odysee: odysee.com/$/i...
DT ON THE WEB:
🕸️ Website: distrotube.com/
🐿️ Gemini Capsule: gemini://distro.tube
📁 GitLab: gitlab.com/dwt1
FREE AND OPEN SOURCE SOFTWARE THAT I USE:
🌐 Brave Browser - brave.com/dis872
📽️ Open Broadcaster Software: obsproject.com/
🎬 Kdenlive: kdenlive.org
🎨 GIMP: www.gimp.org/
🎵 Ardour: ardour.org/
💻 VirtualBox: www.virtualbox...
🗒️ Doom Emacs: github.com/hli...
Your support is very much appreciated. Thanks, guys!

Пікірлер: 215
@sasakanjuh7660
@sasakanjuh7660 3 жыл бұрын
Just a tip, if you are trying to create a bunch of sequentially numerated files with touch, you can use bash ranges {} syntax, like "touch {1..1000}".. It's really convenient, and it works with other types of sequences (a..z), and you can even pass a step in which next item will be incremented :) Nice video, btw! :)
@first-thoughtgiver-of-will2456
@first-thoughtgiver-of-will2456 3 жыл бұрын
I've been writing bash scripts for years now and never bothered to thoroughly read the documentation. I have always used an inferior work around for this thank you for showing me the formal solution.
@thecashewtrader3328
@thecashewtrader3328 3 жыл бұрын
Yay uwu
@swindlesmccoop
@swindlesmccoop 3 жыл бұрын
yes i always would just set whatever i needed as a variable and use that but sometimes it just wouldnt work
@emiliadaria
@emiliadaria 3 жыл бұрын
Hey DT, your comparison of "-exec" and "xargs" wasn't entirely fair. Using -exec with the semicolon is more similar to calling xargs with the "-L 1" option. A fair comparison would be to use "find ... -exec rm {} +". The "+" tries to fit as many arguments to one command as it can just like xargs by default.
@sorrowfulevening8201
@sorrowfulevening8201 3 жыл бұрын
@Terminalforlife (LL) rm -f *.txt will do the job, no need for find.
@amx2311
@amx2311 3 жыл бұрын
@@sorrowfulevening8201 except the find results are not necesarily always in the same folder, nor will you know in what folders the results will pop up.
@sorrowfulevening8201
@sorrowfulevening8201 3 жыл бұрын
@@amx2311 agree.
@fagcinsk
@fagcinsk 3 жыл бұрын
@@amx2311 ... or if you have too many files to fit to arguments length.
@SylvesterInk
@SylvesterInk 3 жыл бұрын
Correct me if I'm wrong, but isn't the -exec functionality of find slower because it's executing the command for each individual find result, much like running `xargs -n 1`? I tested the find command using `-exec rm {} \+"`, which appends the results to a single command, and got the same time results as using xarg. So if you're using find, it's pretty much comparable to use -exec or xargs interchangeably, for basic tasks, though xargs is obviously more versatile for tasks that aren't related exclusively to the results of find.
@SylvesterInk
@SylvesterInk 3 жыл бұрын
@Terminalforlife (LL) That's where I went to confirm the use of -exec vs xargs, and it's exactly as I described. (The man file even makes the comparison to xargs for `+`.) I tested the 4 commands myself. find using `;` and `xargs -n 1` have nearly the same execution time. find using `+` and `xargs` also have nearly the same execution time (in fact find is just slightly faster.) I'm not trying to say that one method should always be used over the other, as it really depends on the situation. The point is that -exec is not slower than xargs when making an equivalent comparison.
@Hifonics78
@Hifonics78 3 жыл бұрын
Thank you DT for all what you do.
@DistroTube
@DistroTube 3 жыл бұрын
Thanks for watching!
@eli1882
@eli1882 3 жыл бұрын
All what you do?
@thecashewtrader3328
@thecashewtrader3328 3 жыл бұрын
Yes
@jacobhinchliffe6659
@jacobhinchliffe6659 3 жыл бұрын
@@eli1882 whetever
@InfiniteQuest86
@InfiniteQuest86 3 жыл бұрын
xargs is a true lifesaver when it's needed. One key example is when you have a tool that needs to run on every file in a directory. Using ls and xargs with -n 1 can really blast out the results compared to trying to bash for loop it or something. The problem is people don't even know about it to consider it as an option.
@vikingthedude
@vikingthedude 2 жыл бұрын
Yeah I've always struggled to write bash for-loops because 1) They look kinda noisy when written inline and 2) I don't usually write my code in bash. With 'ls -1 | xargs' (or with -n 1 like you said) the command looks so much cleaner and is more declarative
@phylwx
@phylwx 3 жыл бұрын
You're content is getting way better DT, congrats! I love this vid, really nice info.
@josecruz2574
@josecruz2574 3 жыл бұрын
Yes.
@ricknaam5658
@ricknaam5658 3 жыл бұрын
I use xargs to push to all git remotes: alias gpsa="git remote | xargs -I remotes git push remotes master"
@MrLeoStief
@MrLeoStief 3 жыл бұрын
Nice video, but recommending against using `find -exec` doesn't make sense. The reason it took so long is because you instructed it to run 1,000 individual rm commands by putting a semicolon at the end; replace that with a plus sign (or just use the -delete option in this case) and find will bulk delete those files in no time with no need for xargs.
@Mr76Pontiac
@Mr76Pontiac 3 жыл бұрын
XARGS is one of those insanely useful tools. It's something in my toolbox that I use EVERY day when I manage any one of the hundreds of servers I could be dealing with each day. Just for clarification, XARGS doesn't make FIND any more or less efficient. FIND will execute the RM statement (Or whatever it's internal equivalent is) for each result it returns. XARGS will pass as many parameters to RM (or whatever command) as it can if you don't set a limit on the number of parameters to pass in. That means that the RM command may be run multiple times against a large number of files/parameters. RM is intelligent with file transactions, just the same as relational databases are intelligent with their ACID transactions. As an example to really put this to the test: for c in `seq 100` do echo "----" echo "${c} step" echo "Creating Files" time seq 1000 | xargs -i touch {}.txt echo "Running RM with ${c} parameters" time find . -type f -name '*.txt' | xargs -n ${c} rm done This will start a loop. In each loop, it'll create 1000 files, then promptly delete them passing a number of files/parameters to be deleted each loop. So on loop one, a single file/parameter will be passed to RM for it to be deleted. On the second pass, two files will be passed to RM, etc. Note that `seq 100` is wrapped in the BACK-TICKS (Unshifted-Tilde key on standard US keyboards, at least), it's not a standard single quote.
@davidh.4944
@davidh.4944 Жыл бұрын
Rather than xargs, I've recently been learning how to use GNU parallel, and I love it. Its syntax is more cumbersome to work with than xargs, but it's also much more powerful. You can interleave multiple inputs (e.g. from stdin and files at the same time), position the incoming strings in any order you want in your command, and modify them before use (e.g. to remove file paths). You can even distribute jobs over multiple machines via ssh. I've updated a few of my scripts to use it and the results have been exceptional. For example I have one script for converting flac files to vorbis, ensuring that the filename, tags, and art are all kept intact, and the time to process one album of tracks dropped from about 3 minutes to under 20 seconds. Sweet.
@rsmith31416
@rsmith31416 3 жыл бұрын
You really need to be careful with your examples. xargs is famously broken and should *only* be used when reading null-delimited input. I can't link to external resources here, but if you're interested, go to "BashPitfalls - Greg's Wiki". In any case, if you really want to use find with xargs, follow this pattern `find . -print0 | xargs -0` and that should be safe. As a better alternative, GNU parallel is much more flexible and powerful than xargs.
@user-ux2kk5vp7m
@user-ux2kk5vp7m 3 жыл бұрын
When would I not have null delimited input?
@GreyDeathVaccine
@GreyDeathVaccine 3 жыл бұрын
+1 for GNU parallel :-)
@rsmith31416
@rsmith31416 3 жыл бұрын
@@user-ux2kk5vp7m You won't have null-delimited input in almost every instance. Piped input is delimited by new lines.
@11WicToR11
@11WicToR11 3 жыл бұрын
that `find -exec` vs `xargs` speed, isnt that just that `xargs` puts it all in one line and executes one time with 1000 arguments instead of one by one? i wouldnt call `find -exec` slow just for that, at least that generalization doesnt feel right
@drelkin86
@drelkin86 3 жыл бұрын
on my machine, there is a small, but consistent difference between using `find -exec` vs `xargs -n 1`. `find -exec` is still measurably slower than `xargs -n 1`, but the difference is way under 100ms.
@ShahFahad-zf3iz
@ShahFahad-zf3iz 3 жыл бұрын
@@drelkin86 i believe this should not be the case because there are overhead involved while creating a pipe, so xargs -n 1 should be slower.
@11WicToR11
@11WicToR11 3 жыл бұрын
@@ShahFahad-zf3iz how is that relevant to case of ls? i mean we simply run commands with argument ...xargs nor find should not pipe data but simply start N processes with arguments. I m pretty sure reason that dt thinks one is slower is that find created 1000 processes while xargs just one with 1000 arguments in this very case ...there should not be no stdin pipes involved while all the stdout pipes should be directed to the final output. If we wanna compare it fairly we would compare find with xargs with flag that runs each argument 1 by 1
@pewolo
@pewolo Жыл бұрын
Good video! I have one more command in my arsenal. But for the files creations, you can easily do that with bash brace expansion. The syntax looks like this: touch {1..1000}.txt
@ryanporidge1517
@ryanporidge1517 3 жыл бұрын
Love the new bash tuts! Looking forward to more
@rc4652
@rc4652 2 жыл бұрын
This is very very cool.
@pavelsapehin4308
@pavelsapehin4308 7 ай бұрын
Great structured intro into xargs, thanks DT! Here is an approximate ToC for this video: 00:48 basic xargs usage + echo 02:03 xargs -t flag = show expanded output 02:55 xargs + ls = recursive ls 03:36 example: /etc/passwd 04:00 passwd + cut + sort + xargs 04:41 xargs -I (capital i) flag = alias for arguments 06:19 example: make 1000 txt files: seq + xargs + touch 07:21 example: mv *.txt to *.text with ls + cut + xargs 08:35 xargs -n flag (number of args) = multiline output with 09:39 example: seq + xargs + bash + sleep 11:34 example: xargs + find = remove all *.text 13:50 performance: find --exec vs xargs rm 15:18 summary This table of content was created using "Smart Bookmarks for KZbin" chrome extension.
@szevaa97
@szevaa97 2 жыл бұрын
Thank you very much for this video
@mike67246
@mike67246 4 күн бұрын
Excepcional!!! Estuvo grandiosa la explicación y ejemplos. Ahora, a ponerlo en práctica.
@minhthuan4479
@minhthuan4479 2 жыл бұрын
That's such a cool command. I like it.
@locatemarbles
@locatemarbles 3 жыл бұрын
Great timing DT. Was experimenting yesterday with fzf -m in combination with xargs and couldn't get the multiple inputs working. Them damn curly braces. Thank you.
@ananthuskumar1286
@ananthuskumar1286 3 жыл бұрын
Hey DT use + instead of ; . + appends
@archsapostle1stapostleofth738
@archsapostle1stapostleofth738 3 жыл бұрын
Comment to bring this video to the tops
@alexb3617
@alexb3617 Жыл бұрын
very informative video, it literally answered all my questions. meaning all important points were considered and answered, like different use cases and comparisons with other similar tools, which is preferable in which scenario and so on. very good work indeed
@first-thoughtgiver-of-will2456
@first-thoughtgiver-of-will2456 3 жыл бұрын
I have very strong "essing" on your videos is there any way you could turn down the upper frequencies in an equalizer for us all?
@amos660
@amos660 3 жыл бұрын
probably a couple db's around 5khz..
@madhavan_raja
@madhavan_raja 3 жыл бұрын
Or probably a de-esser would work
@thecashewtrader3328
@thecashewtrader3328 3 жыл бұрын
Yea same
@Mathcartney
@Mathcartney 3 жыл бұрын
or even the compressor setting
@amos660
@amos660 3 жыл бұрын
@@Mathcartney nope .. that would make it worst.. EDIT: unless we're talking dynamic compression of course. it's not that bad btw.. I don't hear it in my spkrs.
@bhaveshverma8629
@bhaveshverma8629 3 жыл бұрын
Very Very awesome video. So much to learn.
@jamesbond_007
@jamesbond_007 3 ай бұрын
Great video! One thing I don't think you mentioned which is great about xargs is how it chunks the input into "shell sized" pieces. The shell has a limited length of a command line or a limit on the number of command line arguments, and if you supply more than these, the shell will refuse to execute your command (example: if you have a find command that produces a list of 1 million files, like `ls $(find / -iname "*.txt")`, the shell will complain the command line is too longl). However, if you use xargs, it will automatically chunk the inputs into sizes that let the shell execute the xargs "command" successfully. This is related to the "-n" flag of xargs, and I guess is the default value for the number of args per chunk if you dont' supply "-n". This chunking alone makes xargs worth it to use for me. Also, the '-0" flag to xargs is quite useful: it parses null-delimited input into distinct command line args. Sometimes useful with `locate -0 '*.txt' | xargs -0 ls -lrt`
@amanwehib8367
@amanwehib8367 2 жыл бұрын
Very good explanation!!!!!!
@tutacat
@tutacat Ай бұрын
So should Zshell. Escaping variables is kind of required to be a good shell. Dont forget to use the newline delimiter. The reason piping find is faster is because find has to find all the files, in a single thread, then run the command. xargs can group those files, run multiple processes, run while find is still working too.
@gorsama-2190
@gorsama-2190 3 жыл бұрын
Beautiful
@C6438911
@C6438911 3 жыл бұрын
Hey DT! How do you get " took 5s" in the terminal prompt ? What do I need to add to the command prompt to get the time it took to execute a command ?
@DistroTube
@DistroTube 3 жыл бұрын
It's part of the starship prompt. I did a video on starship some time ago. It's a great shell prompt that works on bash, fish and zsh.
@C6438911
@C6438911 3 жыл бұрын
@@DistroTube I see, thank you :) I take a look at it. thanks for a quick answer! cheers!
@C6438911
@C6438911 3 жыл бұрын
Found something similar on github. It's called "fish-command-timer". just tested it and works.
@dapodix
@dapodix Жыл бұрын
xargs is all fine, dandy and magical until you deal with filenames with spaces and other weird characters - then xargs does make your life quite painful. It was written in an era where shells didn't have good capabilities. Nowadays it's Best to avoid it in favour of using globs/expansions, for/while loops that bash/zsh/ksh provide. As for find... -exec. You can make use of the + modifier instead of \; to have find execute on as many args as possible instead of iterating through the list and executing one by one - this speeds it up to be as fast if not faster (avoiding the piping overhead) than piping to xargs.
@wisnoskij
@wisnoskij 3 жыл бұрын
Your system does not seem to understand alphabetical order? it places single character numbers after everything else. For example (498, 499, 4). Waa really confused about how it should possible screw up that much, but it seems like Linux really just does not care about extensions very much? which seems to be the only way it could screw up this colossally.
@max_ishere
@max_ishere Жыл бұрын
You mentioned that ls doesn't take args from stdin. Here is how I clean up my rust projects: rm $(find rust/ -name target) What's wrong with that?
@guyboisvert66
@guyboisvert66 3 жыл бұрын
This is really useful! I made a script that processed several million files, output from the find command using -print0 and xargs with the -0 argument (for using paths / filenames with spaces) and launching another script, 16 of them in parallel with -n1 and -P16 arguments to xargs. The performance was phenomenal: the Dual Xeon E5-2660v2 (2 x 8 cores) usage was up to 95%, averaging about 80%. This is multi-threading bash scripting!
@crazychicken0378
@crazychicken0378 3 жыл бұрын
Thanks again for these command line tutorials. I might honestly start scripting soon for really simple actions. Your videos are definitely where I look for information on all that. I might honestly learn posix shell script or bash or something haha
@paulstaf
@paulstaf 3 жыл бұрын
I use bash and expect scripting exclusively to manage Cisco devices in an enterprise environment. Don't have to worry about libraries from other programming languages being installed on whatever system I am using at the time.
@salomonchambi
@salomonchambi 2 жыл бұрын
12:13 What about using the -delete flag with find command?: find . -type f -name "*.text" -delete Is there any advantage over -exec flag?
@jezbon
@jezbon Жыл бұрын
It's still amazing that decades after shell and all these little tools were created for Unix that they're still insanely awesome. Still. That's just mindblowing. They were designed as the best operating system/logic building blocks of all time. Just a wonder of human ability to have nailed this.
@greenmanreddog
@greenmanreddog 3 жыл бұрын
I'm sure 'time' measures the execution time of only the find command, this includes the file deletion with -exec, but not with |xargs, so is this a fair comparison?
@matthewlandry1352
@matthewlandry1352 3 жыл бұрын
Never knew about xargs! Neither did my spellchecker. Now we both do! Thanks DT
@shinbart7554
@shinbart7554 2 жыл бұрын
Thanks for video so helpful to me (a beginner for linux) BTW what's going on with caption it's set to Vietnamese
@BryonLape
@BryonLape 7 ай бұрын
Been a user of Unix since 1987 and never learned a thing about shill. I feel so ignorant.
@gonzalooviedo5435
@gonzalooviedo5435 Жыл бұрын
When do you will write a book of linux?. Arch Linux by DistroTube, damn I will buy it before you write the first line
@cortana324
@cortana324 3 жыл бұрын
Concise and informative as always!
@YannMetalhead
@YannMetalhead 2 жыл бұрын
Good video, thank you!
@smit17xp
@smit17xp 3 жыл бұрын
Thanks. This will be very time saving
@EscapeePrisoner
@EscapeePrisoner 3 жыл бұрын
XXXX is a brand of beer in my country. People use it as standard input ALL THE TIME.
@JustinBumpusBarnett
@JustinBumpusBarnett 3 жыл бұрын
Good stuff my dude. I had to open up a terminal and try this out myself.
@Harrun
@Harrun 13 күн бұрын
Thank you good sir, your videos are very helpful.
@rdg8268
@rdg8268 2 жыл бұрын
Can I use xargs with cut command through a comma delimited file, and pass each position as next command arguments?
@Dreams-un1kb
@Dreams-un1kb Ай бұрын
How did you make your own custom error message? Thats so cool !!
@Tb0n3
@Tb0n3 3 жыл бұрын
Is it just me or is the audio clipping?
@DistroTube
@DistroTube 3 жыл бұрын
Audio was really messed up on this video.
@hupa1a
@hupa1a 2 жыл бұрын
Great video!
@swish996
@swish996 2 жыл бұрын
I will never write a for loop since I know 'xargs -n 1 -I {}' thanks a lot sir.
@phamh79
@phamh79 3 жыл бұрын
thank you DT, love your content.
@s4degh
@s4degh Жыл бұрын
These command line utility videos are amazing. Thank you for the content.
@stephenflee7989
@stephenflee7989 Жыл бұрын
Hands down the best rundown of xargs I've ever seen, you rock my dude!
@sabitkondakc9147
@sabitkondakc9147 2 жыл бұрын
Greate Share! cool expanation, -exec is always a huge mess.
@fennecbesixdouze1794
@fennecbesixdouze1794 2 жыл бұрын
This was an incredibly well written and produced video. Really spectacular job running down this command.
@sjoervanderploeg4340
@sjoervanderploeg4340 3 жыл бұрын
But this does not work when there are spaces in filenames as each is regarded a separate argument!
@oneanime5551
@oneanime5551 3 жыл бұрын
Thank you DT for this amazing video!!!
@gibraanjafar1669
@gibraanjafar1669 3 жыл бұрын
Lovely explanation. Thanks a ton DT
@davidglass4876
@davidglass4876 3 жыл бұрын
Is | xargs ls > ls * because it’s more hardcore 😂
@Chiqc
@Chiqc 2 жыл бұрын
beautiful video, thank you sir
@vikingthedude
@vikingthedude Жыл бұрын
Why is xargs so much faster than find?
@combsmsteven
@combsmsteven 3 жыл бұрын
Just discovered your channel, love it
@aless78-m9
@aless78-m9 3 жыл бұрын
Wow, cool explanation. Thank you
@janekmachnicki2593
@janekmachnicki2593 4 ай бұрын
Thanks for another briliant tutorial
@Linux.Learner
@Linux.Learner 3 жыл бұрын
AWESOME SIRE! Much respect.
@jaimeseuma6969
@jaimeseuma6969 Жыл бұрын
That's a nice tutorial! thanks a lot for it
@kungfujesus06
@kungfujesus06 3 жыл бұрын
For file stuff I tend to prefer find's -exec
@n0kodoko143
@n0kodoko143 3 жыл бұрын
Love ya DT!! thank you!
@markmcdonnell
@markmcdonnell 3 жыл бұрын
I'm also impressed by perf of xargs
@fintarabg
@fintarabg 3 жыл бұрын
So useful, and so well explained!
@SuRFaceGoD
@SuRFaceGoD 3 жыл бұрын
please do a tutorial on shell expansion
Жыл бұрын
Thank you, very much, my friend!
@Merigold83
@Merigold83 3 жыл бұрын
Your first example dosen't need "xargs" echo will print out the output of the command, that is enclosed with ` Example: "echo `seq 5`" will output the same as "seq 5 | xargs"
@playz2102
@playz2102 3 жыл бұрын
why not just use process substitution?
@AngelFelizF
@AngelFelizF Жыл бұрын
Thanks, excellent video
@alisafapour9380
@alisafapour9380 Жыл бұрын
Thank you. Very helpful.
@barmetler
@barmetler 3 жыл бұрын
I always used subshells, like (ls -l -a -h) = (ls `echo "-l -a -h"`) = (ls $(echo "-l -a -h")) = etc. At 1:08 that would be (command2 `command1`) or (command2 $(command1)) But yeah xargs is way nicer, because otherwise you would end up in bracket hell at some point XD
@bitti1975
@bitti1975 3 жыл бұрын
Nice, learned a few new things. Regarding 'printf': it's not the quotes wich where missing, but that the first argument of printf should be a format string (e.g. "%s " to get the same behaviour as 'echo'). Regarding 'find' --exec: 'rm' isn't the best example here, since 'find' has a '-delete' flag which does the same but as fast (or faster) as your xargs solution. But I can see how this trick can be useful in general. Another thing which might have been nice to show: I often use xargs without any input pipe, so it just takes input from stdin which I find useful if I just want to process a list I've in my clipboard.
@gonzalooviedo5435
@gonzalooviedo5435 Жыл бұрын
From Chile, thanks for your dedication and your team also, you are doing fantastic work every day, like the format of your videos and your english is very good, thanks for not talking fast!. I'm addicted to linux.
@mohammednawaz7501
@mohammednawaz7501 3 жыл бұрын
Hey DT, please share your colorscript which comes when you do a clear command
@DistroTube
@DistroTube 3 жыл бұрын
Check my dotfiles repo on my GitLab (in show description). The clear color thingy is function in my config.fish.
@MrSasukeUchihaEMS
@MrSasukeUchihaEMS 3 жыл бұрын
thaaaaaaaaaanks
@charliekim2939
@charliekim2939 Жыл бұрын
I am learning a lot of command line tips and tricks from you. Thanks. By the way, you frequently use 'clear' to clear screen. You could use ctrl-l (el, not ai) to do the same, which saves a few finger movements.
@archishabanerjee9418
@archishabanerjee9418 3 жыл бұрын
Hey! This was very helpful, lucid and comprehensive. I wanted to ask .. how do we set the time taken to be displayed once a process is executed - Like it showed " took 5s" for you. Please do make a video for the same. Thanks in advance!
@leroyonlinux283
@leroyonlinux283 3 жыл бұрын
I love this videos explaining those basic CLI tools. Because if you don't know they exist, its hard to find them. ESpecially for new users.
@markmcdonnell
@markmcdonnell 3 жыл бұрын
TIL the -t, -n, and -P flags
@ozzman530
@ozzman530 3 жыл бұрын
I use -a option to read from a file of hosts, and xargs can ping every host in the file. Using the -P option lets me ping multiple hosts at a time, and I can find the status of hundreds of hosts in a matter of seconds using ping. Good for identifying network problems.
@dvr2alarm
@dvr2alarm 3 жыл бұрын
a count of processes in "-P" would keep the system responsive to other commands and functions. usually a quarter of the "ulimit -u"
@portlyoldman
@portlyoldman 3 жыл бұрын
Drove my Alexa totally mad! I thought having the wake up word as Echo was a good idea 🥺
@kshatriya5
@kshatriya5 2 жыл бұрын
i love your time cmd very much
@ziangtian
@ziangtian 11 ай бұрын
This is truly much better than reading the manual pages! loved the accent btw :)
@kuliksco
@kuliksco 3 жыл бұрын
With any linux OS released in the past 10 years you should be able to use -delete instead of -exec rm -f {}
@kpwlek
@kpwlek 3 жыл бұрын
i love xargs, but people think Im crazy when I use it...
@GonzaloOviedoLambert
@GonzaloOviedoLambert 3 жыл бұрын
Thank you, very clear explanation and tested and documented. After 17 years, finally I will use xargs
@johnarleevillarivera286
@johnarleevillarivera286 3 жыл бұрын
Nice explanation DT. Just found out about this channel what a gem.
@RodrigoPolo
@RodrigoPolo 2 жыл бұрын
¡THANK YOU!
@RodrigoPolo
@RodrigoPolo Жыл бұрын
BTW, with ChatGPT I found a couple of interesting commands: find "$(pwd)" -type f -iname "*.md" -print0 | xargs -0 grep -l -i "keyword" find "$(pwd)" -type f -iname "*.md" -print0 | xargs -0 grep -zi "keyword" --files-with-matches and find "$(pwd)" -type f -iname "*.md" -print0 | xargs -0 grep -n -H -i "keyword"
@pushkarmadan5455
@pushkarmadan5455 3 жыл бұрын
Although I know a bash substitutes for some of the things shown in video there is no harm learning new methods of doing things.
Two Powerful Command Line Utilities 'cut' And 'tr'
15:18
DistroTube
Рет қаралды 33 М.
Learning Sed Is Beneficial For Linux Users
19:27
DistroTube
Рет қаралды 84 М.
Миллионер | 1 - серия
34:31
Million Show
Рет қаралды 2,1 МЛН
Bike Vs Tricycle Fast Challenge
00:43
Russo
Рет қаралды 102 МЛН
💩Поу и Поулина ☠️МОЧАТ 😖Хмурых Тварей?!
00:34
Ной Анимация
Рет қаралды 2 МЛН
The Joker wanted to stand at the front, but unexpectedly was beaten up by Officer Rabbit
00:12
EVERYONE Needs to Learn a Little Bit of AWK!
16:29
Gary Explains
Рет қаралды 398 М.
8 super heroic Linux commands that you probably aren't using
8:38
Engineer Man
Рет қаралды 728 М.
Learn These 3 Commands To Go From Terminal Noob To Power User
19:31
all about xargs ! (beginner - intermediate) anthony explains #200
17:16
anthonywritescode
Рет қаралды 9 М.
Xargs Explained
8:53
TomNomNom
Рет қаралды 45 М.
Linux Directories Explained in 100 Seconds
2:53
Fireship
Рет қаралды 1,5 МЛН
Saving Time At The Command Line
13:49
DistroTube
Рет қаралды 75 М.
Why Use CAT Or GREP When You Can AWK?
11:13
DistroTube
Рет қаралды 78 М.
My 5 Favorite Linux Shell Tricks for SPEEEEEED (and efficiency)
11:06
How The 'awk' Command Made Me A 10x Engineer
10:40
RobertElderSoftware
Рет қаралды 173 М.
Миллионер | 1 - серия
34:31
Million Show
Рет қаралды 2,1 МЛН