N63044-第二周

N60044-第二周

第三天
三、文件管理和IO重定向
1、文件路径和文件访问(52分钟)
2、文件通配符(55分钟)
3、文本管理命令(51分钟)
4、文件的删除和节点表结构(53分钟)
5、硬链接和软链接及重定向(56分钟)
6、重定向和管道(61分钟)
7、用户和组管理初步(42分钟)
第四天
四、用户组合权限管理
1、用户和组配置文件及管理命令(59分钟)
2、文件权限管理(64分钟)
3、默认权限和特殊权限(34分钟)
4、文件特殊属性和FACL(41分钟)
5、文本编辑之神vim(69分钟)
6、文本编辑之神vim(35分钟)
7、文件处理工具(73分钟)

1、显示/etc目录下,以非字母开头,后面跟了一个字母以及其它任意长度任意字符的文件或目录

[root@centos8 etc]#touch 1a.txt
[root@centos8 etc]#mkdir 1ffff
[root@centos8 etc]#ls -d /etc/[^[:alpha:]][[:alpha:]]*
/etc/1a.txt  /etc/1ffff

2、复制/etc目录下所有以p开头,以非数字结尾的文件或目录到/tmp/mytest1目录中。

[root@centos8 mytest1]#mkdir -p /tmp/mytest1
[root@centos8 mytest1]#cp -rf /etc/p[[:alpha:]]*[^[:digit:]] /tmp/mytest1
[root@centos8 mytest1]#ls /tmp/mytest1
pam.d      passwd   pbm2ppa.conf  pipewire  plymouth      popt.d   prelink.conf.d  profile    protocols
papersize  passwd-  pinforc       pki       pnm2ppa.conf  postfix  printcap        profile.d  pulse

3、将/etc/issue文件中的内容转换为大写后保存至/tmp/issue.out文件中

[root@centos8 ~]#touch /tmp/issue.out
[root@centos8 ~]#cat /etc/issue
\S
Kernel \r on an \m

[root@centos8 ~]#echo "`tr 'a-z' 'A-Z'  /tmp/issue.out 
[root@centos8 ~]#cat /tmp/issue.out
\S
KERNEL \R ON AN \M

4、请总结描述用户和组管理类命令的使用方法并完成以下练习:

4.1 useradd 命令可以创建新的Linux用户

格式:

useradd [options] LOGIN

常见选项:

-u UID
-o 配合-u 选项,不检查UID的唯一性
-g GID 指明用户所属基本组,可为组名,也可以GID
-c "COMMENT“ 用户的注释信息
-d HOME_DIR 以指定的路径(不存在)为家目录
-s SHELL 指明用户的默认shell程序,可用列表在/etc/shells文件中
-G GROUP1[,GROUP2,...] 为用户指明附加组,组须事先存在
-N 不创建私用组做主组,使用users组做主组
-r 创建系统用户 CentOS 6之前: ID<500,CentOS7 以后: ID<1000
-m 创建家目录,用于系统用户
-M 不创建家目录,用于非系统用户
-p 指定加密的密码
范例: useradd -r -u 48 -g apache -s /sbin/nologin -d /var/www -c "Apache" apache

4.2 usermod 命令可以修改用户属性

格式:

usermod [OPTION] login

常见选项:

-u UID:UID
-g GID: 新主组
-G GROUP1[,GROUP2,...[,GROUPN]]]:新附加组,原来的附加组将会被覆盖;若保留原有,则要同时使
用-a选项
-s SHELL:新的默认SHELL
-c 'COMMENT':新的注释信息
-d HOME: 新家目录不会自动创建;若要创建新家目录并移动原家数据,同时使用-m选项
-l login_name: 新的名字
-L: lock指定用户,在/etc/shadow 密码栏的增加 !
-U: unlock指定用户,将 /etc/shadow 密码栏的 ! 拿掉
-e YYYY-MM-DD: 指明用户账号过期日期
-f INACTIVE: 设定非活动期限,即宽限期

4.3 删除用户

userdel 可删除Linux 用户

格式:

userdel [OPTION]... Login

常见选项:

-f, --force  强制
-r, --remove 删除用户家目录和邮箱

范例:强制删除用户和数据

[root@centos8 ~]#useradd test
[root@centos8 ~]#id test
uid=1001(test) gid=1001(test) groups=1001(test)
#在另一终端用test登录
[root@centos8 ~]#su - test
[test@centos8 ~]$
#删除正在登录的用户失败
[root@centos8 ~]#userdel -r test
userdel: user test is currently used by process 29909
[root@centos8 ~]#id test
uid=1001(test) gid=1001(test) groups=1001(test)
#强制删除用户
[root@centos8 ~]#userdel -rf test
userdel: user test is currently used by process 29909
[root@centos8 ~]#id test
id: ‘test’: no such user

4.4 查看用户相关的ID信息

id 命令可以查看用户的UID,GID等信息

格式:

id [OPTION]... [USER]

常见选项:

-u: 显示UID
-g: 显示GID
-G: 显示用户所属的组的ID
-n: 显示名称,需配合ugG使用

4.5 切换用户或以其他用户身份执行命令

su: 即 switch user,命令可以切换用户身份,并且以指定用户的身份执行命令

格式:

su [options...] [-] [user [args...]]

常见选项:

-l  --login  su -l UserName  相当于 su - UserName
-c, --command <command>     pass a single command to the shell with -c

切换用户的方式:

  • su UserName:非登录式切换,即不会读取目标用户的配置文件,不改变当前工作目录,即不完全切换

  • su - UserName:登录式切换,会读取目标用户的配置文件,切换至自已的家目录,即完全切换

说明:root su至其他用户无须密码;非root用户切换时需要密码
注意:su 切换新用户后,使用 exit 退回至旧的用户身份,而不要再用 su 切换至旧用户,否则会生成很多的bash子进程,环境可能会混乱。
换个身份执行命令:

su [-] UserName -c 'COMMAND'

范例:

[root@centos8 ~]#getent passwd mage
mage:x:1001:1001::/home/mage:/bin/bash
[root@centos8 ~]#usermod -s /bin/false mage
[root@centos8 ~]#getent passwd mage
mage:x:1001:1001::/home/mage:/bin/false
[root@centos8 ~]#su - mage
Last login: Fri Mar 27 09:18:57 CST 2020 on pts/0
[root@centos8 ~]#whoami
root

范例:

[root@centos8 ~]#su -s /sbin/nologin wang
This account is currently not available.
[root@centos8 ~]#whoami
root
[root@centos8 ~]#su -s /bin/false wang
[root@centos8 ~]#whoami
root

范例:

[mage@centos8 ~]$su - root -c "getent shadow"
Password: 

范例:

[root@centos8 ~]#su - wang -c 'touch wang.txt'
[root@centos8 ~]#ll ~wang/
total 0
-rw-rw-r--. 1 wang wang 0 Dec 28 17:05 wang.txt

范例:

[root@centos8 ~]#su bin
This account is currently not available.
[root@centos8 ~]#su -s /bin/bash bin
bash-4.4$ whoami
bin
bash-4.4$ exit
exit
[root@centos8 ~]#getent passwd tss
tss:x:59:59:Account used by the trousers package to sandbox the tcsd daemon:/dev/null:/sbin/nologin
[root@centos8 ~]#su - -s /bin/bash tss
su: warning: cannot change directory to /dev/null: Not a directory
-bash: /dev/null/.bash_profile: Not a directory
[tss@centos8 root]$pwd
/root
[tss@centos8 root]$whoami
tss

4.6 设置密码

passwd 可以修改用户密码

格式:

passwd [OPTIONS] UserName

常用选项:

-d:删除指定用户密码
-l:锁定指定用户
-u:解锁指定用户
-e:强制用户下次登录修改密码
-f:强制操作
-n mindays:指定最短使用期限
-x maxdays:最大使用期限
-w warndays:提前多少天开始警告
-i inactivedays:非活动期限
--stdin:从标准输入接收用户密码,Ubuntu无此选项

范例:非交互式修改用户密码

#此方式更通用,适用于各种Linux版本,如:ubuntu
[root@centos8 ~]#echo -e '123456\n123456' | passwd mage
Changing password for user mage.
New password: BAD PASSWORD: The password is shorter than 8 characters
Retype new password: passwd: all authentication tokens updated successfully.
#适用于红帽系列的Linux版本
[root@centos8 ~]#echo '123456' | passwd --stdin mage
Changing password for user mage.
passwd: all authentication tokens updated successfully.

范例: Ubuntu 非交互式修改用户密码

