This was fantastic. Actually motivating shell commands you might want to write, and guiding the viewer through the process, including when and why things don’t work is brilliant! Awesome pedagogy, you’ve earned a new sub!
Greetings mr. T. for us who truly enjoy your little educational cli videos, with all the regular apologies (you are busy, you are in love, you hunt bugs, you are saving the world, etc..) we can survive few more videos per annum... no need for any scripting or preps, just hit record and voila. Parfect.
Excellent stuff, Tom. Saw your 'find' command video, and have been waiting for your next upload since! Really enjoying this style of video. A few more of these, and you'll have one of the best, most accessible video series on getting the most out of the command line!
Hey Tom, I didn't know about your YT channel here! I fell in love with Vim and Bash scripting a couple of years back, thanks to your mash-up video with Stök in a coffee shop, after a hacking conference, explaining to him a few of the tricks up in your sleeves. I'm so glad to see you uploading here again, please keep 'em coming! ( also the format of these videos is really well stiched together, no fancy editions, just pure scripting and explanations, which is quite refreshing, thanks for this! ) Regards from Brazil.
I've never had to use xargs but I know it's very common, so I wondered what I was doing different. I use Nuhsell! It lets me do the following: open hostnames | lines | each { |url| host -t A $url } The 'lines' command splits text input into a list at each newline. Then I pass the 'each' command a Nushell closure where I run the 'host' command with the value form each line. And if I change the 'each' command to 'par-each', it will run each in parallel, in as many threads as I have available. Nice to know what xargs does finally, but it also makes me glad I use Nushell.
it always drove me crazy that the default for find and xargs wasn't to use as the separator character. This is what most other commands deal with but somehow these are weird and use spaces by default.
If you’re using xargs with sh -c, then might as well insert the argument as a positional parameter of sh which that inner shell expands as an actual variable ($1) rather than keep using -I{}, whose behavior is finicky in practice. That does require you to surround the argument to -c in single quotes, and to provide a placeholder parameter that will become $0 (I use "sh-c") since that is supposed to stand for the script name, but I get fewer surprises in the end.
xargs is a great tool. One of the many reasons I run WSL on my Windows machine. I tend to use XXXX with the -I argument because it shouldn't conflict with bash syntax, flags or filenames.
Awesome video as always , if you can continue this series and go over some other useful commands from Bug hunter/Red Teaming perspective like: host nslookup [also a bit of DNS explanation lol] grep [regex matching] awk tr jq [complex operations like replacing strings in json] gron nmap
I've never needed to use xargs, for loops have always been good enough for me, e.g for file in $(find . -type f); do tail $file; done or for file in $(cat listoffiles.txt); do tail $file; done Is there anything about xargs that makes it more useful than a standard for loop?
how can i learn all these damn unix/linux command line tools? not a joke for real, is there like a resource to learn about all of this? is this what a sysadmin does? i feel like there's so much power to be had with just the basic commnad line tools that are right there in every distro but i know nothing of them.
Almost everything I've learnt has been as a result of having a problem to solve, searching for options to solve it, and reading further into the tools I found along the way :)
You eerily sound like youtube.com/@NoBoilerplate Must be a glitch in the matrix. Great to see more videos from you, ❤ I especially enjoy your VIM tutorial with @STOk. I Always go back to it and discover something new.