The Terminal – For Noobs (Like Me)

Yesterday I suddenly spent 7 hours writing a guide: The Terminal – For Noobs (Like Me)

As the title suggests, I’m absolutely no expert when it comes to the terminal – but I’ve started to like it. And if you find the terminal a bit daunting, it might be useful to have a guide written by someone for whom it isn’t second nature.

I’ve done my best to provide accurate explanations, while still keeping them simple. But please let me know if I’ve missed the mark!

This is not meant for those who’ll live in the terminal! My intension is to make it seem more tempting to add to your arsenal of Mac tools. And to reduce the dread when you have to dive into the world of command lines.

As it become longer than first expected, I decided to split it up in 3 parts:

Feedback is greatly appreciated! Both from noobs (like me), and from pros.

If you’re a noob, did it help you at all? Does it need more images and examples?

Am I giving some bad advice or inaccurate statements?

How do you use the terminal? And what are your feelings toward it?

10 Likes

Superb. Thanks for that.

There is much unfounded fear of the Terminal. Even if one believes the fear the same risk, say deleting all files, is possible with the dialog boxes if one instructs the computer to do it.

I doubt that fear will ever go away, but I do hope your work dispels fear for this willing to “take a risk” and learn.

4 Likes

Thanks! 🫶🏻

Yeah, I at least wanted to take the time to explain the things I feel like most people don’t bother doing, heh. My best example is that I always wondered “What’s the deal with the $ symbol at the start of commands I find??” :stuck_out_tongue:

1 Like

My only critique … don’t say your are a “noob” (even though maybe on target)!

A couple of tips!

  1. There is the concept of $EDITOR vs VISUAL_EDITOR for open file in terminal file editor vs in a gui (not all commands respect this though)
  2. It may be worth noting for your image of the zshrc file in finder, that hidden files must be enabled to see it.

At a broader level, one of the biggest benefits of the terminal (besides stuff that as a gui would be paid) is that the ethos of the commands are still largely influenced by the original ideas in the UNIX philosophy. This means that commands (if a good citizen) do one thing and easily combined.

https://missing.csail.mit.edu/ is a great resource explaining this.

https://www.nushell.sh/ is an example of a shell which takes this philosophy further than other shells (but I think isn’t worth it since your copy pasting from the internet won’t work anymore :grin:)

Also! One of the tools I install on a new Mac is macos-trash which provides a trash command which moves stuff to the Trash folder like in Finder. This allows you to have to not have to use the scary rm command

If you ask someone who makes their living in NeoVim, I’m absolutely a noob! :grin:
And I don’t want to claim to be an expert. Just a (maybe fellow) novice trying to explain my current best understanding. As a maths teacher, I think I’m good at explaining, and understanding which parts of something can be difficult. So I want to use that to tackle different subjects – even though I’m not an expert in them.

Thanks! I’ll add these later. 🫶🏻

This is a nice guide to the terminal. But one piece of advice that I’d give is that you suggest a lot of customization right away, for example making cat an alias for bat. Installing lots of fancy tools like yazi, etc. Instead, I would recommend that people first master the basic terminal commands as is. This way you can login to any Unix-like system and know what to do. Once you master those commands, then add things like yazi or substitute bat for cat, etc.

2 Likes

Fair! Especially yazi is more advanced…

But I tried to focus on tools that make things easier without being more advanced. Like, let’s say you gave a novice a terminal where cd was zoxide, ls was eza and bat was cat. I would say that it would be 0% harder to use, while being more user-friendly.

And I pointed towards replacing with alias, so the habits of the regular commands would get made. So that if they then used a regular terminal, it would be like they’re used to (just a bit worse :stuck_out_tongue:).

I do get your point – but I think many would never bother to get to learn the basic commands if they were forced to do it a less user-friendly environment. (That being said, I think I want to add some of your thoughts at the beginning of that section!)

2 Likes

Will read it!

Popping in to say thank you for your home row mods code for Karabiner Elements. While I’m still missing some of the fancier options I get from ZMK, there’s a lot to like there!

1 Like

Personally I consider “man’” among the most useful of all terminal commands.

4 Likes

Would you consider combining the 3 sections into a downloadable PDF?

Thanks for putting this together!

The biggest problem I have as a noob with terminal is the path. Conceptually it makes sense, there’s a file that defines the path and you have to put the different sub folders you might have installed the unix apps in.

But in practice, I dont know how to edit the file properly, I dont know where the apps are getting installed when I install them into which folders, and 90% of the time I use terminal I have to deal with a dozen “command not found” errors.

“Path” is actually a “environment variable,” a setting that is available to your shell. You can see its value by entering this command in Terminal:

echo $PATH

You will see that the path is a colon-separated list of directories (or “folders”). The shell searches each directory until it finds the command you’ve entered and then executes it. If the command doesn’t exist in any of the listed directories you get “Command not found.”

The PATH variable is initialized by the system, and it’s done differently on MacOS than other Unix-like systems. You can change the path in your shell’s rc file (.bashrc or .zshrc, for example).

2 Likes

Really well done - kudos