方法一:
root@ubuntu1804:~# echo wang:centos | chpasswd #密码修改为centos
方法二:
root@ubuntu1804:~# passwd wang <
> centos
> centos
> EOF
Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully
方法三:
root@ubuntu1804:~# echo -e '123456\n123456' | passwd wang
Enter new UNIX password: Retype new UNIX password: passwd: password updated successfully

范例:设置用户下次必须更改密码

[root@centos8 ~]#useradd wang
[root@centos8 ~]#echo 123456 | passwd --stdin wang
Changing password for user wang.
passwd: all authentication tokens updated successfully.
[root@centos8 ~]#getent shadow wang
wang:$6$TGWOD1.y8WFYCCDs$0HiazOKH0cnevLb4czWyHI2/cFy0exnKRZxgSmPlIUzqNFhuVQN2WK7Elpg8I.0QOxGJkq24FddkWIq3iX/e6/:18989:0:99999:7:::
[root@centos8 ~]#passwd -e wang
Expiring password for user wang.
passwd: Success
[root@centos8 ~]#getent shadow wang
wang:$6$TGWOD1.y8WFYCCDs$0HiazOKH0cnevLb4czWyHI2/cFy0exnKRZxgSmPlIUzqNFhuVQN2WK7Elpg8I.0QOxGJkq24FddkWIq3iX/e6/:0:0:99999:7:::
[root@centos8 ~]#su - mage
[mage@centos8 ~]$su - wang
Password: 
You are required to change your password immediately (administrator enforced)
Current password: 
New password: 
BAD PASSWORD: The password fails the dictionary check - it is too simplistic/systematic
su: Authentication token manipulation error
[mage@centos8 ~]$su - wang
Password: 
You are required to change your password immediately (administrator enforced)
Current password: 
New password: 
Retype new password: 
[wang@centos8 ~]$exit
logout
[mage@centos8 ~]$exit
logout
[root@centos8 ~]#getent shadow wang
wang:$6$FPbV9.V/AFKzOAAC$Zlc9IFw17xxtCcZEhtKxJ73uuc2RIL.ssRXrWlq7VQ7sY8BkCphg4sjWjAGPzgY8WhNRTRyI.ltONZrnt6kU.0:18989:0:99999:7:::

4.7 修改用户密码策略

chage 可以修改用户密码策略

格式:

chage [OPTION]... LOGIN

常见选项:

-d LAST_DAY        #更改密码的时间
-m --mindays MIN_DAYS
-M --maxdays MAX_DAYS
-W --warndays WARN_DAYS
-I --inactive INACTIVE #密码过期后的宽限期
-E --expiredate EXPIRE_DATE #用户的有效期
-l 显示密码策略

范例:

[root@centos8 ~]#chage wang
Changing the aging information for wang
Enter the new value, or press ENTER for the default

	Minimum Password Age [0]: 3  #密码最短使用期限
	Maximum Password Age [99999]: 42 #密码最长使用期
	Last Password Change (YYYY-MM-DD) [2021-12-28]: 2022-01-01 #上次口令更改
	Password Expiration Warning [7]: 10  #密码过期的警告
	Password Inactive [-1]: 20  #密码不活跃
	Account Expiration Date (YYYY-MM-DD) [-1]: 2022-01-01 #密码过期时间
[root@centos8 ~]#getent shadow wang
wang:$6$FPbV9.V/AFKzOAAC$Zlc9IFw17xxtCcZEhtKxJ73uuc2RIL.ssRXrWlq7VQ7sY8BkCphg4sjWjAGPzgY8WhNRTRyI.ltONZrnt6kU.0:18993:3:42:10:20:18993:
[root@centos8 ~]#chage -m 3 -M 42 -W 14 -I 7 -E 2022-01-01 wang
[root@centos8 ~]#getent shadow wang
wang:$6$FPbV9.V/AFKzOAAC$Zlc9IFw17xxtCcZEhtKxJ73uuc2RIL.ssRXrWlq7VQ7sY8BkCphg4sjWjAGPzgY8WhNRTRyI.ltONZrnt6kU.0:18993:3:42:14:7:18993:
[root@centos8 ~]#chage -l wang
Last password change					: Jan 01, 2022
Password expires					: Feb 12, 2022
Password inactive					: Feb 19, 2022
Account expires						: Jan 01, 2022
Minimum number of days between password change		: 3
Maximum number of days between password change		: 42
Number of days of warning before password expires	: 14
#下一次登录强制重设密码
[root@centos8 ~]#chage -d 0 wang
[root@centos8 ~]#getent shadow wang
wang:$6$FPbV9.V/AFKzOAAC$Zlc9IFw17xxtCcZEhtKxJ73uuc2RIL.ssRXrWlq7VQ7sY8BkCphg4sjWjAGPzgY8WhNRTRyI.ltONZrnt6kU.0:0:3:42:14:7:18993:
[root@centos8 ~]#chage -l wang
Last password change					: password must be changed
Password expires					: password must be changed
Password inactive					: password must be changed
Account expires						: Jan 01, 2022
Minimum number of days between password change		: 3
Maximum number of days between password change		: 42
Number of days of warning before password expires	: 14

