Linux Mint – An Introduction to the Terminal

How to Configure Network Static IP Address on Ubuntu 19.10

So far in our adventure, we are yet to leave the comfort of Mint’s graphical desktop environment. Our time with Mint so far has been spent clicking on icons, launching GUI applications, and working from within windows. For most people, there is little need to leave this comfort zone. Mint is an incredibly rich experience, and it may seem that the developers have thought of everything and included a graphical application to configure just about anything you can think of. However, for those who aspire to be an administrator of Linux systems or just want to achieve advanced skills, learning shell commands is definitely recommended. For some tasks, executing commands can actually save time. In this chapter, we’ll learn the basics of the Linux shell and commands related to it.

In this chapter, we will discuss the following topics:

  • Why should we use the terminal?
  • Accessing the shell
  • Executing commands
  • Navigating the filesystem
  • Managing files
  • The nano text editor
  • Reading manual pages with the man command
  • Searching for files
  • Using the watch command
  • Introduction to scripting

Why should we use the terminal?

With Mint containing a complete suite of graphical tools, one may wonder why it is useful to learn and use the terminal at all. Depending on the type of user, learning how to execute commands in a terminal may or may not be beneficial. If you are a user who intends to use Linux only for basic purposes such as browsing the Internet, checking e-mails, playing games, editing documents, printing, watching videos, listening to music, and so on, terminal commands may not be a useful skill to learn as all of these activities (as well as others) are best handled by a graphical desktop environment.

However, the real value of the terminal in Linux comes with advanced administration. Some administrative activities are faster using shell commands than using the GUI. For example, if you wanted to edit the /etc/fstab file, it would take fewer steps to type sudo nano /etc/fstab than it would to open a file manager with root permissions, navigate to the /etc directory, find the fstab file, and click on it to open it. This is especially true if all you want to do is make a quick change. Similarly, typing sudo apt-get install geany may be faster if you already know the name of the package you want, compared to opening up Mint Software Manager, waiting for it to load, finding the geany package, and installing it. On older and slower systems, the overhead caused by graphical programs may delay execution time.

Another value in the Linux Shell is scripting. With a script, you can create a text file with a list of commands and instructions and execute all of the commands contained within a single execution. For example, you can create a list of packages that you would prefer to install on your system, type them out in a text file, and add your distribution package’s installation command at the beginning of the list. Now, you can install all of your favorite programs with a single command. If you save this script for later, you can execute it any time you reinstall Linux Mint so that you can immediately have access to all your favorite programs. If you are administering a server, you can create a script to check the overall health of the system at various times, check for security intrusions, or even configure servers to send you weekly reports on just about anything you’d like to keep yourself updated on. There are entire tutorials dedicated to scripting, so we won’t go in detail about it in this tutorial. However, by the end of the chapter, we will create a script to demonstrate how to do so.

Comments are closed.