TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: Best way to learn *nix and shell?

6 pointsby moonfleetalmost 5 years ago
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&#x27;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?

4 comments

asicspalmost 5 years ago
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:&#x2F;&#x2F;ryanstutorials.net&#x2F;linuxtutorial&#x2F;" rel="nofollow">https:&#x2F;&#x2F;ryanstutorials.net&#x2F;linuxtutorial&#x2F;</a> is a good place to start for beginners<p>* <a href="https:&#x2F;&#x2F;mywiki.wooledge.org&#x2F;BashGuide" rel="nofollow">https:&#x2F;&#x2F;mywiki.wooledge.org&#x2F;BashGuide</a> and the rest of this wonderful wonderful site is recommended to understand `bash` and its features and gotchas<p>* <a href="https:&#x2F;&#x2F;explainshell.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;explainshell.com&#x2F;</a> gives you a quick help on the various parts of the command, including documentation<p>* <a href="https:&#x2F;&#x2F;www.shellcheck.net&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.shellcheck.net&#x2F;</a> is a must have tool if you are writing shell scripts<p>* <a href="https:&#x2F;&#x2F;linuxjourney.com&#x2F;" rel="nofollow">https:&#x2F;&#x2F;linuxjourney.com&#x2F;</a> is probably the most complete site to understand how things work in *nix environment<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;learnbyexample&#x2F;scripting_course&#x2F;blob&#x2F;master&#x2F;Linux_curated_resources.md" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;learnbyexample&#x2F;scripting_course&#x2F;blob&#x2F;mast...</a>
评论 #23412615 未加载
akerstenalmost 5 years ago
I don&#x27;t have any resources beyond recommending searching something like &quot;linux command line basics&quot; in your favorite search engine, but I do have some advice. You have to conceptualize it at a higher level than &quot;shell commands:&quot; 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&#x27;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 &#x27;commands,&#x27; but what&#x27;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&#x27;re setting yourself up for a bad time, since you&#x27;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&#x27;t translate nicely to linux-y distros if that&#x27;s the direction you want to go.<p>Larger objectives you mention like starting a server, the first principle is still &quot;what program can I run (i.e. call from the shell) to do what I want?&quot; 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. &quot;bash tutorial&quot;), but it sounds like you&#x27;re mostly interested in getting your feet wet with the basics before diving into scripting. Although it&#x27;s a nice way to round out your knowledge.
评论 #23412659 未加载
eybergalmost 5 years ago
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&#x27;s how I learned not only to use a shell but also how I learned to program.
评论 #23412669 未加载
评论 #23399688 未加载
poletopolealmost 5 years ago
N&amp;R&#x27;s &quot;Learn The Bash Shell&quot; is as good as it gets. I scanned it with my SV600 if you want a PDF copy.
评论 #23412686 未加载