Accessing the Command Line in Red Hat Linux
Topic :- Accessing the Command Line in Red Hat Linux
Aim
- use Bash shell syntax to enter command at a Linux console.
- Launch applications in a GNOME desktop environment.
- use Bash features to run commands from a shell prompt using fewer keystrokes.
- Accessing the Command Line Using the Local Console
- Accessing the Command Line using Desktop
- Executing Commands using the Bash Shell
1. Accessing The Command Line Using the Local Console
Aim
in this section we are Learn to access the Command Line using the Local Console and run simple commands using the shell.
1.1 The bash shell
A Command line is a text-based interface which can used to input instruction to a computer system. The Linux Command line is provide by a program called the shell. and on this program user are write command and give instruction to the computer or system. the default shell for users in Red Hat Enterprise Linux is the GNU Bourne-again Shell(bash). Bash is an improved version of one of the most successful shells used on UNIX-like Systems, the Bourne shell (sh).
when s shell is used interactively, it displays a string when it is waiting for a command from the user. this is called the shell prompt.
when a root user or highest priority user are logged shell, the default prompt ends with a # character. and the # character in indicate the user are logged is a highest authority and it will give the access of all command and read write operation on file by default. and it is provide all access to edit or make changes in the system. example :-
root@batman:~#
Using bash to execute command can be powerful. the bash shell provide a scripting language that can support automation of task. the shell additional capabilities that can simplify or make possible operation that are hard to accomplish efficiently with graphical tools.
when a regular or non-root user are are start the shell, the default prompt ends with a $ character. and the $ character is indicate the user are logged is not highest authority it is an non-root user. example :-
Codeworld19@batman:~$
Shell basics
Command entered at the shell prompt have three basic parts:
- Command to run
- Options to adjust the behavior of the command
- Arguments, which are typically targets of the commands
The command is the name of the program to run. it will be given an multiple options to run the program in different behavior and the command also be followed by one or more arguments, which are typically targets of the command or program. show the following example
root@batman:~# mkdir -p Demo{1..4}
in this example the mkdir is program or command are used to create directory in Linux operation system. and the -p is used to adjust the behavior of the command line the meaning of this option in mkdir command is -p, --parents no error if existing, make parent directories as needed. and the Demo{1..4} is the target of command, its create the directory Demo1 to Demo4.
upcoming session we will discuss in deep.
1.2 Virtual Consoles
users access the bash shell through a terminal. A terminal provides a keyboard for user input and a display for output. On text-based installations, this can be the Linux Machine's physical console, the hardware keyboard and display. Terminal access can also be configured through serial ports.Another way to Access a Shell is form a virtual Console. A Linux Machine's physical console supports multiple virtual consoles which act like separate terminals. each virtual console supports an independent login session.
if the graphical environment is available, it will run in the first virtual console in Red Hat Enterprise Linux 7. five additional text login prompts are available on consoles two through six(or one through five if the graphical environment is turned off). with a graphical environment running, access a text login prompt on a virtual console by holding ctrl+Alt and pressing a function key (F2 through F6). press Ctrl+Alt+F1 to return to the first virtual console and the graphical desktop.
2. Accessing The Command Line Using the Desktop
Aim
the Linux System using the GNOME3 Desktop environment to run command from a shell prompt in a terminal program.The GNOME Desktop environment
GNOME stands for GNU Network Object Model Environment. the Desktop environment is the graphical user interface on a Linux System. the default desktop environment in Red Hat Enterprise Linux 7 is provided by GNOME3. it provide an integrated desktop for users and a unified development platform on the top of a graphical framework provide by the x window System.
the GNOME Shell provides the core user interface functions for the GNOME desktop environment. the gnome-shell application is highly customizable. by default, RHEL 7 users use the GNOME Classic theme for gnome-shell, which is similar to the GNOME 2 desktop environment. Another available option is the modern GNOME 3 theme used by the upstream GNOME project. Either theme can be selected presistently at login by selecting the gear icon next to the sign in button when entering the users password.
Activities Overview
Workspace
workspace's are separated desktop screen which have different application windows.
Starting a terminal
to get the terminal in the Red Hat Linux or other Linux version which are used GNOME Environment follow the following same steps
- select Application > Utilities > terminal
- On the empty desktop, right-click or press Menu key, and select Open in Terminal from the context menu that appears.
- from the Activities Overview, select the Terminal from the dash. the search field at the top of the windows overview
Power OFF or Rebooting the System
To the Power off or Rebooting the System the following are simple command are used. first open the terminal and type the following commands
- TO Power OFF -> init 0
- TO Reboot -> init 6
3. Executing Commands Using the Bash Shell
Aim
user friendly with the terminal and execute the different command and shortcut to save timeBasic Command Syntax
The GNU Bourne-Again Shell (Bash) is a program that interpreting command typed in by the user. each string typed into the shell can have up to three parts: the command, options , and arguments this topics we have discuss in the basic shell.
the enter key is pressed when a user is ready to execute a command. Each command is typed on a separate line and the output from each command display before the shell displays a prompt.
Example of Simple Command
the date command is used to display the current date and time. it can also be used by the super user to set the system clock.
root@batman:~# date Thu Mar 19 22:20:57 IST 2020 root@batman:~#
Tab Completion
tab completion allows a user to quickly complete the command. if you can enter a half of the character of command and press the tab key the command are get a automatically complete
for example
if you write the #cd Desk and press the tab button the command will be automatically complete as #cd Desktop
Reference :-
RHCSA Book's
Disclaimer :-
the above information is presented to you by codeworld19's authority on the basis of the above reference list. if you have any queries or other issues regarding this page or website, please contact to the codeworld19 authority from following contact form.