linux groupmems命令
Because users group membership is defined in two different locations, it can be difficult to find out which groups exactly a user is a member of. A convenient command to check this is groupmems . Use, for example, the command groupmems -g sales -l to see which users are a member of the group sales. This shows users who are a member of this group as a secondary group assignment, but also users who are a member of this group as the primary group assignment.
[root@rhel7 ~]# groupmems --help
Usage: groupmems [options] [action] Options:
-g, --group groupname change groupname instead of the user's group
(root only)
-R, --root CHROOT_DIR directory to chroot into Actions:
-a, --add username add username to the members of the group
-d, --delete username remove username from the members of the group
-h, --help display this help message and exit
-p, --purge purge all members from the group
-l, --list list the members of the group
例:
查看有哪些用户属于sales组
[root@rhel7 ~]# groupmems -g sales -l
linda lisa
从sales组中删除lisa
[root@rhel7 ~]# groupmems -d lisa -g sales
[root@rhel7 ~]# groupmems -g sales -l
linda
添加用户到组里
[root@rhel7 ~]# id lxj2
uid=(lxj2) gid=(root) groups=(root)
[root@rhel7 ~]# groupmems -a lxj2 -g sales
[root@rhel7 ~]# id lxj2
uid=(lxj2) gid=(root) groups=(root),(sales)
也可以使用usermod命令将用户添加到组里
usermod -aG will add users to new groups that will be used as their secondary group.
Use usermod to add users linda and lisa to the group sales, and lori and bob to the group account:
usermod -aG sales linda
usermod -aG sales lisa
usermod -aG account lori
usermod -aG account bob
linux groupmems命令的更多相关文章
- linux grep命令
linux grep命令1.作用Linux系统中grep命令是一种强大的文本搜索工具,它能使用正则表达式搜索文本,并把匹 配的行打印出来.grep全称是Global Regular Expressio ...
- Linux常用命令(一)
Linux常用命令 1. pwd查看当前路径(Print Working Directory) [root@CentOS ~]# pwd/root 2. cd .. 返回上一级 .. 表示上一级 ...
- Linux下命令行安装weblogic10.3.6
Linux下命令行安装weblogic10.3.6 一.安装前准备工作: 1.创建用户useradd weblogic;创建用户成功linux系统会自动创建一个和用户名相同的分组,并将该用户分到改组中 ...
- Linux paste命令
Linux paste命令用于合并文件的列. paste指令会把每个文件以列对列的方式,一列列地加以合并. 语法 paste [-s][-d <间隔字符>][--help][--versi ...
- 20145222《信息安全系统设计基础》Linux常用命令汇总
学习Linux时常用命令汇总 通过Ctrl+f键可在该网页搜索到你想要的命令. Linux中命令格式为:command [options] [arguments] //中括号代表是可选的,即有些命令不 ...
- Linux sudo 命令的应用
.note-content { font-family: "Helvetica Neue", Arial, "Hiragino Sans GB", STHeit ...
- linux 基础命令与文件管理
Linux终端介绍 Shell提示符 Bash Shell基本语法 基本命令的使用:ls.pwd.cd 查看系统和BIOS硬件时间 Linux如何获得帮助 Linux关机命令:shutdow.in ...
- linux awk命令详解
linux awk命令详解 简介 awk是一个强大的文本分析工具,相对于grep的查找,sed的编辑,awk在其对数据分析并生成报告时,显得尤为强大.简单来说awk就是把文件逐行的读入,以空格为默认分 ...
- linux常用命令的介绍
本文主要介绍Linux常用命令工具,比如用户创建,删除,文件管理,常见的网络命令等 如何创建账号: 1. 创建用户 useradd -m username -m 表示会在/home 路径下添加创建用户 ...
随机推荐
- 重新开始学习javase_一切都是对象
@学习thinking in java 一,一切都是对象 用句柄操纵对象 每种编程语言都有自己的数据处理方式.比如说c与c++中的指针,而java中尽管将一切都“看作”对象,但操纵的标识符实际是指向一 ...
- KNN(k-nearest-neighbor)算法
一.算法概述 该方法的思路是:如果一个样本在特征空间中的k个最相似(即特征空间中最邻近)的样本中的大多数属于某一个类别,则该样本也属于这个类别.KNN算法中, 所选择的邻居都是已经正确分类的对象(训练 ...
- Android Studio删除Project
最直截了当的方法是在Project所在目录直接删除整个Project,然后再次打开Android Studio的欢迎界面中把光标移到你的Project上,然后按键盘上的Delete键即可! 参考自st ...
- KB006: CSS 框模型( Box module )
框和布局 在 KB005: CSS 层叠 中已经介绍了 CSS 的重要之处.CSS 可以说是页面表现的基础, CSS 可以控制布局,控制元素的渲染. 布局是讲在电影画面构图中,对环境的布置.人物地位的 ...
- gearmand的安装
1.安装gperf libuuid-devel yum install -y gperf libuuid-devel 2.安装 libevent yum install libevent libeve ...
- extjs中rowEditing动态编辑
我们在使用Grid的rowEditing插件时希望能够根据自己的业务需求能够动态的实现那一列是用户可以编辑的,那一列用户不可编辑,下面给出一个方案能够实现rowEditing的动态编辑功能. 之前我通 ...
- twisted(1)--何为异步
早就想写一篇文章,整体介绍python的2个异步库,twisted和tornado.我们在开发python的tcpserver时候,通常只会用3个库,twisted.tornado和gevent,其中 ...
- Java中抽象类和接口的用法和区别
一.抽象类 1.抽象类 包含一个抽象方法的类就是抽象类 2.抽象方法 声明而未被实现的方法,抽象方法必须使用abstract关键词字声明 public abstract class People { ...
- javascript language
function class(function, this, prototype) closure与function expression没有任何关系. closure必然与function联系在一起 ...
- 可重入与线程安全(Reentrancy and Thread-Safety)
http://blog.csdn.net/zzwdkxx/article/details/49338067 http://blog.csdn.net/zzwdkxx/article/details/4 ...