SlideShare a Scribd company logo
INTRO TO LINUX SYSTEM AND
NETWORK ADMINISTRATION
Aziz M Azizi
Computer Science
Paktia University
We have to remember 3 things in Linux
(Modes, Users and Commands)
Introduction to Linux
 Linux Modes
Linux has two modes:
- GUI (Graphic User Interface) Mode <weak>
- CLI (Command Line Interface) Mode <strong>
• Technically in Linux OS, CLI mode used a lot instead
of GUI mode and all configurations, Installations,
exams and Interview are based on CLI mode.
Login (CLI & GUI), User Account
Introduction to Linux
Login (CLI & GUI):
• In a time, we can login by up to 6 users in CLI mode but we can
login by one user in GUI mode a time.
User Account:
• We have three types user in Linux
- Root / Super user # <Administrator>
- System user
- Ordinary / Normal user $ <Standard>
Basic Command of Linux
Introduction to Linux
Switching Mode:
• If we want Switch from CLI to GUI mode & inverse…, follow these
command.
# Ctrl+Alt+F1 <to GUI mode in rhel>
# Ctrl+Alt+F2 <to CLI mode user 1>
# Ctrl+Alt+F3 <to CLI user mode 2>
# Ctrl+Alt+F4 <to CLI user mode 3>
# Ctrl+Alt+F5 <to CLI user mode 4>
# Ctrl+Alt+F6 <to CLI user mode 5>
# Ctrl+Alt+F7 <to GUI user mode in ubntu>
Contd…
Introduction to Linux
 Linux Shutdown:
# Init 0
# halt
 Linux Restart:
# Init 6
# reboot
# Alt+Ctrl+Delete
 Linux Logout:
# exit
# logout
# Ctrl+D
Contd…
Introduction to Linux
Linux Trash-away
# Clear
# Ctrl+L
 Exist Directory and File Details
# ls <List>
 Enter to a Directory
# cd directory_name/ <change directory>
ex: cd Desktop/
 Making Directories (Folders)
# mkdir dir1 dir2 dir3 dir… <make directories>
ex: mkdir Ali Nabi Jan
Contd…
Introduction to Linux
Making Files
# touch 1st
file 2nd
file 3rd
file …
ex: touch Ab Ac Ad
ex: touch Ab
Copying the file to a directory <Copy Paste>
# cp file_name directory_name/ <copy>
ex: cp Ab Ali/
Moving the file to a directory <Cut Paste>
# mv file_name directory_name … <move>
ex: mv Ab Ali/
Contd…
Introduction to Linux
Go back <one stage>
# cd .. <change directory>
Go back from sub_directories to home directory
# cd <change directory>
Deleting a file
# rm file_name <remove>
ex: rm Ab ? y/n
Deleting a directory
# rm –r directory_name <remove>
ex: rm –r Ali ? y/n <-r = shift-delete>
Contd…
Introduction to Linux
Viewing a directory which we in right now
# pwd <print name of working directory>
Viewing information about other command
# man directory_name <manual>
ex: man pwd
Viewing current date & time, calendar and
complete calendar of a year
# date <date and time>
# cal <calendar>
# cal 2018
Contd…
Introduction to Linux
 Switching users in CLI mode
# su username <switch>
ex: su Jan <from Ali switch in Jan>
• If we switch from root user to ordinary, it will be
without asking authentication but if we want to
switch from ordinary to root; authentication will
asked.
Linux vs. Windows
Introduction to Linux
 Windows
Windows > My Computer > Partitions (Drives C, D, E, F)
• System Drive also called Primary partition drive which
contain Operating system.
• In Windows-Server system drive contain (Document &
Setting, Winnet, Program file, Inetpub)
• All kinds of user exist in (Doc & Setting).
• Other partitions are called Secondary Partition.
Linux vs. Windows
Introduction to Linux
Linux
•Directories
•root userordinary userDrive and Folder
•tree
Linux Structure
Introduction to Linux
Linux Directory Structure
Tree File System
Introduction to Linux
Contd…
Introduction to Linux
•RHELStructure
FHS(File system Hierarchy Standard
•Directory structure
•tree
•Filesystem Hierarchy Standard
Contd…
Introduction to Linux
•supersubsubsub
Root Directory / (forward slash(
•top levelforward slashRoot Directory
Contd…
Introduction to Linux
/root
•homeroot user(superuser(root userroot user.
Ex: C:Documents and SettingsAdministrator
/home
•homeuserordinary userordinary userroot user.home.
C:Documents and Settingusername
Contd…
Introduction to Linux
/boot
•bootkernelbootbootboot
Ex: initrd, Grad 2…
/etc
•
•Ex: DNS, DHCP, Password and…
System tools
/xllskelsubetc
Contd…
Introduction to Linux
/usr
•UNIX Sharable Resourcesread-onlysub
Linux: /usr/lib, /usr/lib, /usr/sbin, /usr/local, /usr/src
Windows: c:program files
/opt
•/.usrsub.third party software.Windows: c:program filesms
office
Contd…
Introduction to Linux
/bin
•Binary filesordinary user
/sbin
•Super user’s binary filessuper user
/dev
•
ex: /dev/hdd … for hard disk, /dev/dvd … for dvdrom similar
to device manager of windows.
DriverOP
Contd…
Introduction to Linux
/proc
•deviceproc
proc
/procproc
/var
•
Ex: /var/opt, /var/log
Contd…
Introduction to Linux
/mnt
mountmountflash card, cd, bd…
/media
•mountremovable
Ex: CD/DVD drives, Flash, USB, Floppy…
/lib
dllshard file
Directory
Introduction to Linux
 Deleting a directory/ directories:
# rmdir directory_name/ <without asking y/n>
ex: rmdir ahmad/
# rm –rvf directory_name1,2,3,…/
<rvf stands for Recursive Verbose File>
ex: rm –rvf ahmad/ <like shift delete with all contents>
 Making Tree Structure Directories
# mkdir –p Ali/{A/{A1,A2},B,C} <-p=parent>
Linux Text Editor
Introduction to Linux
Vim Text Editor
•upward Text EditorProgrammer Text EditorNotepadWordPad
Text Editor
• Built-in <Vim Text Editor> 2) Non-Built-in <open Office>
•Linux Text Editor
•2Configuration
•Vim Text EditorMode
1) Command Mode <Default mode> 2) Insert Mode
Contd…
Introduction to Linux
1)Command ModeEditing ((Move, Copy, Delete.. ,
2Insert Mode
1)Command ModeInsert ModeiEsc.
 Command of creating file by Vim Text Editor
# vim file_name (ex: vim Afghanistan)
 Command of editing saved Vim Txt or other text file
# vi file_name (ex: vi Afghanistan)
 Command of viewing saved text file contents
# cat file_name (ex: cat Afghanistan)
1( Command of bringing date & Cal in Text: :.!date / :.!cal
Contd…
Introduction to Linux
•wqWrite quiteq / :qInsert ModeCommand Mode
•cursortextCommand modefigureTable
Contd…
Introduction to Linux
TouchVimVimTouch
User Account and Group
Management in RHEL
Introduction to Linux
User:
• User is an object, which is used to access the
computer resource (Like file, directory and printer
etc…) with some specific privilege. Each user is
identified by a unique numerical identification
number called user ID (UID).
Group:
• Group is collection of those user, who has the same
privilege on a specific resource. Each group has a
unique numerical identification number called group
ID (GID).
Types of User Account
Introduction to Linux
• There are three types of users available Linux:
Super user / root user (#):
• Super user or root user is the most powerful user
account in Linux operating system. It is administrator of
Linux System.
System user:
• System users are the user that is created by software or
application. For example if we install Apache server,
then it will create a user account named ‘Apache’. These
type users are known as System users. By default the
User Manager does not display the System Users.
Contd…
Introduction to Linux
 Normal user / Ordinary user ($):
• Normal users are the user that is created by rot user account.
They are normal users like John, Rajesh etc. Only the root user
account has the permissions to add or remove the user
account.
• Note: The range of UID_MIN and GID_MIN is specified in
User Configuration Files
Introduction to Linux
/etc: this directory is contains local configuration files:
•Each line in the file contains the login information of a single
user on the system.
Take a look at a single line to see what information it contains:
The field of information are separated by a colon (:) character.
Contd…
Introduction to Linux
• There are seven fields on each line in a typical Linux “ /etc/passwd “ file.
 /etc/passwd
Creation of User Account
Introduction to Linux
 Creating:
# useradd user_name
Ex: useradd Ali
 Giving password to user account:
• We used <passwd> command for two purpose:
1) Giving password to a user by this command.
2) Changing old password of the user.
If we create a user in Linux CLI mode we do it in two steps: 1st
creating user 2nd
giving password to the created user.
p# asswd user_name (ex: passwd Ali)
<then enter and type and re-type the password>
Contd…
Introduction to Linux
 Deleting User Account
• Deleting user without deleting its directory. use the directory
deleting command <rm –rvf dir_nm1,2..>
# userdel user_name (ex: userdel Ali)
• Deleting user with its directory
# userdel –rv user_name (ex: userdel -rv Ali)
 Changing user account password
# passwd user_name <enter key>
(ex: passwd Ali ) <enter key>
New password: … Retype password: …
• If we want to apply any policy on two or more
Users 1st
we bring them under a group then apply the policy
on that group.
Command of disabling / enabling
user and password
Introduction to Linux
 Enabling & Disabling User Account
# vi /etc/passwd <go on the user (/bin/bash) which you want to make
disable then add ! (/bin/bash!). >
# vi /etc/passwd < according to the upper method just remove
the ! from the /bin/bash for enabling the disabled user. >
 Enabling & Disabling User Account Password
# vi /etc/passwd < for removing password, go on the user and
remove x from (aziz:x:500) likes.. (aziz: :500).>
# vi /etc/passwd <for bringing password back, go on the user
and bring again the x (aziz: :500) likes.. (aziz:x:500).>
Command of Creating & Deleting
Group
Introduction to Linux
• If we create user, group will created with it automatically <ex:
user: Ali, group: Ali> while we create group user will not
created with it.
# groupadd group_name <ex: groupadd HR>
# groupdel group_name <ex: groupdel HR>
• (vi /etc/group) command of viewing groups
• (vi /etc/passwd) command of knowing which user is our group
members.
How to make user as a group
member
Introduction to Linux
• Go through (vi /etc/passwd) command and following
these tips:
• Means: we membered aziz and ali user to root group.
• If you want to know, that I am which group member
follow (whoami) command.
• If a group has member it will not dilated.
File and Directory Permission in
Linux
Introduction to Linux
• We can set the file or directory permissions using
(chmod) command in the command line mod.
• There are two methods to define permission:
 Explicitly (Symbolic Mode)
 Binary Reference (Numeric Mode)
Explicitly (Symbolic) Mode
Introduction to Linux
• To explicitly define permission you will need to reference the
Permission Group and Permission Types.
• The Permission Groups used are:
 Owner  u
 Group  g
 All other users  o
 All user ( Owner + Group + All other users)  a
• The Permission Types that are used are:
 Read  r
 Write  w
 Execute  x
Available Operations are in
Symbolic Mode
Introduction to Linux
o + (add the permission to what currently exists)
o - (remove the permission from currently exists)
o = ( set the this value only , replacing existing permissions)
 To add permission:
# chmod permission_groups + permission_types
filename/directory
 To remove permission:
# chmod permission_groups - permission_types
filename/directory
Where Permission Groups are: Owner(u), Group(g) and All other Users(o).
Permission Types are: Read(r), Write(w) and Execute
Binary Reference (Numeric Mode)
Introduction to Linux
• To set the permission using binary reference you must first
understand that the input is done by entering three integers /
numbers.
• A sample permission string would be (chmod 750 mycv.txt)
Which means that the owner has read, write and execute
permissions, the group has read and execute permissions and
all other users have no rights to the file.
#chmod 777 mycv.tx
File Permission Representation
Introduction to Linux
Examples:
rwx --------------------> read+write+execute
rx-----------------------> read+execute
r------------------------> read
rw ---------------------> read+write
7 -----------------------> 4+2+1 -------------> read+write+execute
6------------------------> 4+2 ----------------> read+write
4 ------------------------> 4 -------------------> read
5 ------------------------> 4+2 ----------------> read+execute
0 ------------------------> none (no rights)
Contd…
Introduction to Linux
The #'s can be:
0 = Nothing
1 = Execute
2 = Write
3 = Execute & Write (2 + 1)
4 = Read
5 = Execute & Read (4 + 1)
6 = Read & Write (4 + 2)
7 = Execute & Read & Write (4 + 2 + 1)
To set permission using Binary
Reference (Numeric Mode)
Introduction to Linux
• To set permission on a file or directory for a Owner, Group
and All other users at a time, then you will have to execute the
following command:
#chmod user_permission filename/directory_name
For example, if you want to assign Ful Permission (read, write
and execute) to Owner, read and execute permission to Group
and All other user on a directory named “mydata” you will
have to execute the following command.
#chmod 750 mydata
 Command of viewing the Persission
# ll (long list) # ls (list) –l
Default Permission of File and
Directory
Tips
Introduction to Linux
• never we can take permission from root user.
•rwx (7) is full permission, --- (0) is no permission.
d rwx r-x r--
directory owner group All other user
drwx(7) r-x(5) r--(4)
u g o
File Archiving and Compression
Introduction to Linux
• Used for easy file sharing
• Sending simplicity
• Decrease the exact size of files
• In Linux 1st tar then compress
• In Windows both (archive & compress) mean zip.
• In Linux archived file color is (red) & its extension is .tar (af.tar)
• In Linux archiving will not decrease the size.
 Declaring the size of files and directories
# du (disk usage) file/directory name (ex: du Afghan) /kb
# du –h file/directory name (ex: du –h Afghan) /kb
# ls –l file/directory name (ex: ls –l Afghan) /full details (byte)
# ll file/directory name (ex: ll Afghan) /full details (byte)
Archiving, Opening Archived &
Extract Archived file command
Introduction to Linux
 Archiving
# tar cvf archive file_name file_name 1 2 3 …
# tar cvf Mydata.tar Ali, Nabi, Zabi …
Opening Archived File
# tar tvf (archived file_name)
# tar tvf Mydata.tar
Extracting Archived File
# tar xvf (archived file_name)
# tar xvf Mydata.tar
Compression and Decompression
Files in Linux
Introduction to Linux
Compressing
#gzip file_name (ex: gzip Mydata.tar)
result: Mydata.tar.gz
#bzip2 file_name (ex: bzip2 Mydata.tar)
result: Mydata.tar.bz2
Decompressing
#guzip Mydata.tar.gz (result: Mydata.tar)
#buzip2 Mydata.tar.bz2 (result: Mydata.tar)
Note: bzip2 compress more the file than gzip.
Package Management In RHEL
• rpm stands for Redhat Package Manager.
How to install packages in Linux?
• Insert Linux DVD into your DVD drive.
• Mount the DVD (mount /dev/dvd /media)
• Go to /media directory open /Packages then install the
package which you want to install.
(ex: rpm –Uvh vsftp.rpm )
Mount: Mapping a physical device to a directory (/dev)
device.
Introduction to Linux
Linux Windows
Package Setup
vsftp.rpm VLC.exe
Install, Uninstall & View Installed
Packages
Introduction to Linux
Installing
# rpm –Uvh package_name
rpm –Uvh vsftp.rpm
Uninstalling
# rpm –e package_name
rpm –e vsftp.rpm
Viewing Installed Package
# rpm –qa package_name
rpm –qa vsftp
Contd…
Introduction to Linux

More Related Content

What's hot

User Administration in Linux
User Administration in LinuxUser Administration in Linux
User Administration in LinuxSAMUEL OJO
 
Linux files and file permission
Linux files and file permissionLinux files and file permission
Linux files and file permissionU.P Police
 
Course 102: Lecture 5: File Handling Internals
Course 102: Lecture 5: File Handling Internals Course 102: Lecture 5: File Handling Internals
Course 102: Lecture 5: File Handling Internals Ahmed El-Arabawy
 
File permission in linux
File permission in linuxFile permission in linux
File permission in linuxPrakash Poudel
 
Access control list acl - permissions in linux
Access control list acl  - permissions in linuxAccess control list acl  - permissions in linux
Access control list acl - permissions in linuxSreenatha Reddy K R
 
Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2) Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2) Ahmed El-Arabawy
 
Course 102: Lecture 2: Unwrapping Linux
Course 102: Lecture 2: Unwrapping Linux Course 102: Lecture 2: Unwrapping Linux
Course 102: Lecture 2: Unwrapping Linux Ahmed El-Arabawy
 
Lpi lição 01 exam 101 objectives
Lpi lição 01  exam 101 objectivesLpi lição 01  exam 101 objectives
Lpi lição 01 exam 101 objectivesAcácio Oliveira
 
Unix files
Unix filesUnix files
Unix filesSunil Rm
 
A beginners introduction to unix
A beginners introduction to unixA beginners introduction to unix
A beginners introduction to unixzafarali1981
 
Introduction to LINUX
Introduction to LINUXIntroduction to LINUX
Introduction to LINUXAVI DHALL
 

What's hot (20)

User Administration in Linux
User Administration in LinuxUser Administration in Linux
User Administration in Linux
 
Linux files and file permission
Linux files and file permissionLinux files and file permission
Linux files and file permission
 
Course 102: Lecture 5: File Handling Internals
Course 102: Lecture 5: File Handling Internals Course 102: Lecture 5: File Handling Internals
Course 102: Lecture 5: File Handling Internals
 
Unix Administration 3
Unix Administration 3Unix Administration 3
Unix Administration 3
 
