I got into programming fairly recently and currently I am working as a frontend dev. Often I find myself at a loss when I need to do simple tasks in the terminal, such as start a db server, handle packages, set up symlinks and paths. So, I end up going on stack overflow and mindlessly copy-pasting commands into my shell, hoping it would resolve the problem. I feel like I have a huge mess in my root directory and I don't know how to clean it up.<p>I tried to learn unix and shell by installing and using Arch Linux on my old laptop but I just ended up following tutorials without really understanding what I am doing. Right now, I am using MacOS.<p>What are some good resources that teach you more than cd, ls, mkdir and touch? How did you learn it?
I have a list of resources collected here [0] but they are mostly oriented towards `bash` and `linux` (I think Mac uses `zsh` these days) - there are enough differences to warrant this disclaimer<p>* <a href="https://ryanstutorials.net/linuxtutorial/" rel="nofollow">https://ryanstutorials.net/linuxtutorial/</a> is a good place to start for beginners<p>* <a href="https://mywiki.wooledge.org/BashGuide" rel="nofollow">https://mywiki.wooledge.org/BashGuide</a> and the rest of this wonderful wonderful site is recommended to understand `bash` and its features and gotchas<p>* <a href="https://explainshell.com/" rel="nofollow">https://explainshell.com/</a> gives you a quick help on the various parts of the command, including documentation<p>* <a href="https://www.shellcheck.net/" rel="nofollow">https://www.shellcheck.net/</a> is a must have tool if you are writing shell scripts<p>* <a href="https://linuxjourney.com/" rel="nofollow">https://linuxjourney.com/</a> is probably the most complete site to understand how things work in *nix environment<p>[0] <a href="https://github.com/learnbyexample/scripting_course/blob/master/Linux_curated_resources.md" rel="nofollow">https://github.com/learnbyexample/scripting_course/blob/mast...</a>
I don't have any resources beyond recommending searching something like "linux command line basics" in your favorite search engine, but I do have some advice. You have to conceptualize it at a higher level than "shell commands:" the shell is just a way to run programs, and pass arguments to those programs to do what you want. The names and parameters of most common programs like ls, touch, mkdir, etc[1]. will become second-nature over time. There's no fast-path to learning them, you just have to force yourself to use the command line in your daily workflows.<p>They look like 'commands,' but what's actually happening is the shell is searching directories that are listed in your $PATH environment variable, for an executable with the name you entered. Diving more into the mechanisms of how the shell works is potentially educational depending on your learning style.<p>Starting with Arch, you're setting yourself up for a bad time, since you'll be learning both basic command-line knowledge and how to configure linux from scratch. Ubuntu or Fedora might be better places to start. OSX will suffice for a unix-y environment, but there are definitely some quirks that won't translate nicely to linux-y distros if that's the direction you want to go.<p>Larger objectives you mention like starting a server, the first principle is still "what program can I run (i.e. call from the shell) to do what I want?" And in this case, it would be the program that manages processes for your system. Not sure what Mac uses, but many linuxes are using `systemd` nowadays. If you search `systemd basics` it will give a good sense.<p>[1] Shells also have built-ins (like cd) and you can learn a lot about the intricacies of them by doing actual shell scripting (e.g. "bash tutorial"), but it sounds like you're mostly interested in getting your feet wet with the basics before diving into scripting. Although it's a nice way to round out your knowledge.
Install a linux distro on your own laptop without X. Force yourself to do <i>everything</i> from the shell. {mutt, lynx, etc.}<p>That's how I learned not only to use a shell but also how I learned to program.