Accessing the command line using the console

Share on :

A command line is a text-based interface which is used to give instructions to the computer system. The command line in Linux is provided by the program known as “Shell”. The default shell in Red Hat is GNU Bourn-Again Shell (bash). Bash is an improved version of the shells used on UNIX-like systems, the Bourne Shell (sh).

Shell displays a string when it’s waiting for a command from the user, that time a shell is used interactively. When a superuser, root use the shell, the default prompt ends with the special character “#”.

Whereas in case of regular user it ends with the special character “$”.

There is another way through which user can access the shell in a form of virtual console. A physical console supports multiple virtual consoles which act like separate terminals. Each virtual console supports an independent login session. If user is using a graphical environment, access a text login prompt on a virtual console by holding Ctrl + Alt along with the function key (F2 to F6). Press Ctrl + Alt + F1 to return to the first virtual console and the graphical desktop. Virtual console can be accessed by only from the physical machine not remotely.

Shell Basic –
Command written in the shell have three parts –
1 – “Command” is the name of the program to run.
Example: # ls

2 – “Option” is used to adjust the behavior of the command. It normally start with one or two dashes to differentiate them from arguments.
Example: # ls -r (with one dash)
# ls --reverse (with two dash)

3 – “Argument” indicate target of command on which command should operate. If an argument consists of more than one words then they are separated by spaces.
Example: # wc -wl fileA fileB fileC

When any user finished its task and wants to end the session on the shell then use exit command or press ctrl + Dto terminate the current shell session.

Share on :

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *