SlideShare a Scribd company logo
1 of 13
Unix Shell Programming
Outline
 Revision
 Simple Filter Commands
 Filter Using Regular Expression
 Redirection of Standard Input and Output
 File and Directory Access Modes
 Changing the File Permission
Priti Patel 2/20/2024
2
Redirection of Standard Input and Output
Terminal: In context of redirection the terminal is generic
name that represents the screen, display or keyboard.
Command output and error message on terminal (Display).
Provides commands input through terminal (keyboard).
When user logs in , the shell makes available three files
representing three streams.
Standard Input- The file (or Stream) for input
Standard Output- The file(or Stream) for output
Standard Error- for Error message. Connected to display.
Priti Patel 2/20/2024
3
Redirection of Standard Input and Output
Standard Input: The input of a command be redirected
from a file.
The less-than character < is used to redirect the input of
a command.
case1: wc –l users
case2: wc -l < users
Difference In the first case, wc knows that it is reading
its input from the file users.
 In the second case, it only knows that it is reading its
input from standard input so it does not display file
name.
Priti Patel 2/20/2024
4
Redirection of Standard Input and Output
Standard Output: If the notation > file is appended to
any command that normally writes its output to standard
output, the output of that command will be written to file
instead of your terminal.
You can use >> operator to append the output in an
existing file.
For Eg: cut –d “ “ –f 2 1.txt > std_out
Priti Patel 2/20/2024
5
Redirection of Standard Input and Output
Standard Error: The three standard files are
represented by a number called a file descriptor.
The kernel maintains a table of file descriptor for every
process running in the system.
Three standard streams are :
 0-Standard input
1- Standard output
2- Standard error
The descriptor are implicitly prefixed to the redirection
symbols.
Priti Patel 2/20/2024
6
Redirection of Standard Input and Output
< , 0< and > ,1> mean same.
Standard error : Enter incorrect command or try to open
nonexistent file, certain diagnostic message show up the
screen.
For Eg.
Cat test > errorfile is incorrect
Cat test 2> errorfile is correct
tty: Knowing your terminal
UNIX treats terminal as a files.
One who wants to know about filename of the terminal you
are using.
tty (teletype)command
Syntax: $tty
Priti Patel 2/20/2024
7
File Access Mode
The permissions of a file are the first line of defense in the
security of a Unix system. The basic building blocks of Unix
permissions are the read, write, and execute permissions,
which are described below −
1. Read
Grants the capability to read ie. view the contents of the file.
2. Write
Grants the capability to modify, or remove the content of the
file.
3. Execute
User with execute permissions can run a file as a program.
Priti Patel 2/20/2024
8
Directory Access Mode
 Directory access modes are listed and organized in the same
manner as any other file. There are a few differences that need to
be mentioned:
1. Read
 Access to a directory means that the user can read the contents.
The user can look at the filenames inside the directory.
2. Write
 Access means that the user can add or delete files to the contents
of the directory.
3. Execute
 Executing a directory doesn't really make a lot of sense so think
of this as a traverse permission.
 A user must have execute access to the bin directory in order to
execute ls or cd command.
Priti Patel 2/20/2024
9
Changing The File Permission - chmod
When system administrator creates user account, he has to
assign these parameters to the user:
The user-id : both its name and numeric number
The group-id: both its name and numeric number
Chmod command sets the permission of one or more
files for all the categories of users.
The command can be used in two manners:
Relative Manner –By specifying changes to the current
permission
Absolute Manner- By Specifying the final permission
Priti Patel 2/20/2024
10
Relative Permission
Here it only changes the permissions specified in command
line & leaves other permissions unchanged.
Syntax: chmod category operation permission filename
Chmod takes as arguments an expression comprising some
letters & symbols that describe the user category & type of
permission being assigned or removed.
User category (user, group, others)
Operation means remove or assign permissions
Type of permission (read, write, execute)
Priti Patel 2/20/2024
11
Relative Permission
Chmod u+x temp.txt
Chmod ugo+x temp.txt
Chmod u+x temp.txt temp1 temp2
Chmod a+x temp.txt
Chmod +x temp.txt
Chmod u-r temp.txt
Chmod a-x,go+r temp.txt
Priti Patel 2/20/2024
12
Relative Permission
Abbreviation Used by chmod
Priti Patel 2/20/2024
13
Category Operation Permission
u – User + Assign Permission r – Read Permission
g – Group - Removes Permission w – Write
Permission
o – Others = Assign absolute Permission x – Execute
Permission
a – All(ugo)

More Related Content

Similar to Linux Operating System. Unix_Lec-6.pptx

Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Scriptsbmguys
 
Linux file commands and shell scripts
Linux file commands and shell scriptsLinux file commands and shell scripts
Linux file commands and shell scriptsPrashantTechment
 
101 4.5 manage file permissions and ownership v3
101 4.5 manage file permissions and ownership v3101 4.5 manage file permissions and ownership v3
101 4.5 manage file permissions and ownership v3Acácio Oliveira
 
