Commands and references ( GNU / linux kernel 2.4.18-3 and 2.4.18-14 )
Linux is a registered trademark of Linus Torvalds
The commands with their most common usage are in brackets like this: [ command ].
Don't type the brackets, just what is inside of them.Back to the index page
--------------------------------------------------------------------------------
How many file permissions are possible running Linux? I have put together this list of permissions and chmod commands using octal numbers from 0-7 that produce them.The numbers to the left of the symbolic permission listings are the octal numbers used in the command. For example: on the eighth entry down below on the right side you see the number 10 next to - - - - - - x - - - that would be the result of the command:[ chmod 10 file_name ]
used to change the permissions on a file called file_name.here is the script I used to generate all the permissions: ( its not perfect, it also loops through the 8's and 9's)
#!/bin/sh
#modds.sh #loops through a chmod sequence counting_function(){ foo=1 touch file_one while [ "$foo" -ne 7777 ]; do echo $foo >> results chmod $foo file_one ls -gG >> results foo=$(($foo+1)) done } counting_function egrep -v '(modds.sh)|(total)|(results)' results > results1 echo "now use gnumeric to sort out the columns in the results1 file.Then use grep to eliminate the 8s and 9s from the remaining list." exit 0if you have a sorted file with a single column structured like this(it could have hundreds of lines)with digits from 0 to 7:
1 ---------x 2 --------w- 3 --------wx 4 -------r-- 5 -------r-x 6 -------rw- 7 -------rwx -------rwx -------rwx 10 ------x--- 11 ------x--x 12 ------x-w- 13 ------x-wx 14 ------xr-- do this to sort out the numbers and non-integer values:[ grep -o '[01234567]*' ] this displays all the numbers
[ grep -v '[01234567]' ] this displays all the non-integer valuesthe S and s refer to set Group ID
The lower case s means both group execute and sgid The upper case S means only sgid r means read x means execute w means write the T and t refer to sticky bit each - refers to aspects of the permissions: - --- --- --- type owner group othersThese are possible combinations generated by the system ( kernel 2.4.20-6 )
with octal numbers. I have not tried them all. Some may not be usable. 1 ---------x | 2001 ------S--x | 4001 ---S-----x | 6001 ---S--S--x 2 --------w- | 2002 ------S-w- | 4002 ---S----w- | 6002 ---S--S-w- 3 --------wx | 2003 ------S-wx | 4003 ---S----wx | 6003 ---S--S-wx 4 -------r-- | 2004 ------Sr-- | 4004 ---S---r-- | 6004 ---S--Sr-- 5 -------r-x | 2005 ------Sr-x | 4005 ---S---r-x | 6005 ---S--Sr-x 6 -------rw- | 2006 ------Srw- | 4006 ---S---rw- | 6006 ---S--Srw- 7 -------rwx | 2007 ------Srwx | 4007 ---S---rwx | 6007 ---S--Srwx 10 ------x--- | 2010 ------s--- | 4010 ---S--x--- | 6010 ---S--s--- 11 ------x--x | 2011 ------s--x | 4011 ---S--x--x | 6011 ---S--s--x 12 ------x-w- | 2012 ------s-w- | 4012 ---S--x-w- | 6012 ---S--s-w- 13 ------x-wx | 2013 ------s-wx | 4013 ---S--x-wx | 6013 ---S--s-wx 14 ------xr-- | 2014 ------sr-- | 4014 ---S--xr-- | 6014 ---S--sr-- 15 ------xr-x | 2015 ------sr-x | 4015 ---S--xr-x | 6015 ---S--sr-x 16 ------xrw- | 2016 ------srw- | 4016 ---S--xrw- | 6016 ---S--srw- 17 ------xrwx | 2017 ------srwx | 4017 ---S--xrwx | 6017 ---S--srwx 20 -----w---- | 2020 -----wS--- | 4020 ---S-w---- | 6020 ---S-wS--- 21 -----w---x | 2021 -----wS--x | 4021 ---S-w---x | 6021 ---S-wS--x 22 -----w--w- | 2022 -----wS-w- | 4022 ---S-w--w- | 6022 ---S-wS-w- 23 -----w--wx | 2023 -----wS-wx | 4023 ---S-w--wx | 6023 ---S-wS-wx 24 -----w-r-- | 2024 -----wSr-- | 4024 ---S-w-r-- | 6024 ---S-wSr-- 25 -----w-r-x | 2025 -----wSr-x | 4025 ---S-w-r-x | 6025 ---S-wSr-x