SlideShare a Scribd company logo
1 of 17
Download to read offline
Review of Linux Basics
4
Key Knowledge Area
● Linux Directory Structure
● File Permissions and Security
● Common Linux Commands and Programs
● Working with Linux Shells
● Bash Shell Scripting
5
Linux Directory Structure
6
Navigating the Linux File System
● Change Directory
# cd /home/user
# cd ..
# pwd
/home
# cd user/Downloads
# cd /home/user
# cd ..
# pwd
/home
# cd user/Downloads
7
File Permissions and Security
:‫شود‬ ‫می‬ ‫اعمال‬ ‫سطح‬ ‫سه‬ ‫در‬ ‫لینوکس‬ ‫فایل‬ ‫سیستم‬ ‫در‬ ‫دسترسی‬
●) ‫کاربر‬user‫پوشه‬ ‫یا‬ ‫فایل‬ ‫مالک‬ ‫کاربر‬ : (
●) ‫گروه‬group‫پوشه‬ ‫یا‬ ‫فایل‬ ‫مالک‬ ‫گروه‬ : (
●) ‫دیگران‬other‫فایل‬ ‫مالک‬ ‫غیر‬ ‫به‬ ‫ها‬‫گروه‬ ‫و‬ ‫کاربران‬ : (
$ ls -l
drwxr-xr-x 2 user user 4096 Oct 13 13:19 Desktop
drwxr-xr-x 2 user user 4096 Oct 13 13:19 Documents
drwxr-xr-x 2 user user 4096 Oct 13 13:19 Downloads
drwxr-xr-x 2 user user 4096 Oct 13 13:19 Music
$ ls -l
drwxr-xr-x 2 user user 4096 Oct 13 13:19 Desktop
drwxr-xr-x 2 user user 4096 Oct 13 13:19 Documents
drwxr-xr-x 2 user user 4096 Oct 13 13:19 Downloads
drwxr-xr-x 2 user user 4096 Oct 13 13:19 Music
# umask
0022
# umask
0022
8
SETUID and SETGID
●SETUID
●‫را‬ ‫آن‬ ‫تواند‬‫می‬ ‫کاربری‬ ‫هر‬ ، ‫شود‬ ‫داده‬ ‫فایلی‬ ‫به‬ ‫مجوز‬ ‫این‬ ‫که‬ ‫صورتی‬ ‫در‬ :‫فایل‬ ‫روی‬ ‫بر‬
.‫کند‬ ‫اجرا‬ ‫فایل‬ ‫صاحب‬ ‫مجوز‬ ‫با‬
●.‫ندارد‬ ‫اثری‬ ‫هیچ‬ ‫ها‬ ‫پوشه‬ ‫برای‬ ‫مجوز‬ ‫این‬ :‫پوشه‬ ‫روی‬ ‫بر‬
●SETGID
●.‫کند‬ ‫اجرا‬ ‫گروه‬ ‫مجوز‬ ‫با‬ ‫را‬ ‫فایل‬ ‫تواند‬‫می‬ ‫کاربری‬ ‫هر‬ :‫فایل‬ ‫روی‬ ‫بر‬
●‫خواهد‬ ‫مالک‬ ‫گروه‬ ‫مالکیت‬ ‫در‬ ‫پوشه‬ ‫در‬ ‫شده‬ ‫ساخته‬ ‫جدید‬ ‫فایل‬ ‫هر‬ :‫پوشه‬ ‫روی‬ ‫بر‬
‫صورت‬ ‫به‬ ‫کاربران‬ ‫که‬ ‫هایی‬ ‫پوشه‬ ‫در‬ ‫استفاده‬ ‫برای‬ .‫فایل‬ ‫سازنده‬ ‫گروه‬ ‫نه‬ ‫و‬ ‫بود‬
‫است‬ ‫مناسب‬ ‫کنند‬‫می‬ ‫کار‬ ‫مشترک‬
9
File Security Attributes
● lsattr and chattr
a : append only
c : compressed
d : no dump
e : extent format
i : immutable
j : data journalling
s : secure deletion
t : no tail-merging
u : undeletable
A : no atime updates
C : no copy on write
D : synchronous directory updates
S : synchronous updates
T : top of directory hierarchy
a : append only
c : compressed
d : no dump
e : extent format
i : immutable
j : data journalling
s : secure deletion
t : no tail-merging
u : undeletable
A : no atime updates
C : no copy on write
D : synchronous directory updates
S : synchronous updates
T : top of directory hierarchy
# chattr +i /path/to/file# chattr +i /path/to/file
10
Manipulating Files and Directories
Work with file
rm
cp
rmdir
mkdir
mv
File and Dir
cd
ls
Home Dir
Tiled ~
.and..
11
Viewing and Searching Files
Search
find
locate
grep
head,tail
which
12
Environment and Shell Variables
● Shell Variables
● Enviroment Variables
# unset varname# unset varname
# varname=value# varname=value
# export varname=value# export varname=value
# echo $varname# echo $varname
13
Bash Shell Scripting
● She Bang
$ vi helloworld.sh
#!/bin/bash
var=oracle
echo $var
$ vi helloworld.sh
#!/bin/bash
var=oracle
echo $var
14
Bash Shell Scripting: Conditions
● Conditions
test expression
[ expression ]
help test
test expression
[ expression ]
help test
if [ expression ]
then
commands
elif [ expression ]
then
commands
else
commands
fi
if [ expression ]
then
commands
elif [ expression ]
then
commands
else
commands
fi
15
Bash Shell Scripting: case
●‫گزینه‬ ‫چندین‬ ‫انتخاب‬
case $variable in
1 ) echo "You entered one”
;;
2 ) echo "You entered two
;;
3 ) echo "You entered three”
;;
* ) echo "You did not enter a number”
echo "between 1 and 3”
esac
case $variable in
1 ) echo "You entered one”
;;
2 ) echo "You entered two
;;
3 ) echo "You entered three”
;;
* ) echo "You did not enter a number”
echo "between 1 and 3”
esac
16
Bash Shell Scripting: while
●‫است‬ ‫درست‬ ‫شرط‬ ‫که‬ ‫تازمانی‬
while [ test ]
do
commands
done
while [ test ]
do
commands
done
17
Bash Shell Scripting: In-List Syntax of for
for I in list
do
commands
done
for I in list
do
commands
done
for I in /path/to/*
do
commands to $I
done
for I in /path/to/*
do
commands to $I
done
18
Bash Shell Scripting: Controlled Loop Syntax of for
for (( c=1; c<=5; c++ ))
do
commands
done
for (( c=1; c<=5; c++ ))
do
commands
done
for I in {start..end..step}
do
commands
done
for I in {start..end..step}
do
commands
done

More Related Content

What's hot

15 3. modulization
15 3. modulization15 3. modulization
15 3. modulization웅식 전
 
Unix Basics
Unix BasicsUnix Basics
Unix BasicsDr.Ravi
 
Linux command for beginners
Linux command for beginnersLinux command for beginners
Linux command for beginnersSuKyeong Jang
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commandsSagar Kumar
 
리눅스 간단 강의 5강
리눅스 간단 강의 5강리눅스 간단 강의 5강
리눅스 간단 강의 5강Junsu Kim
 
Linux system admin useful commands
Linux system admin useful commandsLinux system admin useful commands
Linux system admin useful commandsali98091
 
Unix Commands
Unix CommandsUnix Commands
Unix CommandsDr.Ravi
 
Basic unix commands
Basic unix commandsBasic unix commands
Basic unix commandsswtjerin4u
 
Unix Command Line Productivity Tips
Unix Command Line Productivity TipsUnix Command Line Productivity Tips
Unix Command Line Productivity TipsKeith Bennett
 
Basic command ppt
Basic command pptBasic command ppt
Basic command pptRohit Kumar
 
Unix And Shell Scripting
Unix And Shell ScriptingUnix And Shell Scripting
Unix And Shell ScriptingJaibeer Malik
 
Unix shell scripting basics
Unix shell scripting basicsUnix shell scripting basics
Unix shell scripting basicsManav Prasad
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic CommandsHanan Nmr
 

What's hot (20)

15 3. modulization
15 3. modulization15 3. modulization
15 3. modulization
 
Basic Linux day 6
Basic Linux day 6Basic Linux day 6
Basic Linux day 6
 
Basic linux day 4
Basic linux day 4Basic linux day 4
Basic linux day 4
 
Unix Basics
Unix BasicsUnix Basics
Unix Basics
 
Linux command for beginners
Linux command for beginnersLinux command for beginners
Linux command for beginners
 
Linux basic commands
Linux basic commandsLinux basic commands
Linux basic commands
 
Unix slideshare
Unix slideshareUnix slideshare
Unix slideshare
 
리눅스 간단 강의 5강
리눅스 간단 강의 5강리눅스 간단 강의 5강
리눅스 간단 강의 5강
 
Linux system admin useful commands
Linux system admin useful commandsLinux system admin useful commands
Linux system admin useful commands
 
Rpm Introduction
Rpm IntroductionRpm Introduction
Rpm Introduction
 
Unix Commands
Unix CommandsUnix Commands
Unix Commands
 
Linux Commands
Linux CommandsLinux Commands
Linux Commands
 
Basic unix commands
Basic unix commandsBasic unix commands
Basic unix commands
 
Unix Command Line Productivity Tips
Unix Command Line Productivity TipsUnix Command Line Productivity Tips
Unix Command Line Productivity Tips
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
 
Unix And Shell Scripting
Unix And Shell ScriptingUnix And Shell Scripting
Unix And Shell Scripting
 
Unix shell scripting basics
Unix shell scripting basicsUnix shell scripting basics
Unix shell scripting basics
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic Commands
 
Linux And perl
Linux And perlLinux And perl
Linux And perl
 
2 Unix basics. Part 2
2 Unix basics. Part 22 Unix basics. Part 2
2 Unix basics. Part 2
 

Viewers also liked

Mbai itm u1.2 planning
Mbai  itm u1.2 planningMbai  itm u1.2 planning
Mbai itm u1.2 planningRai University
 
cover letter for resume
cover letter for resumecover letter for resume
cover letter for resumeKelli Griffin
 
COURRIER CAB 31 MD
COURRIER CAB 31 MDCOURRIER CAB 31 MD
COURRIER CAB 31 MDComPol
 
00251740510626254
0025174051062625400251740510626254
00251740510626254Jan Ahmed
 
Corporate social-and-financial-performance-an-extended-stakeholder-theory-and...
Corporate social-and-financial-performance-an-extended-stakeholder-theory-and...Corporate social-and-financial-performance-an-extended-stakeholder-theory-and...
Corporate social-and-financial-performance-an-extended-stakeholder-theory-and...Jan Ahmed
 
Guia de servicio al cliente
Guia de servicio al clienteGuia de servicio al cliente
Guia de servicio al clienteCamilo Sandoval
 

Viewers also liked (7)

Mbai itm u1.2 planning
Mbai  itm u1.2 planningMbai  itm u1.2 planning
Mbai itm u1.2 planning
 
cover letter for resume
cover letter for resumecover letter for resume
cover letter for resume
 
COURRIER CAB 31 MD
COURRIER CAB 31 MDCOURRIER CAB 31 MD
COURRIER CAB 31 MD
 
Prezi
PreziPrezi
Prezi
 
00251740510626254
0025174051062625400251740510626254
00251740510626254
 
Corporate social-and-financial-performance-an-extended-stakeholder-theory-and...
Corporate social-and-financial-performance-an-extended-stakeholder-theory-and...Corporate social-and-financial-performance-an-extended-stakeholder-theory-and...
Corporate social-and-financial-performance-an-extended-stakeholder-theory-and...
 
Guia de servicio al cliente
Guia de servicio al clienteGuia de servicio al cliente
Guia de servicio al cliente
 

Similar to 00-Review of Linux Basics

Operating Systems: File Management
Operating Systems: File ManagementOperating Systems: File Management
Operating Systems: File ManagementDamian T. Gordon
 
Operating Systems - File Management
Operating Systems -  File ManagementOperating Systems -  File Management
Operating Systems - File ManagementDamian T. Gordon
 
Devops for beginners
Devops for beginnersDevops for beginners
Devops for beginnersVivek Parihar
 
Lets make better scripts
Lets make better scriptsLets make better scripts
Lets make better scriptsMichael Boelen
 
$ filecount etcetc 153 ordinary 3 executable 7 links 124.docx
$ filecount etcetc  153 ordinary  3 executable  7 links  124.docx$ filecount etcetc  153 ordinary  3 executable  7 links  124.docx
$ filecount etcetc 153 ordinary 3 executable 7 links 124.docxmayank272369
 
Debugging Network Issues
Debugging Network IssuesDebugging Network Issues
Debugging Network IssuesApcera
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell ScriptingMustafa Qasim
 
Types of Linux Shells
Types of Linux Shells Types of Linux Shells
Types of Linux Shells BIT DURG
 
RHCSA EX200 - Summary
RHCSA EX200 - SummaryRHCSA EX200 - Summary
RHCSA EX200 - SummaryNugroho Gito
 
BITS: Introduction to Linux - Software installation the graphical and the co...
BITS: Introduction to Linux -  Software installation the graphical and the co...BITS: Introduction to Linux -  Software installation the graphical and the co...
BITS: Introduction to Linux - Software installation the graphical and the co...BITS
 
Linux basics part 1
Linux basics part 1Linux basics part 1
Linux basics part 1Lilesh Pathe
 
Introduction to the linux command line.pdf
Introduction to the linux command line.pdfIntroduction to the linux command line.pdf
Introduction to the linux command line.pdfCesleySCruz
 
Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)
Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)
Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)Chinthaka Deshapriya (RHCA)
 
55 best linux tips, tricks and command lines
55 best linux tips, tricks and command lines55 best linux tips, tricks and command lines
55 best linux tips, tricks and command linesArif Wahyudi
 
Comandos linux bash, f2 linux pesquisa, http://f2linux.wordpress.com
Comandos linux bash,  f2 linux pesquisa, http://f2linux.wordpress.comComandos linux bash,  f2 linux pesquisa, http://f2linux.wordpress.com
Comandos linux bash, f2 linux pesquisa, http://f2linux.wordpress.comWlademir RS
 

Similar to 00-Review of Linux Basics (20)

Operating Systems: File Management
Operating Systems: File ManagementOperating Systems: File Management
Operating Systems: File Management
 
Operating Systems - File Management
Operating Systems -  File ManagementOperating Systems -  File Management
Operating Systems - File Management
 
Devops for beginners
Devops for beginnersDevops for beginners
Devops for beginners
 
Linux
LinuxLinux
Linux
 
Lets make better scripts
Lets make better scriptsLets make better scripts
Lets make better scripts
 
$ filecount etcetc 153 ordinary 3 executable 7 links 124.docx
$ filecount etcetc  153 ordinary  3 executable  7 links  124.docx$ filecount etcetc  153 ordinary  3 executable  7 links  124.docx
$ filecount etcetc 153 ordinary 3 executable 7 links 124.docx
 
Unix Basics Commands
Unix Basics CommandsUnix Basics Commands
Unix Basics Commands
 
Debugging Network Issues
Debugging Network IssuesDebugging Network Issues
Debugging Network Issues
 
Unix Shell Scripting
Unix Shell ScriptingUnix Shell Scripting
Unix Shell Scripting
 
Types of Linux Shells
Types of Linux Shells Types of Linux Shells
Types of Linux Shells
 
RHCSA EX200 - Summary
RHCSA EX200 - SummaryRHCSA EX200 - Summary
RHCSA EX200 - Summary
 
BITS: Introduction to Linux - Software installation the graphical and the co...
BITS: Introduction to Linux -  Software installation the graphical and the co...BITS: Introduction to Linux -  Software installation the graphical and the co...
BITS: Introduction to Linux - Software installation the graphical and the co...
 
Linux basics part 1
Linux basics part 1Linux basics part 1
Linux basics part 1
 
Introduction to the linux command line.pdf
Introduction to the linux command line.pdfIntroduction to the linux command line.pdf
Introduction to the linux command line.pdf
 
Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)
Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)
Sa1 chapter-5-managing-local-linux-users-and-groups-v2 (4)
 
55 best linux tips, tricks and command lines
55 best linux tips, tricks and command lines55 best linux tips, tricks and command lines
55 best linux tips, tricks and command lines
 
Sandy Report
Sandy ReportSandy Report
Sandy Report
 
Sandy Report
Sandy ReportSandy Report
Sandy Report
 
lec2.docx
lec2.docxlec2.docx
lec2.docx
 
Comandos linux bash, f2 linux pesquisa, http://f2linux.wordpress.com
Comandos linux bash,  f2 linux pesquisa, http://f2linux.wordpress.comComandos linux bash,  f2 linux pesquisa, http://f2linux.wordpress.com
Comandos linux bash, f2 linux pesquisa, http://f2linux.wordpress.com
 

More from behrad eslamifar

108.3-Mail Transfer Agent(MTA) basics
108.3-Mail Transfer Agent(MTA) basics108.3-Mail Transfer Agent(MTA) basics
108.3-Mail Transfer Agent(MTA) basicsbehrad eslamifar
 
Chapter 14 - ensuring integrity and availability
Chapter 14 - ensuring integrity and availabilityChapter 14 - ensuring integrity and availability
Chapter 14 - ensuring integrity and availabilitybehrad eslamifar
 
Chapter 12 - network security
Chapter 12 - network securityChapter 12 - network security
Chapter 12 - network securitybehrad eslamifar
 
Chapter 11 - voice and video over ip
Chapter 11 - voice and video over ipChapter 11 - voice and video over ip
Chapter 11 - voice and video over ipbehrad eslamifar
 
Chapter 09 - network operating systems
Chapter 09 - network operating systemsChapter 09 - network operating systems
Chapter 09 - network operating systemsbehrad eslamifar
 
Chapter 08 - wireless networking
Chapter 08 - wireless networkingChapter 08 - wireless networking
Chapter 08 - wireless networkingbehrad eslamifar
 
Chapter 06 - network hardwares
Chapter 06 - network hardwaresChapter 06 - network hardwares
Chapter 06 - network hardwaresbehrad eslamifar
 
Chaoter 05 - topologies and ethernet standards
Chaoter 05 - topologies and ethernet standardsChaoter 05 - topologies and ethernet standards
Chaoter 05 - topologies and ethernet standardsbehrad eslamifar
 
Chapter 04 - introduction to tcpip protocols
Chapter 04 - introduction to tcpip protocolsChapter 04 - introduction to tcpip protocols
Chapter 04 - introduction to tcpip protocolsbehrad eslamifar
 
Chapter 07 - wa ns and remote connectivity
Chapter 07 - wa ns and remote connectivityChapter 07 - wa ns and remote connectivity
Chapter 07 - wa ns and remote connectivitybehrad eslamifar
 
Chapter 03 - Transmission basics and networking media
Chapter 03 - Transmission basics and networking mediaChapter 03 - Transmission basics and networking media
Chapter 03 - Transmission basics and networking mediabehrad eslamifar
 
Chapter02 - network standard and osi model
Chapter02 - network standard and osi modelChapter02 - network standard and osi model
Chapter02 - network standard and osi modelbehrad eslamifar
 
Chapter 01 - Introduction to Network+
Chapter 01 - Introduction to Network+Chapter 01 - Introduction to Network+
Chapter 01 - Introduction to Network+behrad eslamifar
 

More from behrad eslamifar (15)

320.1-Cryptography
320.1-Cryptography320.1-Cryptography
320.1-Cryptography
 
200.1,2-Capacity Planning
200.1,2-Capacity Planning200.1,2-Capacity Planning
200.1,2-Capacity Planning
 
108.3-Mail Transfer Agent(MTA) basics
108.3-Mail Transfer Agent(MTA) basics108.3-Mail Transfer Agent(MTA) basics
108.3-Mail Transfer Agent(MTA) basics
 
Chapter 14 - ensuring integrity and availability
Chapter 14 - ensuring integrity and availabilityChapter 14 - ensuring integrity and availability
Chapter 14 - ensuring integrity and availability
 
Chapter 12 - network security
Chapter 12 - network securityChapter 12 - network security
Chapter 12 - network security
 
Chapter 11 - voice and video over ip
Chapter 11 - voice and video over ipChapter 11 - voice and video over ip
Chapter 11 - voice and video over ip
 
Chapter 09 - network operating systems
Chapter 09 - network operating systemsChapter 09 - network operating systems
Chapter 09 - network operating systems
 
Chapter 08 - wireless networking
Chapter 08 - wireless networkingChapter 08 - wireless networking
Chapter 08 - wireless networking
 
Chapter 06 - network hardwares
Chapter 06 - network hardwaresChapter 06 - network hardwares
Chapter 06 - network hardwares
 
Chaoter 05 - topologies and ethernet standards
Chaoter 05 - topologies and ethernet standardsChaoter 05 - topologies and ethernet standards
Chaoter 05 - topologies and ethernet standards
 
Chapter 04 - introduction to tcpip protocols
Chapter 04 - introduction to tcpip protocolsChapter 04 - introduction to tcpip protocols
Chapter 04 - introduction to tcpip protocols
 
Chapter 07 - wa ns and remote connectivity
Chapter 07 - wa ns and remote connectivityChapter 07 - wa ns and remote connectivity
Chapter 07 - wa ns and remote connectivity
 
Chapter 03 - Transmission basics and networking media
Chapter 03 - Transmission basics and networking mediaChapter 03 - Transmission basics and networking media
Chapter 03 - Transmission basics and networking media
 
Chapter02 - network standard and osi model
Chapter02 - network standard and osi modelChapter02 - network standard and osi model
Chapter02 - network standard and osi model
 
Chapter 01 - Introduction to Network+
Chapter 01 - Introduction to Network+Chapter 01 - Introduction to Network+
Chapter 01 - Introduction to Network+
 

00-Review of Linux Basics

  • 1.
  • 3. 4 Key Knowledge Area ● Linux Directory Structure ● File Permissions and Security ● Common Linux Commands and Programs ● Working with Linux Shells ● Bash Shell Scripting
  • 5. 6 Navigating the Linux File System ● Change Directory # cd /home/user # cd .. # pwd /home # cd user/Downloads # cd /home/user # cd .. # pwd /home # cd user/Downloads
  • 6. 7 File Permissions and Security :‫شود‬ ‫می‬ ‫اعمال‬ ‫سطح‬ ‫سه‬ ‫در‬ ‫لینوکس‬ ‫فایل‬ ‫سیستم‬ ‫در‬ ‫دسترسی‬ ●) ‫کاربر‬user‫پوشه‬ ‫یا‬ ‫فایل‬ ‫مالک‬ ‫کاربر‬ : ( ●) ‫گروه‬group‫پوشه‬ ‫یا‬ ‫فایل‬ ‫مالک‬ ‫گروه‬ : ( ●) ‫دیگران‬other‫فایل‬ ‫مالک‬ ‫غیر‬ ‫به‬ ‫ها‬‫گروه‬ ‫و‬ ‫کاربران‬ : ( $ ls -l drwxr-xr-x 2 user user 4096 Oct 13 13:19 Desktop drwxr-xr-x 2 user user 4096 Oct 13 13:19 Documents drwxr-xr-x 2 user user 4096 Oct 13 13:19 Downloads drwxr-xr-x 2 user user 4096 Oct 13 13:19 Music $ ls -l drwxr-xr-x 2 user user 4096 Oct 13 13:19 Desktop drwxr-xr-x 2 user user 4096 Oct 13 13:19 Documents drwxr-xr-x 2 user user 4096 Oct 13 13:19 Downloads drwxr-xr-x 2 user user 4096 Oct 13 13:19 Music # umask 0022 # umask 0022
  • 7. 8 SETUID and SETGID ●SETUID ●‫را‬ ‫آن‬ ‫تواند‬‫می‬ ‫کاربری‬ ‫هر‬ ، ‫شود‬ ‫داده‬ ‫فایلی‬ ‫به‬ ‫مجوز‬ ‫این‬ ‫که‬ ‫صورتی‬ ‫در‬ :‫فایل‬ ‫روی‬ ‫بر‬ .‫کند‬ ‫اجرا‬ ‫فایل‬ ‫صاحب‬ ‫مجوز‬ ‫با‬ ●.‫ندارد‬ ‫اثری‬ ‫هیچ‬ ‫ها‬ ‫پوشه‬ ‫برای‬ ‫مجوز‬ ‫این‬ :‫پوشه‬ ‫روی‬ ‫بر‬ ●SETGID ●.‫کند‬ ‫اجرا‬ ‫گروه‬ ‫مجوز‬ ‫با‬ ‫را‬ ‫فایل‬ ‫تواند‬‫می‬ ‫کاربری‬ ‫هر‬ :‫فایل‬ ‫روی‬ ‫بر‬ ●‫خواهد‬ ‫مالک‬ ‫گروه‬ ‫مالکیت‬ ‫در‬ ‫پوشه‬ ‫در‬ ‫شده‬ ‫ساخته‬ ‫جدید‬ ‫فایل‬ ‫هر‬ :‫پوشه‬ ‫روی‬ ‫بر‬ ‫صورت‬ ‫به‬ ‫کاربران‬ ‫که‬ ‫هایی‬ ‫پوشه‬ ‫در‬ ‫استفاده‬ ‫برای‬ .‫فایل‬ ‫سازنده‬ ‫گروه‬ ‫نه‬ ‫و‬ ‫بود‬ ‫است‬ ‫مناسب‬ ‫کنند‬‫می‬ ‫کار‬ ‫مشترک‬
  • 8. 9 File Security Attributes ● lsattr and chattr a : append only c : compressed d : no dump e : extent format i : immutable j : data journalling s : secure deletion t : no tail-merging u : undeletable A : no atime updates C : no copy on write D : synchronous directory updates S : synchronous updates T : top of directory hierarchy a : append only c : compressed d : no dump e : extent format i : immutable j : data journalling s : secure deletion t : no tail-merging u : undeletable A : no atime updates C : no copy on write D : synchronous directory updates S : synchronous updates T : top of directory hierarchy # chattr +i /path/to/file# chattr +i /path/to/file
  • 9. 10 Manipulating Files and Directories Work with file rm cp rmdir mkdir mv File and Dir cd ls Home Dir Tiled ~ .and..
  • 10. 11 Viewing and Searching Files Search find locate grep head,tail which
  • 11. 12 Environment and Shell Variables ● Shell Variables ● Enviroment Variables # unset varname# unset varname # varname=value# varname=value # export varname=value# export varname=value # echo $varname# echo $varname
  • 12. 13 Bash Shell Scripting ● She Bang $ vi helloworld.sh #!/bin/bash var=oracle echo $var $ vi helloworld.sh #!/bin/bash var=oracle echo $var
  • 13. 14 Bash Shell Scripting: Conditions ● Conditions test expression [ expression ] help test test expression [ expression ] help test if [ expression ] then commands elif [ expression ] then commands else commands fi if [ expression ] then commands elif [ expression ] then commands else commands fi
  • 14. 15 Bash Shell Scripting: case ●‫گزینه‬ ‫چندین‬ ‫انتخاب‬ case $variable in 1 ) echo "You entered one” ;; 2 ) echo "You entered two ;; 3 ) echo "You entered three” ;; * ) echo "You did not enter a number” echo "between 1 and 3” esac case $variable in 1 ) echo "You entered one” ;; 2 ) echo "You entered two ;; 3 ) echo "You entered three” ;; * ) echo "You did not enter a number” echo "between 1 and 3” esac
  • 15. 16 Bash Shell Scripting: while ●‫است‬ ‫درست‬ ‫شرط‬ ‫که‬ ‫تازمانی‬ while [ test ] do commands done while [ test ] do commands done
  • 16. 17 Bash Shell Scripting: In-List Syntax of for for I in list do commands done for I in list do commands done for I in /path/to/* do commands to $I done for I in /path/to/* do commands to $I done
  • 17. 18 Bash Shell Scripting: Controlled Loop Syntax of for for (( c=1; c<=5; c++ )) do commands done for (( c=1; c<=5; c++ )) do commands done for I in {start..end..step} do commands done for I in {start..end..step} do commands done