1.chmod
1.字符法
chmod u/g/o/a +/-/= rwx 文件
u:user 表示该文件的所有者
g:group 表示与该文件的所有者属于同一组( group )者,即用户组
o:other 表示其他以外的人
a:all 表示这三者皆是
r:read 表示可读取
w:write 表示可写入
x:excute 表示可执行
# 文件拥有着添加可执行权限
chmod u+x test.txt
2.chmod u=rwx,g=rx,o=r filename 就等同于:chmod u=7,g=5,o=4 filename
chmod 751 file
文件所有者:读、写、执行权限
同组用户:读、执行的权限
其它用户:执行的权限
r:4,w:2,r:1,
2.shell for循环1到100
#!/bin/bash
#
i=0
n=1 //定义循环变量
while [ $n -lt 101 ];
do //定义循环条件 n < 101
i=$(( $i + $n )) //累加
n=$(( $n + 1 ))
done
echo $i