4.8 用户相关的其他命令

  • chfn 指定个人信息
  • chsh 指定shell,相当于usermod -s
  • finger 可看用户个人信息

范例:

[root@centos7 ~]# chfn wang
Changing finger information for wang.
Name [wang]: linxiaodong
Office []: it
Office Phone []: 10086
Home Phone []: 10000

Finger information changed.
[root@centos7 ~]# finger wang
Login: wang           			Name: linxiaodong
Directory: /home/wang               	Shell: /bin/bash
Office: it, x1-0086			Home Phone: x1-0000
Never logged in.
No mail.
No Plan.
[root@centos7 ~]# getent passwd wang
wang:x:1000:1000:linxiaodong,it,10086,10000:/home/wang:/bin/bash
[root@centos7 ~]# chsh -s /bin/csh wang
Changing shell for wang.
chsh: "/bin/csh" does not exist

范例:修改用户使用不可登录的shell类型

[root@centos8 ~]# getent passwd wang
wang:x:1000:1000:linxiaodong,it,10086,10000:/home/wang:/bin/bash
[root@centos8 ~]# chsh -s /sbin/nologin wang
Changing shell for wang.
chsh: Warning: "/sbin/nologin" is not listed in /etc/shells.
Shell changed.
[root@centos8 ~]# su - wang
This account is currently not available.
[root@centos8 ~]# chsh -s /bin/false wang
Changing shell for wang.
chsh: Warning: "/bin/false" is not listed in /etc/shells.
Shell changed.
[root@centos8 ~]# su - wang
[root@centos8 ~]# id
uid=0(root) gid=0(root) groups=0(root)
[root@centos8 ~]# chsh -s /bin/bash wang
Changing shell for wang.
Shell changed.
[root@centos8 ~]# su - wang
[wang@centos8 ~]$ 

4.9 创建组

groupadd实现创建组

格式

groupadd [OPTION]... group_name

常见选项:

-g GID 指明GID号;[GID_MIN,GID_MAX]
-r 创建系统组,Centos 6之前:ID<500,CentOS 7以后:ID<1000

范例:

groupadd -g 48 -r apache

4.10 修改组

groupmod组属性修改

格式:

groupmod [OPTION]... group

常见选项:

-n group_name:新名字
-g GID:新的GID

4.11 组删除

groupdel 可以删除组

格式:

groupdel [options] GROUP

常见选项:

-f, --force 强制删除,即使是用户的主组也强制删除组,但会导致无主组的用户不可用无法登录

4.12 更改组密码

gpasswd命令,可以更改组密码,也可以修改附加组的成员关系

格式:

gpasswd [OPTION] GROUP

常见选项:

-a user 将user添加至指定组中
-d user 从指定附加组中移除用户user
-A user1,user2,... 设置有管理权限的用户列表

范例:

#增加组成员
[root@centos8 ~]# groupadd admins
[root@centos8 ~]# id wang
uid=1000(wang) gid=1000(wang) groups=1000(wang)
[root@centos8 ~]# gpasswd -a wang admins
Adding user wang to group admins
[root@centos8 ~]# id wang
uid=1000(wang) gid=1000(wang) groups=1000(wang),2021(admins)
[root@centos8 ~]# groups wang
wang : wang admins
[root@centos8 ~]# getent group admins
admins:x:2021:wang

#删除组成员
[root@centos8 ~]# gpasswd -d wang admins
Removing user wang from group admins
[root@centos8 ~]# groups wang
wang : wang
[root@centos8 ~]# id wang
uid=1000(wang) gid=1000(wang) groups=1000(wang)
[root@centos8 ~]# getent group admins
admins:x:2021:

4.13 临时切换主组

newgrp命令可以临时切换主组,如果用户本不属于此组,则需要组密码

