Assignment 3 - Copy
Assignment 3 - Copy
Apply the permission change recursively to all the files and directories
`-R` within the specified directory.
It will display a message for each file that is processed. while indicating the
`-v` permission change that was made.
It works same as `-v` but in this case it only displays messages for files
`-c` whose permission is changed.
`-h` Change the permissions of symbolic links instead of the files they point to.
u Owner
g Group
o Others
Reference Class
a All (owner,groups,others)
Read and write for Owner, and Read-only for the group and
other:
chmod u+rw,go+r [file_name]
2) Octal mode
It is also a method for specifying permissions. In this method we
specify permission using three-digit number. Where..
First digit specify the permission for Owner.
Second digit specify the permission for Group.
Third digit specify the permission for Others. The digits
NOTE: The digits are calculated by adding the values of the
individual permissions.
Value Permission
4 Read Permission
2 Write Permission
1 Execute Permission
Here.
6 represent permission of file Owner which are (rw).
7 represent permission of Group which are (rwx).
4 represent permission of Other which is (r).
Practical Implementaion of How to Make
script executable in Linux
Understanding Script Execution in Linux
In Linux, scripts are typically written in languages like Bash,
Python, or Perl. While the script’s content is crucial, ensuring it
has executable permissions is equally important. Without
execution permissions, Linux won’t allow the script to run.
Step 1: Navigate to the Script’s Directory
Open the terminal and use the cd command to navigate to the
directory where your script is located.
For example:
cd /path/to/your/script
Step 2: Check Current Permissions
Use the `ls` command with the `-l` option to list the files in the
directory along with their permissions. This step helps you identify
the current permissions of your script:
ls -l
This notation tells Linux to look in the current directory ( .) for the
script named example.sh.