Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
Pre Laboratory:
1. What are the three types of users in Linux?
2. What is the benefit of /home directory?
3. What are the differences between files and directory?
4. What is the difference between terminals on TTY CONSOL ports?
5. What is the difference between cp and mv command?
Objective:
Learn about the types of users in Unix/Linux system.
Differentiate between root directory and home directory.
Learn some basic commands in Unix/Linux including help, list and history commands
Learn how to deal with directories and files in Linux.
Learn how to kill and pause processes.
Introduction:
Users in Linux:
The root user account – full permission user:
This is the main user account in Linux system. It is automatically created during the installation. It
has the highest privilege in system. It can do any administrative work and can access any service.
This account is intended for system administration and should be used only for this purpose. It
should not be used for routine activities. It can’t be deleted. But if require, it can be disabled.
The regular user account – limited user:
This is the normal user account. During the installation, one regular user account is created
automatically. After the installation, we can create as many regular user accounts as we need. This
account has moderate privilege. This account is intended for routine works. It can perform only
the tasks for which it is allowed and can access only those files and services for which it is
authorized. As per requirement, it can be disabled or deleted.
The service account:
Service accounts are created by installation packages when they are installed. These accounts are
used by services to run processes and execute functions. These accounts are neither intended nor
should be used for routine work.
The home directory can be said as a personal working space for all the users except root. There is
a separate directory for every user. For example, two users 'jtp1' and 'jtp2' will have directories
like "/home/jtp1" and "/home/jtp2". These users will have all the rights under their directory files.
The root (administrative) user is the only user who has its home directory in a different location
by default. The path of the root user is '/root/', where it has control under all the directories and
files.
~ : /home/username
2
ARAB AMERICAN UNIVERSITY – FACULTY OF ENGINEERING & INFORMATION TECHNOLOGY – COMPUTER
SYSTEM ENGINEERING - Linux Lab
EXPERIMENTE #3 Basic Unix/Linux commands
3
ARAB AMERICAN UNIVERSITY – FACULTY OF ENGINEERING & INFORMATION TECHNOLOGY – COMPUTER
SYSTEM ENGINEERING - Linux Lab
EXPERIMENTE #3 Basic Unix/Linux commands
Man command:
Man command in Linux is used to display the user manual of any command that we can run on
the terminal. It provides a detailed view of the command which includes NAME, SYNOPSIS,
DESCRIPTION, OPTIONS, EXIT STATUS, RETURN VALUES, ERRORS, FILES,
VERSIONS, EXAMPLES, AUTHORS and SEE ALSO.
--help command:
--help command is used to get the complete usage of that command.
4
ARAB AMERICAN UNIVERSITY – FACULTY OF ENGINEERING & INFORMATION TECHNOLOGY – COMPUTER
SYSTEM ENGINEERING - Linux Lab
EXPERIMENTE #3 Basic Unix/Linux commands
whatis command:
whatis command in Linux is used to get a one-line manual page descriptions.
clear command:
clear command is used to clear the screen.
5
ARAB AMERICAN UNIVERSITY – FACULTY OF ENGINEERING & INFORMATION TECHNOLOGY – COMPUTER
SYSTEM ENGINEERING - Linux Lab
EXPERIMENTE #3 Basic Unix/Linux commands
Syntax cd [directory].
1. touch command :
It is used to create a file without any content. The file created using touch command
is empty. This command can be used when the user doesn’t have data to store at the
time of file creation.
2. mkdir command:
It allows users to create or make new directories. mkdir stands for “make directory.”
6
ARAB AMERICAN UNIVERSITY – FACULTY OF ENGINEERING & INFORMATION TECHNOLOGY – COMPUTER
SYSTEM ENGINEERING - Linux Lab
EXPERIMENTE #3 Basic Unix/Linux commands
4. rm –rf command: To remove non-empty directories and all the files without being
prompted, use rm with the -r (recursive) and -f options.
Example:
Desktop
mydir dir2 f1
F2 F3
History commands:
history command: shows a list of the commands entered since you started the session.
7
ARAB AMERICAN UNIVERSITY – FACULTY OF ENGINEERING & INFORMATION TECHNOLOGY – COMPUTER
SYSTEM ENGINEERING - Linux Lab
EXPERIMENTE #3 Basic Unix/Linux commands
last command: displays the list of all the users logged in and out since the
file /var/log/wtmp was created.
w command: shows who is logged on and what they are doing. This command shows
the information about the users currently on the machine and their processes.
who command: displays the users currently logged in to your UNIX or Linux operating
system.
whoami command: displays the username of the current user when this command is
invoked.
id command: used to find out user and group names and numeric ID's (UID or group ID)
of the current user or any other user in the server.
8
ARAB AMERICAN UNIVERSITY – FACULTY OF ENGINEERING & INFORMATION TECHNOLOGY – COMPUTER
SYSTEM ENGINEERING - Linux Lab
EXPERIMENTE #3 Basic Unix/Linux commands
List commands:
ls lists the files in the current working directory.
Option Description
ls -lh List all files and directories with another column representing the
size of each file/directory
Try man ls to display a manual with all possible options for the ls command.
9
ARAB AMERICAN UNIVERSITY – FACULTY OF ENGINEERING & INFORMATION TECHNOLOGY – COMPUTER
SYSTEM ENGINEERING - Linux Lab
EXPERIMENTE #3 Basic Unix/Linux commands
10