A chmod is used to change permission of files and directories.
- form: chmod [options] permissions filename
can be represented in two ways.
- Alphabetic combination
- Numeric combination
- a: All people
- u: owner
- g: group
- o: others
- r: read
- w: write
- x: execute
- chmod u=rwx practice.txt : Owner gets all permissions on practice.txt.
- chmod g-w practice.txt : Group’s write permission on practice.txt is removed.
- chmod o+rx practice.txt : Others get additional read and execute permissions.
- chmod a=rwx practice.txt : All people get all permissions.
- 4: read
- 2: write
- 1: execute
- chmod 755 practice.txt : owner gets all permission. Group and others get read and execute permission.
- chmod 777 practice.txt : All people get all the permissions.