0% found this document useful (0 votes)
13 views18 pages

01 IASR Linux Commands Part1 en

The document provides a comprehensive overview of essential Linux commands for network services installation and administration, including commands for file management, user management, file access permissions, and changing ownership. Key commands such as 'man', 'pwd', 'ls', 'cp', 'mv', 'rm', 'useradd', 'passwd', and 'chmod' are explained with their usage and options. It serves as a practical guide for users to effectively manage files and users in a Linux environment.

Uploaded by

hibacharouana25
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
13 views18 pages

01 IASR Linux Commands Part1 en

The document provides a comprehensive overview of essential Linux commands for network services installation and administration, including commands for file management, user management, file access permissions, and changing ownership. Key commands such as 'man', 'pwd', 'ls', 'cp', 'mv', 'rm', 'useradd', 'passwd', and 'chmod' are explained with their usage and options. It serves as a practical guide for users to effectively manage files and users in a Linux environment.

Uploaded by

hibacharouana25
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 18

Université Abdel-Hamid Mehri

Constantine II
Faculté NTIC/DIFA 3° TI

Installation et Administration of
Network Services

Linux Commands
R. NOUARA
Linux Commands

 man : display the manual of any command


man cmd
 pwd : prints the full name (the full path) of
current/working directory.
 clear : clear our terminal (Ctrl+l).
 history : Display the list of executed commands
 hostname : Display the hostname of the system
(the file /etc/hostname)
Commands for files management

 cat : display the content of a file on screen.


cat /etc/hosts.conf
 less : simillar to cat but display per page,
 touch : create an empty file.
touch /home/monficher.txt
Commands for files management
 ls : lists the contents of the directory
ls [options] [files]
 We can use generic caracters:

 * :replace a string of caracters.

 ?: replace one caracter

 Options:

-a Show all (including hidden)

-R Recursive list

-r Reverse order

-t Sort by last modified

-S Sort by file size

-l Long listing format

-1 One file per line
Commands for files management

 cp : copies a file(s) or directories to a


destination directory.
cp [irv] source destination
cp /etc/*.conf /var
 Option:

 -I :interactive.
 -r :recursive.
 -v :verbose.
Commandes gestion des fichiers.

 mv : move file(s) to destination directory.


cp [ifv] source destination
 Option:

 -i :interactive.
 -f :force.
 -v :verbose.
Commandes gestion des fichiers.

 rm : remove file(s)
rm [ifvr] fichiers
 Option:

 -I :interactive.
 -f :force.
 -v :verbose.
 r : récursive.

rm file1 ….. filen


Commandes gestion des fichiers.

 mkdir : create a directory


mkdir [p] dir
 Option:

 -p :Create parent directories if they dont


exixsts.

mkdir -p directory1/sub1/sub2
directory1
|____sub1
|____sub2
Commandes des utilisateurs.

 useradd (adduser) : Adding a user


useradd <username> [-g Grp] [-G
Grp1[,grp2,…,Grpn]]

 Create a user and assign him a default directory


in /home

 getent passwd
 Give users list
Users Commands

 passwd : activate a user count by


assigning a password.
passwd <username>

The command add a line in the file /etc/passwd

[username]:[x]:[UID]:[GID]:[Comment]:[Home_D]:[Defa
ult shell]
Users Commands

 groupadd : Adding a group


groupadd <group-name>
 Create a group of users.
 The command add a line in /etc/group

[Grp _name]:[Grp_password]:[GID]:[Grp_members]
Users Commands

 usermod : modify a user.


usermod [options] <username>
 -g add user to group .

 -d Reo_pers: a home directory.

 -e DATE_END_VALIDITY

 -G GRP -G GR1[,GR2,...[,GRN]]]

 -L : lock the password


Users Commands

 userdel : delete a user and its associates


files
userdel <username>

 groupdel : delete a group


groupdel <username>
Files Access

 Permission: composed by three bits rwx.


 r: read
 w: write
 x: execution
 If the bit is set 1 the permission is active, a 0 not
activate.
 Can be writen in decimal:
 5 correspond to : r w x
Read and execution 1 0 1
Files Access

 Example:
rw-rw-r-- 1 user users 150 Mar 19 08:08 f1.doc

 rw- : for user user (read+write = 6)


 rw-: for users group (users) (read+write = 6).
 r--: for others. (read = 4).

 The permission of f1.doc is 664


chmod

 The permissions are attributed to three user’s


categories ugo (user, group, other).
 u : user
 g: The group(s) which the user belongs,
 o : other users.
chmod

 Change permissions of file(s).


chmod [option] new_mod files
 New_mod : 3 digits that specify the priviliges of
ugo.
 Example :
 chmod 764 /home/rep.sh
rwx rw- r--

 Option R : recursive.
chown

 Change the owner and/or the group of file(s).


chown [option] new_owner files
 new_owner: the new owner of the file.
chown user yum.conf
 Change the owner of yum.conf to user
chown user:clients yum.conf
 Change the owner and the group of yum.conf.

You might also like