Tech Literacy: Terminal, Command Line & Shells

Born out of ‘The Decline of Tech Literacy and What We Can Do About It’ thread, I thought it’d be worthwhile to start breaking down that problem into smaller pieces; beginning with…

A while back I enjoyed reading this: ‘Why I chose Fish over Bash for students’. It’s a piece from a Computer Science educator on why they advocate for the fish (Unix shell) [#1 & #2] over the typical default Bash (Unix shell), and even over letting students choose their own.

One of my favorite aspects about this community is the eye it has for beginners. As a teacher it’s definitely my dominant eye, so I’m always trying / researching strategies to make stuff more digestible for younger folk / newbies. It’s a trickier balance than it sounds. I’d love to hear thoughts on improving ways this topic is introduced and/or taught.

Tagging @brisray @purelyconstructive @starbreaker @yequari as you all brought this up in one way or another on the decline thread.

4 Likes

Aspects about this concept that can make it challenging to teach:

  • It’s weird how left out this topic can be, even at famous universities, for example:

  • Limited time to teach a curriculum / relevance / convenience. I think it’s common for a programming or a web design course / teacher, to focus on the core purpose of a class. It can be challenging to incorporate “irrelevant” concepts or tangents. To the perhaps unfortunate detriment of “tech literacy” as a whole.

  • I agree with @eladnarra on the ‘fear / anxiety of messing up’. There is no “undo” for the command line, after all.

In relation to (personal) web development (the primary purpose of this community), I don’t believe you outright NEED to familiarize yourself with it to develop a basic Neocities-like website workflow. But console applications (like static site generators, for example) can simplify a lot of what manually managing a website would entail.

1 Like

I read the article about Fish. I think I’ve even used Fish as an interactive shell out of curiosity. I currently use bash on Slackware. When I’m on macos I use zsh. When I’m on OpenBSD I use their version of ksh. In all cases I try to stick to the default shell for interactive use. Fish wasn’t around when I was first exposed to UNIX in college back in the late 1990s, and I think my first shell was actually the C shell (csh) because my first UNIX was SunOS, a BSD derivative.

I wasn’t as intimidated as a lot of beginning CS students today might be because I grew up dealing with PC clones running MS-DOS and occaionally Apple IIs and Commodore 64s, the latter usually having nothing but its built-in BASIC interpreter. I had started by tinkering with DOS batch files; other students would mess with AUTOEXEC.BAT so that they could play shareware versions of Wolfenstein 3D or DOOM on school computers, and not clean up after themselves. Not wanting to be blamed for somebody else’s misdeeds, I had found the school library’s copy of DOS for Dummies and learned to fix the configurations myself.

I don’t think it necessarily matters which shell a beginner learns for interactive use. If Fish is friendlier to newbies and smooths out some of bash’s rough edges then a newbie should by all means use it. I would even say that for personal scripting, it’s fine to use fish instead of bash, or any shell you please. I have, however, tried to stick to POSIX sh for my own scripting because I’m used to thinking in terms of writing portable code by which I mean code that isn’t tied to any particular OS or shell.

I don’t think the fundamental barrier to people learning to use a command line interface is necessarily technical but psychological. I think people need the following before they can really dig into computing:

  1. They need a reason to do it.
  2. They need to believe that they can learn to do it.
  3. They need to feel safe to experiment, to feel confident that their mistakes won’t break anything.

I could be wrong, however. I’m not a teacher.

When I was in college, the instructors assumed that everybody in the class had had their own computer and had been hacking since they were children. It didn’t occur to them that some of their students might have just gotten their own computers, buying secondhand machines at their own expense.

I’d say that this is what backups are for, but that assumes that somebody knows how to create backups and restore them; that’s a bit much to ask of a beginner.

Oh, hell no. Neocities lets you build your site on their site, no CLI or local tools needed. Which is perfect for newbies building their first websites or people who just want to slap together a few pages or mess with HTML, CSS, and basic JavaScript. I would say, however, that a knowledge of Unix tools and a good text editor can make web development a bit easier. For example, I had just used m4 to create macros for creating a <picture> element inside a <figure> with a caption, alt text, and height and width properties that would display AVIF, WebP, or JPG/PNG given a filename and other parameters. I did it was because I was tired of writing the HTML myself.

3 Likes

i definitely would have loved to have some more guidance around the topic of terminals and shells in my first year of university (currently studying computer science), it was very rarely touched upon and the expectation was just to figure it out on our own time. and while i get that comp sci is largely about problem solving and so self-learning is a big aspect of that, i think i would consider knowing to navigate a command line, etc., to be pretty fundamental–it’s how you interact with your tools at a pretty basic level.

i’ve tried Fish for a bit and it is indeed very friendly. i could see it being useful to a beginner in the same way Python was used to teach us basic programming, both being very capable tools but just high level enough to not overwhelm somebody just starting out!

definitely agree, especially with that third point! which is why i think the expectation to learn on our own, and on our own machines, can scare some people. you legitimately can do some serious damage if you’re reckless and/or don’t know what you’re doing (e.g. accidentally deleting important system files, etc.). so something like giving students some time to experiment around in a safe environment, like in computer lab machines with some restrictions so they don’t break anything, etc., could give them some confidence and also a starting point in their learning.

very much still my experience even today! extra surprising to me when i learned that some fellow students didn’t have any computer science classes or similar coming from high school, unlike mine, so i can imagine they felt extra left in the dark.

1 Like

I’m tempted to suggest that shell scripting is the new BASIC.

2 Likes

this is only semi-related, but it reminds me that I really want to create a blog post the goes over all the things I personally do when spinning up a VPS.

Services like neocities, heroku, etc all abstract away the server layer, but I still think spinning your own VPS up is fun and seems to be a dying skill. I feel like there’s gotta be an audience for people who are interesting in learning how to secure a server, get nginx running, and host something.

2 Likes

True. By removing the possibility for error, we also remove the stress.

I think it is good to have hardware specifically for tinkering, independent of one’s “daily driver”…something cheap, like an old, refurbished laptop or a single-board computer will suffice. If something stops working, we won’t be completely out of commission as we learn how to fix it. Getting to know the main parts of a computer and what they generally do is also a part of tech literacy.

Alternatively, one could have personal files backed up onto an external drive that is easy to dismount so that nothing can get accidentally deleted. Practicing good file management and making backups is important to know as well. I once had a huge HD die on me and wipe out a ton of personal files that were irreplaceable. It was sad, but I lived. :laughing: …The important thing is that it also motivated me to learn how to prevent that situation to some extent.

Destroying a system file isn’t a big deal. The worst-case scenario is that we have to reinstall our OS. That is something everyone should probably know how to do too.

2 Likes

Tinkering with Linux at home stopped being scary once I realized that I could use a separate partition for /home (where your personal directory resides). As long as I didn’t nuke that partition or at least had a resonably current backup, it didn’t matter if I fouled up my system partition or wanted to try a different distribution.

I’ve come to suspect that maybe computer literacy based on UNIX and the shell is best taught by an experienced mentor to no more than five apprentices, who might then have apprentices of their own as they grow more knowledgeable and experienced. Perhaps I’m thinking of learning UNIX as something akin to learning a martial art, where earning a black belt means you’ve reached the end of the beginning of your journey toward mastery,

2 Likes

I really appreciate that about the community too!

When it comes to using the terminal / CLI, other than the example teaching outline that I shared with solaria in the other thread, I can really only think of three things that are important to highlight:

1. Remove the mystique by showing how it is immediately practical. I cannot emphasize enough that typing in commands is just another way of navigating a computer, like clicking with a mouse. Getting an idea of when one approach might be preferred over the other gives us an idea of why it is good to know both.
2. Start simple. There are very few commands that I think are imperative to know. One should at least be able to open up help documentation, navigate the file tree, change file permissions, and install software with the appropriate package manager. I cover all of those here. If there is interest beyond those foundations, then learning how to network (e.g.: using tcpdump, ssh, etc.) and write simple shell scripts for the automation of various tasks can be helpful.
3. Have fun! No matter a person’s level of understanding, computing should not be stressful. By being welcoming, patient, kind we invite others to learn with us.

2 Likes

This is a great feature that I use as well, but you do have to be careful with different distributions, which might have different conventions for where configuration files are stored in your home directory, causing issues that are difficult to track down. Though if you are trying different distros from the same “lineage” (like Debian → Ubuntu → Linux Mint or RHEL → CentOS → Fedora) then it is less of an issue.

I think one of the confusing things for beginners is what a command even is conceptually. This is something I struggled with too until I had a crash course on the terminal in university, I had no idea what decided which commands were available to me or how to figure out what arguments and options are. Because of that I think a really important aspect to focus on is that commands are (mostly) just programs and everything you type after the command gets sent to the program for interpretation. This kind of ties in with the point above that it really is just another way of navigating a computer. A basic explainer of stdin, stdout, and stderr is essential too in order for pipes and redirection to make sense later on.

1 Like

Good point. Keeping files in a separate partition also mitigates the problem. I had suggested an external drive mostly to make it easy. A person gets the added visual feedback of the drive being physically disconnected and thus safe from accidental deletion…Honestly, that would probably bring me comfort as well. :laughing:

I also like the martial arts analogy. Mentoring small groups is probably ideal for most learning situations because it allows for immediate feedback and a more tailored approach. Although, I wonder if a lack of experienced teachers makes that method of learning less common? It’s like doctors. Depending on where one lives, there might be only one doctor for every several hundred people. This is actually one area where I think AI could be potentially useful, by having open-source “expert systems” that can help teach people the nuances of more specialized subjects when teachers are unavailable. Likewise, I think educational VR simulations could be helpful when hands-on training is otherwise impossible.

1 Like