Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- To manage file or directory permission:
- To see files and directories:
- ls
- To see files and directories (With details):
- ls -l
- chmod = Change mode or permission of any file or directory
- r = Read
- w = Write
- x = Execute
- l = Link/Symbolic link/Symlink (Related or a shortcut of any other file or directory)
- d = Directory (Represent directory)
- D = Door (Not common on Linux systems, but has been ported)
- u = User
- g = Group
- o = Others
- WITH WRITE AND EXECUTE PERMISSIONS AND WITHOUT READ PERMISSIONS:
- --wx-wx-wx = Represents write and execute permission of a file (With owner, group, and others permissions)
- d-wx-wx-wx = Represents write and execute permission of a directory (With owner, group, and others permissions)
- l-wx-wx-wx = Represents write and execute permission of a file or directory related or a shortcut of any other file or directory (With owner, group, and others permissions)
- WITH READ AND EXECUTE PERMISSIONS AND WITHOUT WRITE PERMISSIONS:
- -r-xr-xr-x = Represents read and execute permission of a file (With owner, group, and others permissions)
- dr-xr-xr-x = Represents read and execute permission of a directory (With owner, group, and others permissions)
- lr-xr-xr-x = Represents read and execute permission of a file or directory related or a shortcut of any other file or directory (With owner, group, and others permissions)
- WITH READ AND WRITE PERMISSIONS AND WITHOUT EXECUTE PERMISSIONS:
- -rw-rw-rw- = Represents read and write permission of a file (With owner, group, and others permissions)
- drwx-rw-rw- = Represents read and write permission of a directory (With owner, group, and others permissions)
- lrw-rw-rw- = Represents read and write permission of a file or directory related or a shortcut of any other file or directory (With owner, group, and others permissions)
- WITH GROUP AND OTHERS PERMISSIONS AND WITHOUT USER PERMISSIONS:
- ----rwxrwx = Represents read, write, and execute permission of a file (With group and others permissions)
- d---rwxrwx = Represents read, write, and execute permission of a directory (With group and others permissions)
- l---rwxrwx = Represents read, write, and execute permission of a file or directory related or a shortcut of any other file or directory (With group and others permissions)
- WITH USER AND OTHERS PERMISSIONS AND WITHOUT GROUP PERMISSIONS:
- -rwx---rwx = Represents read, write, and execute permission of a file (With owner, and others permissions)
- drwx---rwx = Represents read, write, and execute permission of a directory (With owner, and others permissions)
- lrwx---rwx = Represents read, write, and execute permission of a file or directory related or a shortcut of any other file or directory (With owner and others permissions)
- WITH USER AND GROUP PERMISSIONS WITHOUT OTHERS PERMISSIONS:
- -rwxrwx--- = Represents read, write, and execute permission of a file (With owner and group permissions)
- drwxrwx--- = Represents read, write, and execute permission of a directory (With owner and group permissions)
- lrwxrwx--- = Represents read, write, and execute permission of a file or directory related or a shortcut of any other file or directory (With owner and group permissions)
- WITH ALL THE PERMISSIONS OF READ, WRITE, AND EXECUTE ALONG WITH (USER, GROUP, AND OTHERS):
- -rwxrwxrwx = Represents read, write, and execute permission of a file (With owner, group, and otherS permissions)
- drwxrwxrwx = Represents read, write, and execute permission of a directory (With owner, group, and others permissions)
- lrwxrwxrwx = Represents read, write, and execute permission of a file or directory related or a shortcut of any other file or directory (With owner, group, and others permissions)
- NO ANY PERMISSIONS:
- ---------- = Represents without any permission of a file
- d--------- = Represents without any permission of a directory
- l--------- = Represents without any permission of a file or a directory related or a shortcut of any other file or directory
- Actions
- To add:
- To add readable permission to any file or directory:
- chmod +r [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To add writable permission to any file or directory:
- chmod +w [[FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To add executable permission to any file or directory:
- chmod +x [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To add readable and writable permissions to any file or directory:
- chmod +rw [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To add readable and executable permissions to any file or directory:
- chmod +rx [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To add writable and executable permissions to any file or directory:
- chmod +wx [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To add readable, writable and executable permissions to any file or directory:
- chmod +rwx [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To add user permission:
- chmod u+ [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To add group permission:
- chmod g+ [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To add others permission:
- chmod o+ [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To add user and group permissions:
- chmod ug+ [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To add user and others permissions:
- chmod uo+ [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To add group and others permissions:
- chmod go+ [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To add user, group and others permissions:
- chmod ugo+ [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To add user, group, and others permissions with [read or writable or executable permissions]:
- chmod ugo+[read or writable or executable permissions] [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To remove:
- To remove readable permission to any file or directory:
- chmod -r [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To remove writable permission to any file or directory:
- chmod -w [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To remove executable permission to any file or directory:
- chmod -x [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To remove readable and writable permissions to any file or directory:
- chmod -rw [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To remove readable and executable permissions to any file or directory:
- chmod -rx [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To remove writable and executable permissions to any file or directory:
- chmod -wx [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To remove readable, writable, and executable permissions to any file or directory:
- chmod -rwx [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To remove user permission:
- chmod u- [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To remove group permission:
- chmod g- [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To remove others permission:
- chmod o- [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To remove user and group permissions:
- chmod ug- [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To remove user and others permissions:
- chmod uo- [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To remove group and others permissions:
- chmod go- [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To remove user, group and others permissions:
- chmod ugo- [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- To remove user, group and others permissions with [read or writable or executable permissions]:
- chmod ugo-[read or writable or executable permissions] [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
- Another examples:
- chmod [u and or g and or o]+ or -[r and or w and or x] [FILE_NAME_OR_DIRECTORY_NAME_OR_PATH]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement