You are on page 1of 17

LINUX

SYSTEM & NETWORK ADMINISTRATION


Lecture 3 & 4 by : Daima Nazim .
Topic : Management In Linux Environment
01 File Managemnet CONTENTS

02 Directory Mang.

03 User Management

04 Group Management
CASUAL COMMANDS

$ normal user

# root user

whoami to find in which user account you


are log in
su to switch user

pwd To find where I am or in which


directory we are
FILE MANAGEMENT
01
File Handing Commands

vi filename.extension To create file in directory

press Esc then :wq! command Saving procedure of file

cat filename.extension To view content of file

vi filename.extension To view file in text editor

rm filename.extension to remove file


DIRECTORY
02 MANAGEMENT
Directory Handling Commands

mkdir directoryname to make new directory


ls to display all contents in directory
ls -l to display detail view and
information about permissions
rm -r to remove directory with
all its contents

cd directoryname to change directory


cd .. For coming back from directory
USER MANAGEMENT
03
Users In Linux

adduser username To add user


useradd username

passwd username To set password of user


passwd -l To lock or disbale or inactive user account
usermod -L

passwd -u To unlock or enable or reactivate user account


usermod -U

passwd -d username to remove password of user account


CONTINUE....

passwd --status to verify account status

cat /etc/passwd | grep username see user home directory & other related info

usermod -d /directoryname to change directory of user


username
useradd -u 1003 username to create a user with specific userid

useradd -c “comment” username adduser with custom comments


usermod -c “comment” username add comment to existing user

tail -1 /etc/passwd to see commets


GROUP MANAGEMENT
04
Groups In Linux

groupadd group-name create a new group

tail -n5 /etc/group to view already existing groups

useradd -g PG.name -G SG.name username create a new user & assign a group
id username displays users groups

usermod -g PG.name username change user primary group

gpasswd -d username groupname remove a user from group

usermod -a -G group1 , group2 usrname add existing user to multiple groups

usermod -a -G groupname usrname add existing user to single group

*PG : primary group ; SG : secondary group


SOFTWARE
05 MANAGEMENT
Red Hat Base Architecture

• For online downloadin we use : YUM

• To install libraries & then automatically press “yes” when asked we use
flag of -y
• e.g : yum -y install package-name

• Yum makes it own directory & save the install package there

• To update package libraries : yum update

• To update the whole CentOS : yum upgrade


RedHat Packet Mnager (RPM)

• Offline software management tool


RPM and SRPM
=>The two types of RPM is available Source Rpm with the source
code also .
Naming Convention:
Package name -Version- Release – Artitecture.rpm

No Arh: Architecture means its both for X86 and 64 bit and platform
independent package
Rpm libraries and data files directory:
cd var/lib/rpm
Rpm (conti...)

• for installation of RPM


=> rpm –ivh packagename (i- install, v-verbus, h-help)
• If you want to query the database
rpm -qa | grep vsftpd
• For deletion of package
=> rpm –e package name
• If you want to update the package
=> rpm -Uvh packagname
• Check either package have documentation , configuration file ,information
=> rpm –qd cups => rpm –qc cups => rpm –qi cups
Debian Base Architecture

• Debian type Linux like :


• Kali Linux , Parrot , Ubuntu etc we use:
• #apt.get install package-name

You might also like