Editing Chmod

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
{{lowercase}}
 
 
[[wikipedia:chmod]] command is used to change the access permissions including special mode flags ([[sticky]]) of [[files]] and [[directories]]
 
[[wikipedia:chmod]] command is used to change the access permissions including special mode flags ([[sticky]]) of [[files]] and [[directories]]
 
 
* [[400]] user read only
 
* [[600]] user read and write only
 
* [[0644]]
 
  
 
== chmod examples ==
 
== chmod examples ==
Line 14: Line 8:
  
 
<code>[[wikipedia:chmod|chmod]] ug+s /path/to/file.txt</code>
 
<code>[[wikipedia:chmod|chmod]] ug+s /path/to/file.txt</code>
 +
<pre>
 +
Before:
 +
ls -la file.txt
 +
-rwxr-xr-x  1 root        root    31 Nov 27 11:34 file.txt
 +
 +
stat file.txt
 +
  File: file.txt
 +
  Size: 31        Blocks: 8          IO Block: 4096  regular file
 +
Device: fd00h/64768d Inode: 13          Links: 1
 +
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)  Gid: (    0/    root)
 +
Access: 2019-11-27 11:34:54.610196393 +0400
 +
Modify: 2019-11-27 11:34:49.662193415 +0400
 +
Change: 2019-11-27 11:34:49.666193418 +0400
 +
Birth: -
  
Before:
+
chmod ug+s file.txt
ls -la file.txt
+
 
-rwxr-xr-x  1 root        root    31 Nov 27 11:34 file.txt
+
After:
+
ls -la file.txt
[[stat]] file.txt
+
-rwsr-sr-x 1 root root 31 Nov 27 11:34 file.txt
  File: file.txt
 
  Size: 31        Blocks: 8          IO Block: 4096  regular file
 
Device: fd00h/64768d Inode: 13          Links: 1
 
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)  Gid: (    0/    root)
 
Access: 2019-11-27 11:34:54.610196393 +0400
 
Modify: 2019-11-27 11:34:49.662193415 +0400
 
Change: 2019-11-27 11:34:49.666193418 +0400
 
  Birth: -
 
 
chmod ug+s file.txt  
 
 
After:
 
ls -la file.txt
 
-rwsr-sr-x 1 root root 31 Nov 27 11:34 file.txt  
 
  
<pre>
 
 
stat file.txt
 
stat file.txt
 
   File: file.txt
 
   File: file.txt
Line 50: Line 43:
 
* [[Sticky bit]]
 
* [[Sticky bit]]
 
* [[0644]]
 
* [[0644]]
* [[0600]]
 
* [[0755]]
 
* [[install -m]]
 
* [[Permissions are to open]]
 
  
 
== See also ==
 
== See also ==
* {{chmod}}
 
 
* {{UID}}
 
* {{UID}}
 
* {{Linux Commands privileges}}
 
* {{Linux Commands privileges}}

Please note that all contributions to wikieduonline may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Wikieduonline:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)

Advertising: