Chmod: Difference between revisions

From Hackepedia
Jump to navigationJump to search
m New page: Change the mode of a file or filesystem object. You can use a human readable format or the octal permission modes. chmod 755 directory chmod u+s file chmod +x script.sh See the manua...
 
No edit summary
 
(3 intermediate revisions by one other user not shown)
Line 1: Line 1:
Change the mode of a file or filesystem object.  You can use a human readable format or the octal 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


See the manual page of chmod to find further information.
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.

Latest revision as of 00: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.