Difference between revisions of "Chmod"

From wikieduonline
Jump to navigation Jump to search
Tags: Mobile web edit, Mobile edit
Line 8: 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
+
Before:
  File: file.txt
+
ls -la file.txt
  Size: 31        Blocks: 8          IO Block: 4096  regular file
+
-rwxr-xr-x  1 root        root    31 Nov 27 11:34 file.txt
Device: fd00h/64768d Inode: 13          Links: 1
+
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)  Gid: (    0/    root)
+
[[stat]] file.txt
Access: 2019-11-27 11:34:54.610196393 +0400
+
  File: file.txt
Modify: 2019-11-27 11:34:49.662193415 +0400
+
  Size: 31        Blocks: 8          IO Block: 4096  regular file
Change: 2019-11-27 11:34:49.666193418 +0400
+
Device: fd00h/64768d Inode: 13          Links: 1
Birth: -
+
Access: (0755/-rwxr-xr-x)  Uid: (    0/    root)  Gid: (    0/    root)
 
+
Access: 2019-11-27 11:34:54.610196393 +0400
chmod ug+s file.txt
+
Modify: 2019-11-27 11:34:49.662193415 +0400
 
+
Change: 2019-11-27 11:34:49.666193418 +0400
After:
+
  Birth: -
ls -la file.txt
+
-rwsr-sr-x 1 root root 31 Nov 27 11:34 file.txt
+
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

Revision as of 03:58, 16 August 2021

wikipedia:chmod command is used to change the access permissions including special mode flags (sticky) of files and directories

chmod examples

chmod ug+s /path/to/file.txt

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: -

chmod ug+s file.txt 

After:
ls -la file.txt
-rwsr-sr-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: (6755/-rwsr-sr-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 12:11:20.637362248 +0400

Birth: -

Related terms

See also

Advertising: