I created a tutorial on Linux Terminal Tools a while ago where I covered many topics but not in too much detail. Perhaps going down the rabbit holes on these slides might help: https://ketancmaheshwari.github.io/pdfs/LPT_LISA.pdf
Ask HN: How do I become a shell god?
31–34 of 34 posts
Re: Ask HN: How do I become a shell god?
#32If you encounter a problem or task, then do it using shell commands. This will push into asking the question "what command can do X?" and "how do I connect command X to command Y?" and "how do loop commands over output?". Then just keep doing that over and over again. Learn the shell chainsaw: `xargs`. `xargs -L` vs `xargs` and `xargs -I` (examples will say use `{}` but I'm partial to `xargs -I @` because that works…
Can you explain or link further about the “chainsaw?” Google comes back with this post.
Re: Ask HN: How do I become a shell god?
#33My way is: Try to write small loops and pipes on the command line. I do things like this all the time: for i in foo*.txt; do mv $i OLD-$i; done You'll find this breaks sometimes, so use control-r to recall the command and fix it for i in foo*.txt; do mv "$i" "OLD-$i"; done if it gets too long, copy/paste it into a file like ~/bin/renamer and multiple lines and indenting and make it a more permanent part of your colle…
Hi, As of yours loop, such thing, when renaming files in bash, you can do `mv {,OLD-}foo*.txt` Great practice would be to write report scripts which aggregate multiple data sources into single array of predefined objects which are finally sent into `stdout`, `/var/spool/user` or anywhere else.
I don't think so. Doesn't this break when the glob matches more than one?
Re: Ask HN: How do I become a shell god?
#34By reading 1 dedicated shell book e.g. "Linux Command Line and Shell Scripting" you'll be at the top 10% of shell connoisseurs. That said, I challenge the usefulness of deep shell knowledge. If you're planning on writing 300 lines shell scripts, you're most likely doing it wrong, you should be using a full featured, modern programming language.
That is uninspiring... is totally fine to have long shell scripts, and in itself, is no easier nor harder than any other language. Worth noting that shell is a programing environment (not language) so is highly dependent on the tools you are using or gluing together to accomplish something.
If you think that python and bash are equally equipped, think again.