Difference between revisions of "Chmod"

From Hackepedia
Jump to navigationJump to search
m
 
Line 1: Line 1:
 
Change the mode of a [[file]] or [[filesystem]] object.  You can use a human readable format or the octal [[permissions|permission]] modes.
 
Change the mode of a [[file]] or [[filesystem]] object.  You can use a human readable format or the octal [[permissions|permission]] modes.
  
  chmod 755 directory
+
  $ chmod 755 [[Variables|$directory]]
  chmod u+s file
+
  $ ls -lad [[Variables|$directory]]
  chmod +x script.sh
+
drwxr-xr-x 2 frank staff 4096 2008-05-28 00:57 wtf
 +
 
 +
This has made the $directory read, write and executable to the owner (frank in this case), read and executable to the group (staff in this case) and read and execute to the 'world' (all other users who can access this file).
 +
 
 +
$ chmod u+s [[Variables|$file]]
 +
  $ chmod +x [[Variables|$script.sh]]
 +
 
 +
This makes script.sh executable.
  
 
See the [[manual]] page of chmod to find further information.
 
See the [[manual]] page of chmod to find further information.

Latest revision as of 01:00, 28 May 2008

Change the mode of a file or filesystem object. You can use a human readable format or the octal permission modes.

$ chmod 755 $directory
$ ls -lad $directory
drwxr-xr-x 2 frank staff 4096 2008-05-28 00:57 wtf

This has made the $directory read, write and executable to the owner (frank in this case), read and executable to the group (staff in this case) and read and execute to the 'world' (all other users who can access this file).

$ chmod u+s $file
$ chmod +x $script.sh

This makes script.sh executable.

See the manual page of chmod to find further information.