feed-image  Delivered by FeedBurner  ISSN 1836-5930





Visitors Online

We have 53 guests online

Poll

Which of following tutorials would you like to see on the Linuxconfig.org?
 
Partner Linux Sites
TuxMachines
DebianAdmin
Monsterb
LinuxBloggers
AdamsInfo
LinuxScrew
FreeSoftwareLinux
Jam's Ubuntu Blog
All For Linux

chmod
Article Index
1. Name
2. Synopsis
3. Frequently used options
4. Basics
5. Examples
5.1. Octal Mode
5.2. Symbolic Specification

1. Name

chmod [man page] - change file access permissions

2. Synopsis

chmod [OPTION]... MODE[,MODE]... FILE...
chmod [OPTION]... OCTAL-MODE FILE...
chmod [OPTION]... --reference=RFILE FILE...

3. Frequently used options

-R, --recursive
change files and directories recursively
-c, --changes
like verbose but report only when a change is made
-v, --verbose
output a diagnostic for every file processed

4. Basics

  • r : read (user can read the file, or list a given directory)
  • w : write (user can write to the file, or create file or directory in the directory)
  • x : execute (user can execute the file, or enter directory)
$ ls -ld dir/ 
show directory permitions
chmod octal and symbolic guide

5. Examples

5.1. Octal Mode

Lets see how we can change file.txt permissions to rwxr-xr-- with octal mode:
$ chmod 764 file.txt 
use octal chmod to change file permitions

5.2. Symbolic Specification

Lets see how we can change file.txt permissions to rwxr-xr-- with symbolic specification:
$ chmod u=rwx,g=rx,o=r file.txt 
use symbolic chmod to change file permitions