After installing Red Hat, we need to know how to use it. This is going to be the subject of this article. Have a nice reading!!
Login to Your Linux Box
When you boot your Linux machine, the boot process will end up with a screen like the following:
This is the login screen. To use the system, you need first to authenticate to the system, by providing your credentials. Credentials are valid user and password. In our case, type root as a user (and press Enter), and redhat as its password (and press Enter again).
Once authenticated to the system, you get a command-line prompt like the following:
This is called the Shell. In the first article of this series “Red Hat Linux Administration – (1) Introduction“, I told you that the Linux shell is an interactive command-line interface where a user can type a command, and get its result(s). I told you also that the Linux shell lies of top of the kernel (which is the core of the Linux operating system).
Over years, several shells have been developed. The most used, well-known types are Bourne Shell sh, Korn Shell ksh, C-Shell csh, and the Bourne-Again Shell bash. Each shell has its own features, and uses. The default shell in Red Hat Linux is the Bash Shell.
So, a user is first asked to present what proves he is a legal authentic user of the system. When his credentials are verified, a startup program is loaded for that user. The default startup program for Linux users is the (bash) shell.
Using the Shell
As a Linux admin, the shell is your main playground. From the shell you do the following:
- Display system info and parameters.
- Display contents of configuration files.
- Edit/modify configuration files.
- Create your own data files.
- Write and execute shell scripts.
- Start, stop, reload, and restart services.
Almost all your work is done from the shell. That is an important reason for you to learn and master using shell. Of course, that will not happen in a day!! But, let me tell you something: stay with us, and you will be not only a shell master, but a master of Linux as well. Promise!!
The Shell Prompt Structure
Here is the default prompt you see in your Red Hat Linux bash shell:
root is the current logged in user for this login session.
localhost is the host (computer) name.
~ is called Tilde. It is a short for the path of home directory of the current user.
# is the prompt to write your commands after.
The whole structure of bash shell prompt is changeable using an environment variable PS1. Later, when we come to customizing the bash shell, and to using Environment Variables, we will see how to play with this variable to change the shell prompt as you prefer.
As a rule, Linux commands use the following general syntax:
COMMAND [OPTIONs] [ARGUMENTS]
Where COMMAND is the command name.
OPTIONs are zero or more options. Command options are preceded by – or –.
ARGUMENTs are zero or more data items needed for the command to execute. Most of the time, arguments are file names or directory paths.
The following table lists the basic Linux commands, with brief description for the function of each, and a simple usage example.
|Command||Function / Description|
|ls||List the contents of a directory.
|pwd||Print Working Directory.
|cat||Concatenate and Print the contents of file(s)
|tac||Concatenate and Print the contents of file(s) in reverse.
|rev||Reverse the lines of file(s)
|man||Display the Manual Page for a command
|cp||Copy file(s) or directory(ies)
|mv||Move or Rename file or directory
|rm||Remove file(s) or directory(ies)
|rmdir||Remove “an empty” directory
|date||Print or Set the system date and time.
|touch||Change file(s) timestamps. If the file(s) don’t exist, it will be created.
|more||Print file contents one screen at a time.
|less||Similar to more , but allows both forward and backward movement in the file.
|seq||Print a sequence of numbers between Start and End.
|echo||Print line(s) of text to the standard output (screen).
|cal||Display the Calendar (of month or entire year)
|clear||Clear the terminal screen.|
- To use a Linux system, you need first to login to it using a valid user and password.
- The default startup program for most of users is a command-line shell.
- The default shell for Linux is the bash shell.
- The shell works like a command-line interpreter, where commands are typed, executed, and have their results displayed to the user.
References and Recommended Readings