The Terminal: Daunting at the beginning but useful, immediately after
The terminal is a text-based way for users to interact with the operating system. This black window with white letters can look scary for those that never used it before but everyone can easily master it within a couple of hours. There are hundreds of tutorial on how to use the CLI. So, here we will focus on why one should learn to use it.
Before the graphical user interface (GUI) was a thing, the terminal was the only way to interact with a computer. Nowadays, it still remains one of the most useful tools in any computer savvy person's arsenal.
Using the command line has a steep (but short) learning curve and anyone can get started within a couple of minutes. The terminal has 5 main advantages (economy, speed, diversity, flexibility and automation). First of all, the terminal requires less resources than GUI applications, leaving more hardware available for resource intensive processes. Secondly, typing in commands is much faster than having to locate and click buttons on the screen every time you want to perform a task. Of course, if you have to look up every command you type using the terminal can be excruciatingly slow (and it often is absolute beginners) but you're in luck because most of the basic commands are pretty intuitive and easy to memorize. For example,
pwd #(P)rint (W)orking (D)irectory
ls #(L)i(S)t the files in a directory
cd #(C)hange (D)irectory
mv #(M)o(V)e a file
cp #(C)o(P)y a file
rm #(R)e(M)ove a file
mkdir #(M)a(K)e a new (DIR)ectory
These 7 commands, which take less than a minute to memorize, cover most of the basic file handling actions out there. Of course, the diversity of things one can do in the terminal is immense. There is a plethora of commands, as well as an endless number of programs one can run. Furthermore you can combine multiple programs by feeding the output of one program into another using the pipe symbol |.
The greatest advantage of the terminal, however, is automation. You can bundle up a set of commands into a script that executes these commands every time you run it. Let’s say, you need to run a series of 10 commands regularly. By putting these commands into a script you will have a more robust and consistent result, than running each command manually, as the exact same commands are run by the script. Eliminating the possibility of subtle mistakes that could happen if you execute the commands manually. Lastly, executing a single script, instead of 10 commands, will save you time and simplify your workflow.
With all these advantages, I can’t understand why anyone would avoid learning how to use the terminal. If you decide to start learning, here are some great resources.
- Real Python tutorial - The Terminal: first steps and useful commands
- Ubuntu.com - The Linux command line for beginners
- Percy Grunwald youtube video