linux学习第一集(纯干货)

基础命令

1. mkdir(创建新目录)

在目录/mnt下建立文件夹usb

mkdir /mnt/usb

2 .find(目录索引文件)

(1)根据文件名查找

查找一个文件名是test.py的文件

find / -name test.py

(文件中的“/”表示整个硬盘)

 (2)根据部分文件名称查找

find / -name  '*asd*'

3 . 文件权限设置命令档案存取权限分为三级:档案拥有者、群组、其他

u表示档案的拥有者、g表示群组、o表示其他,a表示这三者都是。

+表示增加权限 、 =表示唯一设定权限 、-表示取消权限

r表示可读、w表示可写、x表示可执行

(1)将档案file.py设置为所有人可读

chmod  ugo+r  file.py

chmond  a+r  file.py

 (2) 将档案file2.py和file3.py设置为拥有者和所属同一个群体可写入,其他的人不可写入

chmod  ug+w,o-w file2.py file3.py

(3) 将档案file4.py设置为只有档案拥有者可以执行

chmod  u+x file4.py

(4) User、Group、Other 分别表示r=4 、w=2 、x=1

rwx:4+2+1=7、 rw-:4+2=6  、r-x:4+1=5

chmod  a=rwx file

chmod 777  file

chmod ug=rwx , o=x  filexiucai

chmod   771  file

猜你喜欢

转载自www.cnblogs.com/xiucai1234/p/xiucai1234.html