Getting Started with 🍦.11ty.js, Part II: Using Your Terminal
This is the second post in a five-part series on “Getting Started with 🍦.11ty.js”
Accessing Your Terminal
Every operating system (Windows, macOS, Linux, etc.) comes with a text-based command line interface (CLI, console, or terminal) to enter commands you want your computer to run. The CLI is a powerful tool for interacting with your personal workstation beyond the graphical user interface (GUI) with which you may be more familiar. Of course, if you’ve ever used a computer without a mouse or touchpad, then you might feel right at home in the command line.
Intead of “pointing and clicking” with a mouse or touchpad 🖱️, you can “talk” to your computer from your keyboard ⌨️.
No doubt, pointing and other gestures come in handy sometimes, but they sound rather impolite in many cultural contexts when you think about it. Granted, keyboard commands are still rather bossy (that’s just the nature of the human–computer relationship at the moment). In any case, keyboard commands are a really expressive and efficient way to accomplish a lot of tasks that are often outside the reach of the GUI.
Here’s a list of the command line tools that come preinstalled with some of the most popular operating systems:
- On 🐧 Ubuntu Linux (my prefered operating system), the default console is called Terminal.
- On 🍏 macOS, the default console is called Terminal.app.
- On 🏢 Windows, the default console has been Command Prompt for ages, but since Windows 10, you can now use a Linux-based tool called Windows Terminal.
If you’re on Windows, then I’ll assume you’re able to access the newer Linux-based Windows Terminal for entering commands.
Entering Commands
Now that you have an idea of how useful your terminal is and how to access it, you can start learning your way around the command line interface.
Some of the most important skills to learn involve listing the contents of a folder or “directory” and moving from one directory to another. Many commands depend on the directory in which you happen to be working at the time.
You can use the ls
command to list the files in the current “working directory.”
Likewise, you can use the cd
command the change from one directory to another:
Typing only cd
will change to the top-level directory in your directory tree (often referred to as your home 🏡 directory).
To go down ⬇️ 📂 from the current directory to one inside it, you can type cd
followed by the name of the directory you want to open. For example, cd Downloads
.
To go up ⬆️ 📂 from the current directory to another one outside it, you can type cd ../
. This command will go up one level from the current directory, for example, from Downloads
back up to the directory from which you just came.
You can repeat the sequence ../
as many times as you need. Say you wanted to go up two levels: you could type cd ../../
.
Once you’re comfortable listing a directory’s contents and moving from one directory to another, you have all the basic command line skills you’ll need to start setting up your local development environment.