In this video Grant discusses the advantages and disadvantages to the command line. He also gives a quick overview of terminals and shells.
- [Instructor] The default interface for Linux is the command line. As we've learned, the graphical interface is a suite of applications that run on Linux, and are not necessary for Linux to function. The command line is often the fastest, most efficient way of getting work done. The advantages of the command line are as follows. The command line is very fast. Many tasks are completed in the amount of time it takes to find the menu in a GUI. The command line is very efficient. A host requires less memory and CPU power if only running the command line as opposed to having a full GUI.
The command line is very powerful. In the case of CentOS, there are many jobs that can't be done easily from the GUI. The command line is more secure. By not installing a GUI, Linux has fewer applications and a much smaller attack vector for hackers. A simpler system is the more secure system. The command line isn't always the best interface, though. For example, it's not very visual. It may be harder to remember how to complete jobs because there is very little in the way of visuals.
The command line has a steep learning curve. With a GUI, you can just browse around the various menus and run programs to figure out how to use it. With a command line, this is near impossible. The command line is not very good for graphical tasks. Many tasks, such as browsing the web, watching videos, and editing photos, are just better on the GUI. The key to getting the most out of our Linux system is to use the best tool for the job. For many jobs, this is the GUI, but for many others, the command line is better.
There are several different ways of accessing the command line. If you installed CentOS on a physical machine, you can press Control + Alt + F2 to get to a console. If you're using Virtual Box, like I am, and would like to see what this interface looks like, you can press Host Key and F2. And we'll dismiss Virtual Box messages. This gives you a straight command line console. If you chose the minimal install of CentOS, instead of server with GUI like we did, this is the interface you'd see. Press F1 to return to the GUI.
If you're using Virtual Box, press Host Key + F1 to return to the GUI. And again we'll dismiss the Virtual Box messages. We've used the command line quite a few times so far in this course. We've gone to the applications menu, clicked on favorites, and clicked on terminal. This starts an application called a terminal emulator. The terminal emulator's job is to emulate an older terminal that people used to use to access mainframe computers. A terminal was a keyboard and monitor that connected to the mainframe via cables and allowed users to interact with the system.
With GNOME desktop, the default terminal emulator is called GNOME terminal. You can go to help about to see this. Being an application means that one terminal emulator may have features that others don't. These features may allow you to manage sessions or change what the terminal looks like. In this course, we'll investigate several terminal emulators. The terminal emulator only controls the window that we type into. When you type in commands, a command interpreter takes these commands and interprets them so the kernel can carry out the instructions.
This command interpreter is called a shell. The shell envelops the kernel. It provides a shell around the kernel. Whenever we want to send commands to the kernel, they need to be interpreted by the shell. If you're running commands that reside on the hard drive, as we have been, all shells work basically the same. They execute the commands. However, different shells may offer different features like command history, tab completion, command option completion, and more advanced shell scripting features for automation.
All of these features can help us be more efficient when we work. Popular shells are Bash, Dash, csh, ksh, and zsh. We'll talk more about each one of these shells in this course.
Note: The topics below map to elements of the Essential Commands section of the Linux Foundation Certified System Administrator exam. Learn more about LFCS certification at https://training.linuxfoundation.org/certification/lfcs.
- Installing GUI desktop environments: GNOME, KDE, MATE, and more
- Preparing your virtual machine for remote access
- Installing and configuring VNC, RDP, and X2Go
- Choosing a terminal and shell
- Accessing the Linux CLI