Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
Niidae Wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Chmod
(section)
Page
Discussion
English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
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.
Anti-spam check. Do
not
fill this in!
==Examples== <!-- Please keep meaningful names and use examples that someone might want. DGerman And remember: less is more. KISS --> Add '''w'''rite permission to the '''g'''roup class of a directory, allowing users in the same group to add files: <syntaxhighlight lang="console" highlight="3"> $ ls -ld dir # before drwxr-xr-x 2 jsmitt northregion 96 Apr 8 12:53 shared_dir $ chmod g+w dir $ ls -ld dir # after drwxrwxr-x 2 jsmitt northregion 96 Apr 8 12:53 shared_dir </syntaxhighlight> Remove '''w'''rite permission for '''a'''ll classes, preventing anyone from writing to the file: <syntaxhighlight lang="console" highlight="3"> $ ls -l ourBestReferenceFile -rw-rw-r-- 2 tmiller northregion 96 Apr 8 12:53 ourBestReferenceFile $ chmod a-w ourBestReferenceFile $ ls -l ourBestReferenceFile -r--r--r-- 2 tmiller northregion 96 Apr 8 12:53 ourBestReferenceFile </syntaxhighlight> Set the permissions for the '''u'''ser and '''g'''roup classes to '''r'''ead and e'''x'''ecute only; no '''w'''rite permission; preventing anyone from adding files: <syntaxhighlight lang="console" highlight="3"> $ ls -ld referenceLib drwxr----- 2 ebowman northregion 96 Apr 8 12:53 referenceLib $ chmod ug=rx referenceLib $ ls -ld referenceLib dr-xr-x--- 2 ebowman northregion 96 Apr 8 12:53 referenceLib </syntaxhighlight> Enable '''w'''rite for the '''u'''ser class while making it '''r'''ead-only for '''g'''roup and others: <syntaxhighlight lang="console"> $ chmod u=rw,go=r sample $ ls -ld sample drw-r--r-- 2 oschultz warehousing 96 Dec 8 12:53 sample </syntaxhighlight> To recursively set access for the directory '''docs/''' and its contained files: <code>chmod -R u+w docs/</code> To set user and group for read and write only and set others for read only: <code>chmod 664 file</code> To set user for read, write, and execute only and group and others for read only: <code>chmod 744 file</code> To set the sticky bit in addition to user, group and others permissions: <code>chmod 1755 file</code> To set UID in addition to user, group and others permissions: <code>chmod 4755 file</code> To set GID in addition to user, group and others permissions: <code>chmod 2755 file</code>
Summary:
Please note that all contributions to Niidae Wiki 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
Encyclopedia:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Chmod
(section)
Add topic