Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Experiment-3

Manual of the Experiment

CO Mapping:
CO2: Analyse File directory Hierarchy and apply their commands on Linux terminal for file
and directory manipulation.

Welcome to the next practical series of Linux Administration Lab. In this practical we are
going to start with beginners commands, the commands that we can use for general purposes.
I hope you all are installed with the Linux operating system. The main mode of access to a
Linux machine is through a terminal. For each terminal connected to a computer, the kernel
runs a process called a tty that accepts input from the terminal.

Every Linux system has a main console that is connected directly to the machine. The
console is a special type of terminal that is recognized when the system is started. And the
console is that where we can pass the commands to operate the Linux system is Terminal.
The easiest way with which you can open terminal by taking following steps:

Right Click on the desktop → Open Terminal

Fig-1 Terminal View [1]

So, before proceeding to commands let’s first learn to write a command in the terminal:

Command _name [-option] [arguments]

Where,

Command name is the name of the program you want the shell to execute. Commands are
case sensitive.
Option usually indicated by a dash (-), that allows you to alter the behaviour of the command
Arguments are the names of the files, directories or programs that command needs to access.

Note: [ ] brackets signify that they are optional part and can be used as per requirement Next

we are going to start with the beginners commands:

• who: Linux maintains the account of all the users of the system. This command displays
whole information about all the users that have logged into the system.
Syntax: who
Output: user pts/0 2:36

• whoami: Linux identifies the invoking user and lists the user name, terminal line and the
date and time of login.

Syntax: whoami Output:

• echo: It is an external command that is used to display each and everything we write.

Syntax: $echo “Message to print” Output:

• cal: The cal command is used to display the calendar for the current year if no argument is
passed.

Syntax: $cal
Output:

• date: The date command is used to display current date and time. Date is displayed in the
format day-month-year.

Syntax: $date Output:


• man: These are manual pages. It is used to get the detailed overview of any command.

Syntax: $man Output:

• history: This is used to display the shell command history.

Syntax: $history
Output:

• script: It is used to make typescript or record all the terminal activities.

Syntax: $script Output:

• uname: It prints the name, version and other details about the current machine and the
operating system running on it.

Syntax: $uname Output:


• info: It will give detailed information for a command written as a argument.

Syntax: $info
Output:


• help: Inputting the help command will show you all brief information about the command
you are using.

Example: $cal -h

Output:

• last reboot: It tells the system reboot history.

Syntax: $last reboot Output:


• uptime: It shows how long the system has been running, including load average.

Syntax: $uptime Output:

• clear: The clear command does exactly what it says. The clear command clears the screen
and wipes the board clean. To use the clear command simply type clear.

File and Directory Commands:

• ls: It is used to display the listing of files and directories in current directory Syntax: $ls

Output:

• cat: It is used for various tasks, Here we will use it for creation of a file

Syntax: $cat > filename


Output:

• gedit: It is a graphical user interface editor with which file can be create

Syntax: $gedit filename


Example: $gedit ABC

• touch: It is used for creating blank file for storing content. Syntax: $touch filename
Output:

• rm: It is used for removing a file from the directory


Syntax: $rm filename
Output:

• pwd: It stands for Print Working Directory. It tells us about our current location Syntax:

$pwd Output:

• mkdir: It stands for Make Directory. Used to make a directory in the current directory.

Syntax: $mkdir DirectoryName Output:

• cd: It stands for Change Directory. IT is used for shifting directory from one to another.

Syntax: cd DirectoryName Output:

• rmdir: It stands for Remove Directory. As its name suggests, it is used for deleting a
directory.

Syntax: $rmdir DirectoryName Output:


• cp: This command is used for copying the contents from one place to another

Syntax: $cp oldfilname newfilename


Example:

• mv: This command is used for moving the contents of file or directory from one place to
another.
Syntax: $mv sourcename destinationname
Output:

References:

1. https://www.howtogeek.com/140679/beginner-geek-how-to-start-using-the-linux-terminal/
2. https://www.linuxforfreshers.com/p/vi-editor-vi-stands-for-visual.html

You might also like