Linux practicals T.Y.B.ScIT
Linux practicals T.Y.B.ScITLinux practicals T.Y.B.ScIT
Linux practicals T.Y.B.ScITvignesh0009
 
Linux introductory-course-day-1
Linux introductory-course-day-1Linux introductory-course-day-1
Linux introductory-course-day-1Julio Pulido
 
FILE PERMISSION OR ACCESS MODE
 FILE PERMISSION OR ACCESS MODE FILE PERMISSION OR ACCESS MODE
FILE PERMISSION OR ACCESS MODEVpmv
 
Introduction 2 linux
Introduction 2 linuxIntroduction 2 linux
Introduction 2 linuxPapu Kumar
 
4.5 manage file permissions and ownership v3
4.5 manage file permissions and ownership v34.5 manage file permissions and ownership v3
4.5 manage file permissions and ownership v3Acácio Oliveira
 
Unix.system.calls
Unix.system.callsUnix.system.calls
Unix.system.callsGRajendra
 
101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filtersAcácio Oliveira
 
101 3.4 use streams, pipes and redirects v2
101 3.4 use streams, pipes and redirects v2101 3.4 use streams, pipes and redirects v2
101 3.4 use streams, pipes and redirects v2Acácio Oliveira
 
intro unix/linux 09
intro unix/linux 09intro unix/linux 09
intro unix/linux 09duquoi
 

Similar to Linux Operating System. Unix_Lec-6.pptx (20)

Unix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell ScriptUnix/Linux Basic Commands and Shell Script
Unix/Linux Basic Commands and Shell Script
 
Linux file commands and shell scripts
Linux file commands and shell scriptsLinux file commands and shell scripts
Linux file commands and shell scripts
 
101 4.5 manage file permissions and ownership v3
101 4.5 manage file permissions and ownership v3101 4.5 manage file permissions and ownership v3
101 4.5 manage file permissions and ownership v3
 
Linux practicals T.Y.B.ScIT
Linux practicals T.Y.B.ScITLinux practicals T.Y.B.ScIT
Linux practicals T.Y.B.ScIT
 
OS Unit IV.ppt
OS Unit IV.pptOS Unit IV.ppt
OS Unit IV.ppt
 
Linux introductory-course-day-1
Linux introductory-course-day-1Linux introductory-course-day-1
Linux introductory-course-day-1
 
FILE PERMISSION OR ACCESS MODE
 FILE PERMISSION OR ACCESS MODE FILE PERMISSION OR ACCESS MODE
FILE PERMISSION OR ACCESS MODE
 
prateekporwal
prateekporwalprateekporwal
prateekporwal
 
Introduction 2 linux
Introduction 2 linuxIntroduction 2 linux
Introduction 2 linux
 
4.5 manage file permissions and ownership v3
4.5 manage file permissions and ownership v34.5 manage file permissions and ownership v3
4.5 manage file permissions and ownership v3
 
Unix-module3.pptx
Unix-module3.pptxUnix-module3.pptx
Unix-module3.pptx
 
App A
App AApp A
App A
 
Host security
Host securityHost security
Host security
 
Host security
Host securityHost security
Host security
 
Unix.system.calls
Unix.system.callsUnix.system.calls
Unix.system.calls
 
Linux 4 you
Linux 4 youLinux 4 you
Linux 4 you
 
101 3.2 process text streams using filters
101 3.2 process text streams using filters101 3.2 process text streams using filters
101 3.2 process text streams using filters
 
101 3.4 use streams, pipes and redirects v2
101 3.4 use streams, pipes and redirects v2101 3.4 use streams, pipes and redirects v2
101 3.4 use streams, pipes and redirects v2
 
intro unix/linux 09
intro unix/linux 09intro unix/linux 09
intro unix/linux 09
 
DFSNov1.pptx
DFSNov1.pptxDFSNov1.pptx
DFSNov1.pptx
 

Recently uploaded

The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCall Girls in Nagpur High Profile
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordAsst.prof M.Gokilavani
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxupamatechverse
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...ranjana rawat
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escortsranjana rawat
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSSIVASHANKAR N
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Christo Ananth
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSISrknatarajan
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxupamatechverse
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxupamatechverse
 

Recently uploaded (20)

The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service NashikCollege Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
College Call Girls Nashik Nehal 7001305949 Independent Escort Service Nashik
 
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANVI) Koregaon Park Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete RecordCCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
CCS335 _ Neural Networks and Deep Learning Laboratory_Lab Complete Record
 
Introduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptxIntroduction to IEEE STANDARDS and its different types.pptx
Introduction to IEEE STANDARDS and its different types.pptx
 
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
Call Girls in Nagpur Suman Call 7001035870 Meet With Nagpur Escorts
 
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(PRIYA) Rajgurunagar Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
(ANJALI) Dange Chowk Call Girls Just Call 7001035870 [ Cash on Delivery ] Pun...
 
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur EscortsHigh Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
High Profile Call Girls Nagpur Isha Call 7001035870 Meet With Nagpur Escorts
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Grishma Call 7001035870 Meet With Nagpur Escorts
 
Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLSMANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
MANUFACTURING PROCESS-II UNIT-5 NC MACHINE TOOLS
 
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
Call for Papers - Educational Administration: Theory and Practice, E-ISSN: 21...
 
