博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
How many file permissions are possible running ...
阅读量:6895 次
发布时间:2019-06-27

本文共 3780 字,大约阅读时间需要 12 分钟。

  hot3.png

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 0

if 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 values

the 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 others

These 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

转载于:https://my.oschina.net/tadcat/blog/147831

你可能感兴趣的文章
OpenMNS--管理网络的绝好工具
查看>>
ORACLE LINUX 6.1安装过程
查看>>
iPhone/Mac Objective-C内存管理原理
查看>>
整理Silverlight资源列表(三)-SL实际运用案例
查看>>
02-BGP选路原则和属性详解--weight
查看>>
7.[数据结构和算法分析笔记]词典 Dictionary
查看>>
CCNP精粹系列之八----帧中继全网拓扑试验配置
查看>>
Lync升级S4B秘籍,So Easy!!!
查看>>
SpringBoot整合mybatis、shiro、redis实现基于数据库的细粒度动态权限管理系统实例...
查看>>
android用户界面-组件Widget-进度条ProgressBar
查看>>
猜字谜小游戏编程
查看>>
【OneNote Mobile】 如何处理便签内容的格式?
查看>>
Algeco Scotsman将召开2016年第三季度业绩电话会议
查看>>
新加坡IMDA计划进行Li-Fi测试
查看>>
《深入理解大数据:大数据处理与编程实践》一一1.3 MapReduce并行计算技术简介...
查看>>
LoadRunner关联的高级应用
查看>>
如何减少返工工作量?
查看>>
《敏捷可执行需求说明 Scrum提炼及实现技术》—— 2.1 界定不可更改的边界
查看>>
关注安防行业 聚焦公共安防系统
查看>>
Android代码(Handler的运用),HttpURLConnection的应用,将url图片地址转换成图片。...
查看>>