Starting a Terminal 

When you log in to a Linux system in CLI mode or open a Terminal, it displays a string where it waits for user input (a command). This is known as a shell prompt.

To access a shell prompt in the GUI environment, you have to start a Terminal application, such as GNOME Terminal. There are multiple ways to launch a Terminal. The most frequently used ways to access a Terminal are as follows:

  • Select Applications | System Tools | Terminal
  • Right-click anywhere on your Terminal and select Open in Terminal from the context menu that pops up
  • From the activities overview, select Terminal

If you have started the Terminal application as a normal user, then the default prompt ends with a $ character, as shown in the following screenshot:

A normal shell prompt lists the following three details:

  • The login name of the current user
  • A short hostname of the machine, also known as the machine name
  • The name of the current working directory
The tilde (~) sign in the shell prompt represents the user's home directory. We will learn more about this in the following chapter.

If you have started or switched to the shell as a root user, also known as a superuser or administrator, then the prompt ends with a # character, as shown in the following screenshot:

The default shell of CentOS 7 is Bash, which provides a scripting facility for the automation of repeated tasks. The main functionality of any shell is to interpret the commands entered by the user at the prompt, and to provide a platform to launch any other program.

The default shell of Unix distributions is generally set as the Bourne shell. It is similar to the Microsoft Windows's Command Prompt application, cmd.exe. Windows 7 and Windows Server 2008 R2 onwards include Microsoft PowerShell, which is very similar in functionality to Bash.

There are two ways to access the shell. The first method is via the Terminal. When you install Linux without a GUI (as in a text-based installation), this can be the Linux machine's physical console, consisting of a keyboard for user input and a display to show output.

The second method is by using the shell from a virtual console. The Linux machine's physical console supports multiple virtual consoles, which act as separate Terminals with independent login sessions. If the GUI is installed, then the first virtual console is the GUI in CentOS/RHEL. In addition to the first graphical environment, five pure text-based environments are also available on a virtual console with which you can access a login shell. Ctrl + Alt + (F2 through F6) are text-based and Ctrl + Alt + F1 is the graphical desktop.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.223.119.17