UNIT-III FMM. DIMENSIONAL ANALYSIS
UNIT-III FMM.        DIMENSIONAL ANALYSISUNIT-III FMM.        DIMENSIONAL ANALYSIS
UNIT-III FMM. DIMENSIONAL ANALYSIS
 
Introduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptxIntroduction and different types of Ethernet.pptx
Introduction and different types of Ethernet.pptx
 
Introduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptxIntroduction to Multiple Access Protocol.pptx
Introduction to Multiple Access Protocol.pptx
 

Linux Operating System. Unix_Lec-6.pptx

  • 2. Outline  Revision  Simple Filter Commands  Filter Using Regular Expression  Redirection of Standard Input and Output  File and Directory Access Modes  Changing the File Permission Priti Patel 2/20/2024 2
  • 3. Redirection of Standard Input and Output Terminal: In context of redirection the terminal is generic name that represents the screen, display or keyboard. Command output and error message on terminal (Display). Provides commands input through terminal (keyboard). When user logs in , the shell makes available three files representing three streams. Standard Input- The file (or Stream) for input Standard Output- The file(or Stream) for output Standard Error- for Error message. Connected to display. Priti Patel 2/20/2024 3
  • 4. Redirection of Standard Input and Output Standard Input: The input of a command be redirected from a file. The less-than character < is used to redirect the input of a command. case1: wc –l users case2: wc -l < users Difference In the first case, wc knows that it is reading its input from the file users.  In the second case, it only knows that it is reading its input from standard input so it does not display file name. Priti Patel 2/20/2024 4
  • 5. Redirection of Standard Input and Output Standard Output: If the notation > file is appended to any command that normally writes its output to standard output, the output of that command will be written to file instead of your terminal. You can use >> operator to append the output in an existing file. For Eg: cut –d “ “ –f 2 1.txt > std_out Priti Patel 2/20/2024 5
  • 6. Redirection of Standard Input and Output Standard Error: The three standard files are represented by a number called a file descriptor. The kernel maintains a table of file descriptor for every process running in the system. Three standard streams are :  0-Standard input 1- Standard output 2- Standard error The descriptor are implicitly prefixed to the redirection symbols. Priti Patel 2/20/2024 6
  • 7. Redirection of Standard Input and Output < , 0< and > ,1> mean same. Standard error : Enter incorrect command or try to open nonexistent file, certain diagnostic message show up the screen. For Eg. Cat test > errorfile is incorrect Cat test 2> errorfile is correct tty: Knowing your terminal UNIX treats terminal as a files. One who wants to know about filename of the terminal you are using. tty (teletype)command Syntax: $tty Priti Patel 2/20/2024 7
  • 8. File Access Mode The permissions of a file are the first line of defense in the security of a Unix system. The basic building blocks of Unix permissions are the read, write, and execute permissions, which are described below − 1. Read Grants the capability to read ie. view the contents of the file. 2. Write Grants the capability to modify, or remove the content of the file. 3. Execute User with execute permissions can run a file as a program. Priti Patel 2/20/2024 8
  • 9. Directory Access Mode  Directory access modes are listed and organized in the same manner as any other file. There are a few differences that need to be mentioned: 1. Read  Access to a directory means that the user can read the contents. The user can look at the filenames inside the directory. 2. Write  Access means that the user can add or delete files to the contents of the directory. 3. Execute  Executing a directory doesn't really make a lot of sense so think of this as a traverse permission.  A user must have execute access to the bin directory in order to execute ls or cd command. Priti Patel 2/20/2024 9
  • 10. Changing The File Permission - chmod When system administrator creates user account, he has to assign these parameters to the user: The user-id : both its name and numeric number The group-id: both its name and numeric number Chmod command sets the permission of one or more files for all the categories of users. The command can be used in two manners: Relative Manner –By specifying changes to the current permission Absolute Manner- By Specifying the final permission Priti Patel 2/20/2024 10
  • 11. Relative Permission Here it only changes the permissions specified in command line & leaves other permissions unchanged. Syntax: chmod category operation permission filename Chmod takes as arguments an expression comprising some letters & symbols that describe the user category & type of permission being assigned or removed. User category (user, group, others) Operation means remove or assign permissions Type of permission (read, write, execute) Priti Patel 2/20/2024 11
  • 12. Relative Permission Chmod u+x temp.txt Chmod ugo+x temp.txt Chmod u+x temp.txt temp1 temp2 Chmod a+x temp.txt Chmod +x temp.txt Chmod u-r temp.txt Chmod a-x,go+r temp.txt Priti Patel 2/20/2024 12
  • 13. Relative Permission Abbreviation Used by chmod Priti Patel 2/20/2024 13 Category Operation Permission u – User + Assign Permission r – Read Permission g – Group - Removes Permission w – Write Permission o – Others = Assign absolute Permission x – Execute Permission a – All(ugo)