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: | ||
− | |||
[[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]] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
== chmod examples == | == chmod examples == | ||
Line 11: | Line 5: | ||
* <code>chmod a+x /path/to/file.txt</code> | * <code>chmod a+x /path/to/file.txt</code> | ||
* <code>chmod og-r ~/.ssh/[[authorized_keys]]</code> | * <code>chmod og-r ~/.ssh/[[authorized_keys]]</code> | ||
− | * <code> chmod og-rxw ~ | + | * <code> chmod og-rxw ~/.ssh</code> |
<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: - | |
− | + | ||
− | + | 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 | stat file.txt | ||
File: file.txt | File: file.txt | ||
Line 49: | Line 42: | ||
== Related terms == | == Related terms == | ||
* [[Sticky bit]] | * [[Sticky bit]] | ||
− | |||
− | |||
− | |||
− | |||
− | |||
== See also == | == See also == | ||
− | |||
* {{UID}} | * {{UID}} | ||
* {{Linux Commands privileges}} | * {{Linux Commands privileges}} |
Advertising: