#!/bin/bashread -p "Please input SElinux statr is start or stop: " SE
SEC=$(sed -rn 's@^SELINUX=(.*)@\1@'p /etc/selinux/config)
if [ $SE == 'start' ];thenif[$SEC=='enforcing'];thenecho"Selinux status to enforcing"elif[$SEC=='disabled'];thensed -ri 's/^SELINUX=(.*)/SELINUX=enforcing/'g /etc/selinux/config &&echo"selinux is start"fielif[$SE=='stop'];thenif[$SEC=='enforcing'];thensed -ri 's/^SELINUX=(.*)/SELINUX=disabled/'g /etc/selinux/config &&echo"selinux is stop"elif[$SEC=='disabled'];thenecho"Selinux status to disabled"fielseecho"The information you entered is wrong, please re-enter!"fi
2、统计/etc/fstab文件中每个文件系统类型出现的次数
grep"^UUID" /etc/fstab |awk'{fs[$3]++}END{for(i in fs){print i,fs[i]}}'grep"^UUID" /etc/fstab |awk'{print $3}'|sort|uniq -c