File permission in linux
File permission in linuxFile permission in linux
File permission in linux
 
Access control list acl - permissions in linux
Access control list acl  - permissions in linuxAccess control list acl  - permissions in linux
Access control list acl - permissions in linux
 
cisco
ciscocisco
cisco
 
3. intro
3. intro3. intro
3. intro
 
Basic Unix
Basic UnixBasic Unix
Basic Unix
 
Filepermissions in linux
Filepermissions in linuxFilepermissions in linux
Filepermissions in linux
 
Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2) Course 102: Lecture 16: Process Management (Part 2)
Course 102: Lecture 16: Process Management (Part 2)
 
Course 102: Lecture 2: Unwrapping Linux
Course 102: Lecture 2: Unwrapping Linux Course 102: Lecture 2: Unwrapping Linux
Course 102: Lecture 2: Unwrapping Linux
 
Lpi lição 01 exam 101 objectives
Lpi lição 01  exam 101 objectivesLpi lição 01  exam 101 objectives
Lpi lição 01 exam 101 objectives
 
Unix files
Unix filesUnix files
Unix files
 
Unix ppt
Unix pptUnix ppt
Unix ppt
 
A beginners introduction to unix
A beginners introduction to unixA beginners introduction to unix
A beginners introduction to unix
 
Linux Security
Linux SecurityLinux Security
Linux Security
 
Linux commands
Linux commands Linux commands
Linux commands
 
Introduction to unix
Introduction to unixIntroduction to unix
Introduction to unix
 
Introduction to LINUX
Introduction to LINUXIntroduction to LINUX
Introduction to LINUX
 

Similar to Linux lecture

Similar to Linux lecture (20)

Introduction to Linux
Introduction to Linux Introduction to Linux
Introduction to Linux
 
Linux: Everyting-as-a-service
Linux: Everyting-as-a-serviceLinux: Everyting-as-a-service
Linux: Everyting-as-a-service
 
Introduction to Unix
Introduction to UnixIntroduction to Unix
Introduction to Unix
 
UNIX/Linux training
UNIX/Linux trainingUNIX/Linux training
UNIX/Linux training
 
Linux basics part 1
Linux basics part 1Linux basics part 1
Linux basics part 1
 
Linux Internals - Part I
Linux Internals - Part ILinux Internals - Part I
Linux Internals - Part I
 
Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01
 
