ITEC3116 SNAL Lecture 10 File Permission

Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 16

System and Network

Administration Linux based

ITEC 3116
File Permissions in Linux
Recap of the previous Lecture
 Practically Execute Linux Commands by
using Ubuntu Terminal
 List of Files & Folders
 Hidden Files
 Detail of Current directory
 How you can create Files
Agenda for Today’s Class
 File Permission in Linux

 Basic Unix/Linux Commands


continued…
 Assign Permission to the users
i.e. U, GU, O
 Practically Demonstration of
Linux commands (LAB)
Moving and Re-naming files

 To move a file, use the command


 mv filename new_file_location
 Suppose we want to move the file
“SNAL-2020" to location
/home/drhafizad/Desktop. Executing
the command
How you can create
Directory?

 Directories can be created on a Linux


operating system using the following
‘mkdir’
 This command will create a
subdirectory in your present working
directory, which is usually your
"Home Directory".
 For example,
 mkdir HelloWorld
The History Command

 History command shows all the


commands that you have used in the
past for the current terminal session.
 This also can help you refer to the old
commands you have entered and re-
used them in your operations again.
The clear Command

 This command clears all the mess on


the terminal and gives you a clean
window to work on, just like when
you launch the terminal.
How can we Change file/directory
permissions?

'chmod' command
 We can use the 'chmod' command
which stands for 'change mode’.
 By Using this command, we can set
permissions (read, write, execute) on a
file/directory for the owner, group and
the world. Syntax:
 Chmod permission filename
How many ways to express
permissions in Linux?

 There are 2 ways to use the


command :

 Absolute mode
 Symbolic mode
Absolute Mode

 Absolute Mode/Numeric Mode

 In this mode, permissions are not


represented as characters but a three-
digit octal number.
 Octal Number?
Absolute Mode…

Number Permission Type Symbol


0 No Permission ---
1 Execute --x
2 Write -w-
3 Execute + Write -wx
4 Read r--
5 Read + Execute r-x
6 Read +Write rw-
7 Read + Write rwx
+Execute
Absolute Mode…

 How you can change the Permission


of file/folders?
 For Example, we want to change the
permissions of the file RedHat to
'764'.
Absolute code

'764' absolute code says the following:


 Owner can read, write and execute
 Usergroup can read and write
 World can only read

 This is shown as '-rwxrw-r-This is how you can


change the permissions on file by assigning an
absolute number.
 Lecture End

You might also like