5 ms·
The Linux Command Line
- noahbergamasco 2y agoI have the book and love it!
- asicsp 2y agoPrevious discussion: https://news.ycombinator.com/item?id=34161081 https://news.ycombinator.com/item?id=34161081 (250 points | Dec 29, 2022 | 106 comments) I have a collection of resources for Linux CLI and Shell Scripting here: https://learnbyexample.github.io/curated_resources/linux_cli_scripting.html https://learnbyexample.github.io/curated_resources/linux_cli...
- necrotic_comp 2y agoKnowing the command line is one of those unsung critical skills of being a software engineer. Doesn't really matter so much what flavor of command line you're using (though bash is great for obvious reasons), but the ability to glue different, disparate commands together through pipes is one of the most efficient ways of getting throwaway work done. Heck, just knowing IFS=$'\n' and how to do a for loop will get you a long way.
- fellerts 2y agoShellcheck and cheat.sh will get you most of the rest of the way!
- sirwitti 2y agoDidn't know about cheat.sh. Thank you for that, I love it!
- LinuxBender 2y agoAlso CommandLineFu [1] has some halfway decent examples for those that learn better from examples. In may be best to test the examples in a throw-away VM as things change and environments may differ. [1] - https://www.commandlinefu.com/commands/browse https://www.commandlinefu.com/commands/browse
- nickjj 2y ago> Knowing the command line is one of those unsung critical skills of being a software engineer. Yep, the command line is what lets you solve "We have 178 CSV dumps of tables that has ~60 GB of data and we want them imported into a SQL database, there's no previous DB schema info, here's a zip file of questionably named CSVs, can you have this done in 2 days?". Meanwhile there's 8,000+ columns of data that are strings, booleans, datetimes, etc. and some of the files are 15 GB each. It didn't take too much shell scripting to solve that problem in a way that you can run it against a directory of CSV files and have it produce SQL files with table schemas that can be created and then generate the SQL to efficiently import them from a CSV. Basically a little bit of shell scripting and using tools like find, head, sed, grep, wc and friends. It took 4 hours to solve the problem in a way that was testable.
- remram 2y agoI would have reached for Python/Perl at this point, just because something can be done with bash and sed doesn't mean it should (not a diss, you got it done so you were right)
- necrotic_comp 2y agoyep, I recently did something similar with data that wasn't updated properly and programmatically generated thousands of targeted SQL statements to fix our database. A little bit of python and a lot of shell scripting. One of my biggest moments was figuring out you could run SQL from the command line, using environment variables in the query string.
- 2y ago
- HankB99 2y agoThe Unix Programming Environment - Kernighan and Pike Got me started. Probably still useful, hardly available (unless your library has it.)
- NoboruWataya 2y agoThis was the website that finally made the command line "click" for me (many years ago). A very good intro.
- justaj 2y agoFor me as well, but one should note that the book it links to contains many errors which are reported by Shellcheck.
- lazyant 2y agoFor people new to Linux see also https://linuxupskillchallenge.org/ https://linuxupskillchallenge.org/
- javier_e06 2y agoLearning the linux command line is like learning to ride a racing bicycle with clip pedals.. here comes the red light. /bin/true && echo "indeed" && /bin/false || echo "uh?"
- Zambyte 2y agoLinux has no command line :)