How to Audit Linux - Gene Kartavtsev, ISACA MN
How to Audit Linux - Gene Kartavtsev, ISACA MNHow to Audit Linux - Gene Kartavtsev, ISACA MN
How to Audit Linux - Gene Kartavtsev, ISACA MN
 
Linux Basics.pptx
Linux Basics.pptxLinux Basics.pptx
Linux Basics.pptx
 
Linux
LinuxLinux
Linux
 
Linux week 2
Linux week 2Linux week 2
Linux week 2
 
60761 linux
60761 linux60761 linux
60761 linux
 
Linux
Linux Linux
Linux
 
Unix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptxUnix Shell Script - 2 Days Session.pptx
Unix Shell Script - 2 Days Session.pptx
 
Basics of Linux Commands, Git and Github
Basics of Linux Commands, Git and GithubBasics of Linux Commands, Git and Github
Basics of Linux Commands, Git and Github
 
Linux
LinuxLinux
Linux
 
redhat_by_Cbitss.ppt
redhat_by_Cbitss.pptredhat_by_Cbitss.ppt
redhat_by_Cbitss.ppt
 
Sistemas operacionais 8
Sistemas operacionais 8Sistemas operacionais 8
Sistemas operacionais 8
 
Linux basic
Linux basicLinux basic
Linux basic
 
Linux practicals T.Y.B.ScIT
Linux practicals T.Y.B.ScITLinux practicals T.Y.B.ScIT
Linux practicals T.Y.B.ScIT
 

Recently uploaded

Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345beazzy04
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxJisc
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdfTechSoup
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxEduSkills OECD
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationDelapenabediema
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaasiemaillard
 
NLC-2024-Orientation-for-RO-SDO (1).pptx
NLC-2024-Orientation-for-RO-SDO (1).pptxNLC-2024-Orientation-for-RO-SDO (1).pptx
NLC-2024-Orientation-for-RO-SDO (1).pptxssuserbdd3e8
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxJheel Barad
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasGeoBlogs
 
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...Nguyen Thanh Tu Collection
 
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptxSolid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptxDenish Jangid
 
Benefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational ResourcesBenefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational Resourcesdimpy50
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...Nguyen Thanh Tu Collection
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdfCarlosHernanMontoyab2
 
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdfINU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdfbu07226
 
plant breeding methods in asexually or clonally propagated crops
plant breeding methods in asexually or clonally propagated cropsplant breeding methods in asexually or clonally propagated crops
plant breeding methods in asexually or clonally propagated cropsparmarsneha2
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonSteve Thomason
 
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...Sayali Powar
 

Recently uploaded (20)

Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345Sha'Carri Richardson Presentation 202345
Sha'Carri Richardson Presentation 202345
 
Supporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptxSupporting (UKRI) OA monographs at Salford.pptx
Supporting (UKRI) OA monographs at Salford.pptx
 
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup   New Member Orientation and Q&A (May 2024).pdfWelcome to TechSoup   New Member Orientation and Q&A (May 2024).pdf
Welcome to TechSoup New Member Orientation and Q&A (May 2024).pdf
 
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxStudents, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptx
 
The Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official PublicationThe Challenger.pdf DNHS Official Publication
The Challenger.pdf DNHS Official Publication
 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
 
B.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdfB.ed spl. HI pdusu exam paper-2023-24.pdf
B.ed spl. HI pdusu exam paper-2023-24.pdf
 
NLC-2024-Orientation-for-RO-SDO (1).pptx
NLC-2024-Orientation-for-RO-SDO (1).pptxNLC-2024-Orientation-for-RO-SDO (1).pptx
NLC-2024-Orientation-for-RO-SDO (1).pptx
 
Instructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptxInstructions for Submissions thorugh G- Classroom.pptx
Instructions for Submissions thorugh G- Classroom.pptx
 
The geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideasThe geography of Taylor Swift - some ideas
The geography of Taylor Swift - some ideas
 
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
50 ĐỀ LUYỆN THI IOE LỚP 9 - NĂM HỌC 2022-2023 (CÓ LINK HÌNH, FILE AUDIO VÀ ĐÁ...
 
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptxSolid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
Solid waste management & Types of Basic civil Engineering notes by DJ Sir.pptx
 
Benefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational ResourcesBenefits and Challenges of Using Open Educational Resources
Benefits and Challenges of Using Open Educational Resources
 
Chapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptxChapter 3 - Islamic Banking Products and Services.pptx
Chapter 3 - Islamic Banking Products and Services.pptx
 
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
GIÁO ÁN DẠY THÊM (KẾ HOẠCH BÀI BUỔI 2) - TIẾNG ANH 8 GLOBAL SUCCESS (2 CỘT) N...
 
678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf678020731-Sumas-y-Restas-Para-Colorear.pdf
678020731-Sumas-y-Restas-Para-Colorear.pdf
 
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdfINU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
INU_CAPSTONEDESIGN_비밀번호486_업로드용 발표자료.pdf
 
plant breeding methods in asexually or clonally propagated crops
plant breeding methods in asexually or clonally propagated cropsplant breeding methods in asexually or clonally propagated crops
plant breeding methods in asexually or clonally propagated crops
 
The Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve ThomasonThe Art Pastor's Guide to Sabbath | Steve Thomason
The Art Pastor's Guide to Sabbath | Steve Thomason
 
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
UNIT – IV_PCI Complaints: Complaints and evaluation of complaints, Handling o...
 

Linux lecture

  • 1. INTRO TO LINUX SYSTEM AND NETWORK ADMINISTRATION Aziz M Azizi Computer Science Paktia University
  • 2. We have to remember 3 things in Linux (Modes, Users and Commands) Introduction to Linux  Linux Modes Linux has two modes: - GUI (Graphic User Interface) Mode <weak> - CLI (Command Line Interface) Mode <strong> • Technically in Linux OS, CLI mode used a lot instead of GUI mode and all configurations, Installations, exams and Interview are based on CLI mode.
  • 3. Login (CLI & GUI), User Account Introduction to Linux Login (CLI & GUI): • In a time, we can login by up to 6 users in CLI mode but we can login by one user in GUI mode a time. User Account: • We have three types user in Linux - Root / Super user # <Administrator> - System user - Ordinary / Normal user $ <Standard>
  • 4. Basic Command of Linux Introduction to Linux Switching Mode: • If we want Switch from CLI to GUI mode & inverse…, follow these command. # Ctrl+Alt+F1 <to GUI mode in rhel> # Ctrl+Alt+F2 <to CLI mode user 1> # Ctrl+Alt+F3 <to CLI user mode 2> # Ctrl+Alt+F4 <to CLI user mode 3> # Ctrl+Alt+F5 <to CLI user mode 4> # Ctrl+Alt+F6 <to CLI user mode 5> # Ctrl+Alt+F7 <to GUI user mode in ubntu>
  • 5. Contd… Introduction to Linux  Linux Shutdown: # Init 0 # halt  Linux Restart: # Init 6 # reboot # Alt+Ctrl+Delete  Linux Logout: # exit # logout # Ctrl+D
  • 6. Contd… Introduction to Linux Linux Trash-away # Clear # Ctrl+L  Exist Directory and File Details # ls <List>  Enter to a Directory # cd directory_name/ <change directory> ex: cd Desktop/  Making Directories (Folders) # mkdir dir1 dir2 dir3 dir… <make directories> ex: mkdir Ali Nabi Jan
  • 7. Contd… Introduction to Linux Making Files # touch 1st file 2nd file 3rd file … ex: touch Ab Ac Ad ex: touch Ab Copying the file to a directory <Copy Paste> # cp file_name directory_name/ <copy> ex: cp Ab Ali/ Moving the file to a directory <Cut Paste> # mv file_name directory_name … <move> ex: mv Ab Ali/
  • 8. Contd… Introduction to Linux Go back <one stage> # cd .. <change directory> Go back from sub_directories to home directory # cd <change directory> Deleting a file # rm file_name <remove> ex: rm Ab ? y/n Deleting a directory # rm –r directory_name <remove> ex: rm –r Ali ? y/n <-r = shift-delete>
  • 9. Contd… Introduction to Linux Viewing a directory which we in right now # pwd <print name of working directory> Viewing information about other command # man directory_name <manual> ex: man pwd Viewing current date & time, calendar and complete calendar of a year # date <date and time> # cal <calendar> # cal 2018
  • 10. Contd… Introduction to Linux  Switching users in CLI mode # su username <switch> ex: su Jan <from Ali switch in Jan> • If we switch from root user to ordinary, it will be without asking authentication but if we want to switch from ordinary to root; authentication will asked.
  • 11. Linux vs. Windows Introduction to Linux  Windows Windows > My Computer > Partitions (Drives C, D, E, F) • System Drive also called Primary partition drive which contain Operating system. • In Windows-Server system drive contain (Document & Setting, Winnet, Program file, Inetpub) • All kinds of user exist in (Doc & Setting). • Other partitions are called Secondary Partition.
  • 12. Linux vs. Windows Introduction to Linux Linux •Directories •root userordinary userDrive and Folder •tree
  • 14. Linux Directory Structure Tree File System Introduction to Linux
  • 15. Contd… Introduction to Linux •RHELStructure FHS(File system Hierarchy Standard •Directory structure •tree •Filesystem Hierarchy Standard
  • 16. Contd… Introduction to Linux •supersubsubsub Root Directory / (forward slash( •top levelforward slashRoot Directory
  • 17. Contd… Introduction to Linux /root •homeroot user(superuser(root userroot user. Ex: C:Documents and SettingsAdministrator /home •homeuserordinary userordinary userroot user.home. C:Documents and Settingusername
  • 18. Contd… Introduction to Linux /boot •bootkernelbootbootboot Ex: initrd, Grad 2… /etc • •Ex: DNS, DHCP, Password and… System tools /xllskelsubetc
  • 19. Contd… Introduction to Linux /usr •UNIX Sharable Resourcesread-onlysub Linux: /usr/lib, /usr/lib, /usr/sbin, /usr/local, /usr/src Windows: c:program files /opt •/.usrsub.third party software.Windows: c:program filesms office
  • 20. Contd… Introduction to Linux /bin •Binary filesordinary user /sbin •Super user’s binary filessuper user /dev • ex: /dev/hdd … for hard disk, /dev/dvd … for dvdrom similar to device manager of windows. DriverOP
  • 22. Contd… Introduction to Linux /mnt mountmountflash card, cd, bd… /media •mountremovable Ex: CD/DVD drives, Flash, USB, Floppy… /lib dllshard file
  • 23. Directory Introduction to Linux  Deleting a directory/ directories: # rmdir directory_name/ <without asking y/n> ex: rmdir ahmad/ # rm –rvf directory_name1,2,3,…/ <rvf stands for Recursive Verbose File> ex: rm –rvf ahmad/ <like shift delete with all contents>  Making Tree Structure Directories # mkdir –p Ali/{A/{A1,A2},B,C} <-p=parent>
  • 24. Linux Text Editor Introduction to Linux Vim Text Editor •upward Text EditorProgrammer Text EditorNotepadWordPad Text Editor • Built-in <Vim Text Editor> 2) Non-Built-in <open Office> •Linux Text Editor •2Configuration •Vim Text EditorMode 1) Command Mode <Default mode> 2) Insert Mode
  • 25. Contd… Introduction to Linux 1)Command ModeEditing ((Move, Copy, Delete.. , 2Insert Mode 1)Command ModeInsert ModeiEsc.  Command of creating file by Vim Text Editor # vim file_name (ex: vim Afghanistan)  Command of editing saved Vim Txt or other text file # vi file_name (ex: vi Afghanistan)  Command of viewing saved text file contents # cat file_name (ex: cat Afghanistan) 1( Command of bringing date & Cal in Text: :.!date / :.!cal
  • 26. Contd… Introduction to Linux •wqWrite quiteq / :qInsert ModeCommand Mode •cursortextCommand modefigureTable
  • 28. User Account and Group Management in RHEL Introduction to Linux User: • User is an object, which is used to access the computer resource (Like file, directory and printer etc…) with some specific privilege. Each user is identified by a unique numerical identification number called user ID (UID). Group: • Group is collection of those user, who has the same privilege on a specific resource. Each group has a unique numerical identification number called group ID (GID).
  • 29. Types of User Account Introduction to Linux • There are three types of users available Linux: Super user / root user (#): • Super user or root user is the most powerful user account in Linux operating system. It is administrator of Linux System. System user: • System users are the user that is created by software or application. For example if we install Apache server, then it will create a user account named ‘Apache’. These type users are known as System users. By default the User Manager does not display the System Users.
  • 30. Contd… Introduction to Linux  Normal user / Ordinary user ($): • Normal users are the user that is created by rot user account. They are normal users like John, Rajesh etc. Only the root user account has the permissions to add or remove the user account. • Note: The range of UID_MIN and GID_MIN is specified in
  • 31. User Configuration Files Introduction to Linux /etc: this directory is contains local configuration files: •Each line in the file contains the login information of a single user on the system. Take a look at a single line to see what information it contains: The field of information are separated by a colon (:) character.
  • 32. Contd… Introduction to Linux • There are seven fields on each line in a typical Linux “ /etc/passwd “ file.  /etc/passwd
  • 33. Creation of User Account Introduction to Linux  Creating: # useradd user_name Ex: useradd Ali  Giving password to user account: • We used <passwd> command for two purpose: 1) Giving password to a user by this command. 2) Changing old password of the user. If we create a user in Linux CLI mode we do it in two steps: 1st creating user 2nd giving password to the created user. p# asswd user_name (ex: passwd Ali) <then enter and type and re-type the password>
  • 34. Contd… Introduction to Linux  Deleting User Account • Deleting user without deleting its directory. use the directory deleting command <rm –rvf dir_nm1,2..> # userdel user_name (ex: userdel Ali) • Deleting user with its directory # userdel –rv user_name (ex: userdel -rv Ali)  Changing user account password # passwd user_name <enter key> (ex: passwd Ali ) <enter key> New password: … Retype password: … • If we want to apply any policy on two or more Users 1st we bring them under a group then apply the policy on that group.
  • 35. Command of disabling / enabling user and password Introduction to Linux  Enabling & Disabling User Account # vi /etc/passwd <go on the user (/bin/bash) which you want to make disable then add ! (/bin/bash!). > # vi /etc/passwd < according to the upper method just remove the ! from the /bin/bash for enabling the disabled user. >  Enabling & Disabling User Account Password # vi /etc/passwd < for removing password, go on the user and remove x from (aziz:x:500) likes.. (aziz: :500).> # vi /etc/passwd <for bringing password back, go on the user and bring again the x (aziz: :500) likes.. (aziz:x:500).>
  • 36. Command of Creating & Deleting Group Introduction to Linux • If we create user, group will created with it automatically <ex: user: Ali, group: Ali> while we create group user will not created with it. # groupadd group_name <ex: groupadd HR> # groupdel group_name <ex: groupdel HR> • (vi /etc/group) command of viewing groups • (vi /etc/passwd) command of knowing which user is our group members.
  • 37. How to make user as a group member Introduction to Linux • Go through (vi /etc/passwd) command and following these tips: • Means: we membered aziz and ali user to root group. • If you want to know, that I am which group member follow (whoami) command. • If a group has member it will not dilated.
  • 38. File and Directory Permission in Linux Introduction to Linux • We can set the file or directory permissions using (chmod) command in the command line mod. • There are two methods to define permission:  Explicitly (Symbolic Mode)  Binary Reference (Numeric Mode)
  • 39. Explicitly (Symbolic) Mode Introduction to Linux • To explicitly define permission you will need to reference the Permission Group and Permission Types. • The Permission Groups used are:  Owner  u  Group  g  All other users  o  All user ( Owner + Group + All other users)  a • The Permission Types that are used are:  Read  r  Write  w  Execute  x
  • 40. Available Operations are in Symbolic Mode Introduction to Linux o + (add the permission to what currently exists) o - (remove the permission from currently exists) o = ( set the this value only , replacing existing permissions)  To add permission: # chmod permission_groups + permission_types filename/directory  To remove permission: # chmod permission_groups - permission_types filename/directory Where Permission Groups are: Owner(u), Group(g) and All other Users(o). Permission Types are: Read(r), Write(w) and Execute
  • 41. Binary Reference (Numeric Mode) Introduction to Linux • To set the permission using binary reference you must first understand that the input is done by entering three integers / numbers. • A sample permission string would be (chmod 750 mycv.txt) Which means that the owner has read, write and execute permissions, the group has read and execute permissions and all other users have no rights to the file. #chmod 777 mycv.tx
  • 42. File Permission Representation Introduction to Linux Examples: rwx --------------------> read+write+execute rx-----------------------> read+execute r------------------------> read rw ---------------------> read+write 7 -----------------------> 4+2+1 -------------> read+write+execute 6------------------------> 4+2 ----------------> read+write 4 ------------------------> 4 -------------------> read 5 ------------------------> 4+2 ----------------> read+execute 0 ------------------------> none (no rights)
  • 43. Contd… Introduction to Linux The #'s can be: 0 = Nothing 1 = Execute 2 = Write 3 = Execute & Write (2 + 1) 4 = Read 5 = Execute & Read (4 + 1) 6 = Read & Write (4 + 2) 7 = Execute & Read & Write (4 + 2 + 1)
  • 44. To set permission using Binary Reference (Numeric Mode) Introduction to Linux • To set permission on a file or directory for a Owner, Group and All other users at a time, then you will have to execute the following command: #chmod user_permission filename/directory_name For example, if you want to assign Ful Permission (read, write and execute) to Owner, read and execute permission to Group and All other user on a directory named “mydata” you will have to execute the following command. #chmod 750 mydata  Command of viewing the Persission # ll (long list) # ls (list) –l
  • 45. Default Permission of File and Directory Tips Introduction to Linux • never we can take permission from root user. •rwx (7) is full permission, --- (0) is no permission. d rwx r-x r-- directory owner group All other user drwx(7) r-x(5) r--(4) u g o
  • 46. File Archiving and Compression Introduction to Linux • Used for easy file sharing • Sending simplicity • Decrease the exact size of files • In Linux 1st tar then compress • In Windows both (archive & compress) mean zip. • In Linux archived file color is (red) & its extension is .tar (af.tar) • In Linux archiving will not decrease the size.  Declaring the size of files and directories # du (disk usage) file/directory name (ex: du Afghan) /kb # du –h file/directory name (ex: du –h Afghan) /kb # ls –l file/directory name (ex: ls –l Afghan) /full details (byte) # ll file/directory name (ex: ll Afghan) /full details (byte)
  • 47. Archiving, Opening Archived & Extract Archived file command Introduction to Linux  Archiving # tar cvf archive file_name file_name 1 2 3 … # tar cvf Mydata.tar Ali, Nabi, Zabi … Opening Archived File # tar tvf (archived file_name) # tar tvf Mydata.tar Extracting Archived File # tar xvf (archived file_name) # tar xvf Mydata.tar
  • 48. Compression and Decompression Files in Linux Introduction to Linux Compressing #gzip file_name (ex: gzip Mydata.tar) result: Mydata.tar.gz #bzip2 file_name (ex: bzip2 Mydata.tar) result: Mydata.tar.bz2 Decompressing #guzip Mydata.tar.gz (result: Mydata.tar) #buzip2 Mydata.tar.bz2 (result: Mydata.tar) Note: bzip2 compress more the file than gzip.
  • 49. Package Management In RHEL • rpm stands for Redhat Package Manager. How to install packages in Linux? • Insert Linux DVD into your DVD drive. • Mount the DVD (mount /dev/dvd /media) • Go to /media directory open /Packages then install the package which you want to install. (ex: rpm –Uvh vsftp.rpm ) Mount: Mapping a physical device to a directory (/dev) device. Introduction to Linux Linux Windows Package Setup vsftp.rpm VLC.exe
  • 50. Install, Uninstall & View Installed Packages Introduction to Linux Installing # rpm –Uvh package_name rpm –Uvh vsftp.rpm Uninstalling # rpm –e package_name rpm –e vsftp.rpm Viewing Installed Package # rpm –qa package_name rpm –qa vsftp