Learn how to use Linux Red Hat

0
18717
Red-Hat-Linux-Administration

Red-Hat-Linux-Administration

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:
1

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).

The Shell
Once authenticated to the system, you get a command-line prompt like the following:
2

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:

Where:

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.

Typing Commands
As a rule, Linux commands use the following general syntax:

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.

CommandFunction / Description
lsList the contents of a directory.
3
pwdPrint Working Directory.
4
cdChange Directory
5
catConcatenate and Print the contents of file(s)
6
tacConcatenate and Print the contents of file(s) in reverse.
7
revReverse the lines of file(s)
8
manDisplay the Manual Page for a command
9
cpCopy file(s) or directory(ies)
10
mvMove or Rename file or directory
11
rmRemove file(s) or directory(ies)
12
mkdirMake directory
13
rmdirRemove “an empty” directory
14
datePrint or Set the system date and time.
15
touchChange file(s) timestamps. If the file(s) don’t exist, it will be created.
16
morePrint file contents one screen at a time.
17
lessSimilar to more , but allows both forward and backward movement in the file.
18
seqPrint a sequence of numbers between Start and End.
19
echoPrint line(s) of text to the standard output (screen).
20
calDisplay the Calendar (of month or entire year)
21
22
clearClear the terminal screen.

Summary

  • 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
https://blog.eduonix.com/shell-scripting/introduction-to-linux-shell-scripting/

LEAVE A REPLY

Please enter your comment!
Please enter your name here