The terminal in your computer is the most interesting way to interact with your computer. Way before there were mouses, keyboards and proprietary operating systems with immensely user-friendly features, there was only a small window, a blinking cursor and an extensive series of commands. Each of these commands served a purpose and looked to take care of a specific task. With technology moving at the rate it is most average computer users don’t see a need for using the terminal window. Why type when you can click?
Devoted terminal users cite a certain amount of freedom with the terminal; a break from the modality of the point-and-click aspect of computing. In other words, “what I say, is what is done” sort of mentality. There’s certainly pros and cons of each, but that is for you to decide what those are.
This post looks to approach understanding the terminal if you were someone with little to no understanding of what terminal commands are or even what a terminal is. For this section, I’ll be using my Macbook (my Ubuntu loaded book is currently away from me at the moment…), but rest assured, terminal is terminal across any operating system – Linux, OSX or otherwise.
Terminal Terminology 101
Before jumping into the terminal and punching in commands, there were some terms that I regret not investigating the meaning of sooner. To save you the hassle of scouring the Internet for all these terms, here are the most basic ones it helps to know which will help you on your mission to understanding terminal computing:
1. Shell (sh): A shell is a command-line interpreter. This is where you’ll be punching in commands which will get your computer to perform actions. There are different kinds of shells for computing as we’ll see below.
2. Bash (Bourne Again Shell): This is the most common kind of shell where commands are put in. There are other kinds of shells including: the Korn Shell (ksh), the C shell (csh) and the TC-shell or T-shell (tcsh).
3. Terminal: The terminal is actually the program that runs a shell. Most shells in computers are the Bash shell. It can’t actually be pictured per se as all of the shells above are the visual representations of the terminal program in action. Those ARE the Terminals.
- Shell is the general name for any command-line operator.
- Bash is a kind of shell – the most common kind of shell – and 99% of the time will be the one you use when you’re making commands.
- Terminal is the program that runs the shell and in most cases it will be the Bash Shell.
Playing with the Terminal
Before there were keyboards and mouses to get around a computer, there was only the terminal and a slew of commands that could be applied to get things done. Now, the keyboard and mouse are staples to any computing experience and the terminal has gone by the wayside for 90% of the computer users. Which is a shame. Though it takes some getting used to, the terminal, whether in a Linux or UNIX based distribution (or distro) like Ubuntu or Fedora or on a Mac, can provide the ultimate experience in user flexibility.
Upon opening the terminal you should see a shell prompt that has: username@hostname:~$
- Username is you or rather the name your computer is registered under.
- Hostname is your computer (ubuntu will likely have @ubuntu; my macbook for this exercise has macbook-pro).
- The “~” symbol is shorthand for “your home folder”. In other words, the folder (or Directory) you are currently in. More on that below.
- “$” means that you are the superuser. As superuser, you are just a person, so to speak, making commands in the terminal. The flipside to superuser is Root (which would show up as username@hostname:~# instead). More on that in the future.
*NOTE: I censored my last name in each of these examples – that’s what the white line is about 🙂
These are some of the most common commands for all terminal users that we’ll go over right now. There will certainly be other installments of this series in the near future, covering more advanced commands and concepts. In the mean time, here are 3 basic commands for terminal computing:
1. ls. The ls command creates a list of the current files and directories. The equal to clicking on the User name and seeing a list of folders show up:
2. cd. The cd command changes directories. In the terminal, each section of your computer (Desktop, Documents, Pictures, etc.) are seen as directories. Rather than navigating with your mouse from Desktop to Documents to Pictures, you can type the command cd followed by the directory. Now we’re on my Desktop. Now that we’re on Desktop, we can use the ls command again to see the contents of the Desktop directory
3. clear. Clear command simply clears all the text present in the terminal.
This was a small, small glimpse into the terminal. Albeit from this entry, you have a better understanding of the most basic terminologies and three simple commands. Terminal computing can seem like a daunting thing when you look at it for the first time. But like most things, you’re going to be frustrated at first – but that’s the learning process. You will learn to love what you’re learning with time. Remember: proper practice makes perfect and a thirst for knowledge can only help.
This will certainly be a topic that will come back in the future.
Looking to get in touch with your computer expert? Check out this cool link as well for more commands and in-depth explanation of terminal computing.