格式:

newgrp [-] [group]

如果使用 - 选项,可以初始化用户环境

[root@centos8 ~]# gpasswd root
Changing the password for group root
New Password: 
Re-enter new password: 
[root@centos8 ~]# getent gshadow root
root:$6$xoP53X8SyZ/D8$w5ciWIieQkUFlesFFs0WYGPsuJER.Eg/ZDXZ5KHiM7j9sp0fowco9l44uCi8nFzMG/q.Ca7ereZK9wDsjY.6B1::
[root@centos8 ~]# su - wang
[wang@centos8 ~]$ newgrp root
Password: 
[wang@centos8 ~]$ id
uid=1000(wang) gid=0(root) groups=0(root),1000(wang)
[wang@centos8 ~]$ getent passwd wang
wang:x:1000:1000:linxiaodong,it,10086,10000:/home/wang:/bin/bash
[wang@centos8 ~]$ touch wang1.txt
[wang@centos8 ~]$ ll
total 0
-rw-r--r-- 1 wang root 0 Dec 30 13:57 wang1.txt
[wang@centos8 ~]$ exit
exit
[wang@centos8 ~]$ id
uid=1000(wang) gid=1000(wang) groups=1000(wang)
[wang@centos8 ~]$ touch wang2.txt
[wang@centos8 ~]$ ll
total 0
-rw-r--r-- 1 wang root 0 Dec 30 13:57 wang1.txt
-rw-rw-r-- 1 wang wang 0 Dec 30 13:58 wang2.txt

4.14 更改和查看组成员

groupmems可以管理附属组的成员关系

格式:

groupmems [options] [action]

常见选项:

-g, --group groupname        #更改为指定组(只有root)
-a, --add username			 #指定用户加入组
-d, --delete username 		 #从组中删除用户
-p, --purge          		 #从组中清楚所有成员
-l, --list					 #显示组成员列表

groups可查看用户组关系

格式

#查看用户所属组列表
groups [OPTION].[USERNAME]...

范例:

[root@centos8 ~]# groupmems -l -g admins
[root@centos8 ~]# groupmems -a mage -g admins
groupmems: user 'mage' does not exist
[root@centos8 ~]# useradd mage
[root@centos8 ~]# groupmems -a mage -g admins
[root@centos8 ~]# id mage
uid=2007(mage) gid=2007(mage) groups=2007(mage),2021(admins)
[root@centos8 ~]# groupmems -l -g admins
mage 
[root@centos8 ~]# groupmems -a wang -g admins
[root@centos8 ~]# groupmems -l -g admins
mage  wang 
[root@centos8 ~]# groups wang
wang : wang admins
[root@centos8 ~]# groupmems -d wang -g admins
[root@centos8 ~]# groupmems -l -g admins
mage 
[root@centos8 ~]# groupmems -p -g admins
[root@centos8 ~]# groupmems -l -g admins

(1)、创建组distro,其GID为2019;

[root@centos8 ~]# groupadd -g 2019 distro

(2)、创建用户mandriva, 其ID号为1005;基本组为distro;

[root@centos8 ~]# useradd -u 1005 -g distro mandriva
[root@centos8 ~]# getent passwd mandriva 
mandriva:x:1005:2019::/home/mandriva:/bin/bash

(3)、创建用户mageia,其ID号为1100,家目录为/home/linux;

[root@centos8 ~]# useradd -u 1100 -d /home/linux mageia
[root@centos8 ~]# getent passwd mageia
mageia:x:1100:1100::/home/linux:/bin/bash

(4)、给用户mageia添加密码,密码为mageedu,并设置用户密码7天后过期

[root@centos8 ~]# echo -e 'mageedu\nmageedu' | passwd mageia
Changing password for user mageia.
New password: BAD PASSWORD: The password is shorter than 8 characters
Retype new password: passwd: all authentication tokens updated successfully.
[root@centos8 ~]# chage -E 7 mageia
[root@centos8 ~]# getent shadow mageia
mageia:$6$wpV3glXmgs57Ni5/$Gfo/xE4IYHutYFx9av8leL0uqz35LKsrmpRP/ygbzJpLTJXIqFAVEzT1zRr3eUzq.7WMAb2mq3pgSXQlgR/A21:18990:0:99999:7::7:

(5)、删除mandriva,但保留其家目录;

[root@centos8 ~]# userdel mandriva 
[root@centos8 ~]# ll /home/mandriva/
total 0

