首页 > 系统服务 > 详细

测试工程师常用Linux命令(3)

时间:2020-07-22 01:02:47      阅读:144      评论:0      收藏:0      [点我收藏+]
功能项 命令实例 作用 重要性
用户组 groupadd testing 添加一-个新的用户组testing 中
  cat /etc/group 查看组是否被新增成功 中
  groupmod -n test testing 将testing重命名成test 中
  groupdel test 删除组test 中
  groups root 查看用户root所在的所有组 中
       
useradd

useradd yuan

新增一个用户yuan (默认时将新增一一个对应的名为

yuan的组)

中
 

useradd -g test mark

新增一个用户mark并将其加入test组 中
  useradd -g test -G dev mary 新增用户mary,其主组为test,并附加到组dev中 中
       
usermod usermod -g dev yuan 将用户qiang换到dev组 中
  usermod -G 502 yuan 将用户yuan附加到gid为502的这个组 中 
 

usermod -d /home/temp/mary

将mary的主目录从home/mary改为/home/temp

中 
       
 userdel  userdel yuan  删除用户yuan 中
   userdel -f yuan  强制删除用户yuan(即使该用户已经登录) 中 
  userdel -r yuan 删除用户yuan并删除其主目录 中
       
chmod chmod [权限] [文件或目录] 更改文件或目录权限 高
  ls -l hello.txt 查看文件的详细熟悉,并对其进行解释 高
 

左边10位中的第一
位代表文件类型

d ---- 代表目录- 

-  ----代表普通文件

l ----代表链接文件

高
 

左边10位中的后9
位代表权限

前3位代表文件所有者的权限(用u表示)
中间3位代表文件所在组的权限(用g表示)
后3位代表其他组的权限(用o表示)

高
 

权限rwx的意义

权限r或数字4--表示可读
权限w或数字2--表示可写
权限x或数字1--表示可执行

 高
 

chmod u+x hello .txt

为hello.txt文件所有者添加可执行权限

 高
 

chmod u-x hello .txt

为hello.txt文件所有去除可执行权限  高
 

chmod g-r hello.txt

 为hllo.txt文件所在组去除可读权限  高
   chmod o+w hello.txt  为hllo.txt文件的所在组的其他组添加可写权限  高
   chmod a+w hello.txt  为所有三种角色添加可写权限  高
  chmod a+wx hello.txt 为所有三种角色添加可写权限 高
  chmod a-rwx hello.txt 去除nll oxt的所有权限(此时仅rot可编舞) 高

-------未完待续------

测试工程师常用Linux命令(3)

原文:https://www.cnblogs.com/luffybest/p/13357822.html

踩
(0)
赞
(0)
   
举报
评论 一句话评论(0)
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!