Introduction To Command Line in Ubuntu Linux.: Lab No. 3 29/3/2023
Introduction To Command Line in Ubuntu Linux.: Lab No. 3 29/3/2023
Introduction To Command Line in Ubuntu Linux.: Lab No. 3 29/3/2023
3 29/3/2023
Theory:
The Command Line Interface (CLI) is a non-graphical, text-based interface to the computer
system, where the user types in a command and the computer then successfully executes it. The
Terminal is the platform or the IDE that provides the command line interface (CLI) environment
to the user. The CLI terminal accepts the commands that the user types and passes to a shell. The
shell then receives and interprets what the user has typed into the instructions that can be
executed by the OS (Operating System). If the output is produced by the specific command, then
this text is displayed in the terminal. If any of the problems with the commands are found, then
some error message is displayed.
We can open the terminal by typing Ctrl + Alt + T short-key or by right-clicking the mouse and
selecting the Open New Terminal option. The terminal window looks like given below.
SHELL is a program which provides the interface between the user and an operating system.
When the user logs in OS starts a shell for user. Kernel controls all essential computer
operations, and provides the restriction to hardware access, coordinates all executing utilities,
and manages Resources between process. Using kernel only user can access utilities provided by
operating system.
Types of Shell:
The C Shell – Denoted as csh
Bill Joy created it at the University of California at Berkeley. It incorporated features such as
aliases and command history. It includes helpful programming features like built-in arithmetic
and C-like expression syntax.
Most commands use options consisting of a single character preceded by a dash, for example,
“l”, but many commands, including those from the GNU Project, also support long options,
consisting of a word preceded by two dashes. Also, many commands allow multiple short
options to be strung together.
Command History
Most Linux distributions remember the last 500 commands by default. Press the down-arrow key
and the previous command disappears.
6. who: It is used to display who are the users connected to our computer currently.
7. who am i Command: Display the details of the current working directory.
8. CLEAR Command: It is used to clear the screen.
9. MAN Command: It help us to know about the command and its options & working.
Tasks:
Task-1:
Run Below Commands and Write their output (Screenshots)
1- Date
2- host name
3- expr 2+2
4- bash –version
5- clear: This command clears the terminal of all commands that has been written.
6- whoami
7- host udacity.com
9- uname
10- history: This command displays history of all the commands that has been run in the
terminal. The screenshot displays the recent commands that I ran in my terminal and 895
shows the number of commands.
11- cal
Task-2:
In this activity, you are required to perform tasks given below:
1. Display the current date
Task-3:
Perform the following tasks using Linux CLI commands
1. Display the amount of free storage on your machine