(6)、创建用户slackware,其ID号为2002,基本组为distro,附加组peguin;

[root@centos8 ~]# groupadd peguin
[root@centos8 ~]# useradd -u 2002 -g distro -G peguin slackware
[root@centos8 ~]# id slackware 
uid=2002(slackware) gid=2019(distro) groups=2019(distro),2020(peguin)

(7)、修改slackware的默认shell为/bin/tcsh;

[root@centos8 ~]# usermod -s /bin/tcsh slackware 
[root@centos8 ~]# getent passwd slackware 
slackware:x:2002:2019::/home/slackware:/bin/tcsh

(8)、为用户slackware新增附加组admins,并设置不可登陆。

[root@centos8 ~]# groupadd admins
[root@centos8 ~]# usermod -a -G admins,peguin  slackware 
[root@centos8 ~]# id slackware 
uid=2002(slackware) gid=2019(distro) groups=2019(distro),2020(peguin),2021(admins)

5、创建用户user1、user2、user3。在/data/下创建目录test

(1)、目录/data/test属主、属组为user1

[root@centos8 data]# chown user1:user1 /data/test
[root@centos8 data]# ll 
total 0
drwxr-xr-x 2 user1 user1 6 Dec 29 21:02 test

(2)、在目录属主、属组不变的情况下,user2对文件有读写权限

[root@centos8 test]# setfacl -m u:user2:rw- test.txt
[root@centos8 test]# getfacl test.txt 
# file: test.txt
# owner: root
# group: root
user::rw-
user:user2:rw-
group::r--
mask::rw-
other::r--
[root@centos8 test]# su - user2 #user2具有读写权限
[user2@centos8 ~]$ echo test > /data/test/test.txt
[user2@centos8 test]$ cat test.txt 
test
[user2@centos8 test]$ ll
total 4
-rw-rw-r--+ 1 root root 5 Dec 29 23:20 test.txt
[root@centos8 test]# su - user3 #user3只有只读权限
[user3@centos8 ~]$ cd /data/test
[user3@centos8 test]$ ll
total 4
-rw-rw-r--+ 1 root root 5 Dec 29 23:20 test.txt
[user3@centos8 test]$ cat test.txt 
test
[user3@centos8 test]$ echo user3 > test.txt 
-bash: test.txt: Permission denied

(3)、user1在/data/test目录下创建文件a1.sh, a2.sh, a3.sh, a4.sh,设置所有用户都不可删除1.sh,2.sh文件、除了user1及root之外,所有用户都不可删除a3.sh, a4.sh

[user1@centos8 test]$ chattr +i /data/test/a1.sh /data/test/a2.sh 
chattr: Operation not permitted while setting flags on a1.sh
chattr: Operation not permitted while setting flags on a2.sh
[user1@centos8 test]$ chmod o+x /data/test/a3.sh /data/test/a4.sh
[user1@centos8 test]$ chmod o+t /data/test/a3.sh /data/test/a4.sh

(4)、user3增加附加组user1,同时要求user1不能访问/data/test目录及其下所有文件

[root@centos8 data]# usermod user3 -a -G user1
[root@centos8 data]# id user3
uid=2006(user3) gid=2006(user3) groups=2006(user3),2004(user1)
[root@centos8 data]# setfacl -m u:user1:- /data/test/
[root@centos8 data]# getfacl /data/test
getfacl: Removing leading '/' from absolute path names
# file: data/test
# owner: user1
# group: user1
user::rwx
user:user1:---
user:user2:rw-
group::r-x
mask::rwx
other::r-x

(5)、清理/data/test目录及其下所有文件的acl权限

[root@centos8 data]# setfacl -R -b /data/test/
[root@centos8 data]# getfacl /data/test/
getfacl: Removing leading '/' from absolute path names
# file: data/test/
# owner: user1
# group: user1
user::rwx
group::r-x
other::r-x

[root@centos8 data]# ll /data/test/
total 0
-rw-rw-r-- 1 user1 user1 0 Dec 30 12:56 a1.sh
-rw-rw-r-- 1 user1 user1 0 Dec 30 12:56 a2.sh
-rw-rw-r-t 1 user1 user1 0 Dec 30 12:56 a3.sh
-rw-rw-r-t 1 user1 user1 0 Dec 30 12:56 a4.sh

你可能感兴趣的:(linux,bash,linux,服务器)