1.(1)我们通过cat 命令查看到/etc/passwd 文件第六行内容是: 6 sync:x:5:0:sync:/sbin:/bin/sync
通过sed直接查看指定行内容:
[root@server ~]# sed -n '6p' /etc/passwd
sync:x:5:0:sync:/sbin:/bin/sync
(2)我们首先经过简单过滤过滤出包含SELINUX的行:
[root@server ~]# grep -i selinux /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=enforcing
# SELINUXTYPE= can take one of these three values:
SELINUXTYPE=targeted
再次过滤出以SELNUX开头的行:
[root@server ~]# grep "^SELINUX" /etc/se