1.cp -r /etc/skel/ /home/tuser1 && chmod -R 600 /home/tuser1
2.max=`cat /etc/group |awk -F":" '{print $3}'|sort -nr| head -n1`|sed -i '$a hadoop:x:'$((max+1)) /etc/group
3.maxuser=`cat /etc/passwd |awk -F":" '{print $3}'|sort -nr|head -n1` && hadoopgroup=`grep "hadoop" /etc/group|awk -F":" '{print $3}'`|sed -i '$a hadoop:x:'$((maxuser+1)):$maxgroup::/home/hadoop:/bin/bash /etc/passwd
4.与第一题一样,略
5.chown -R hadoop:hadoop /home/hadoop
6.cat /proc/meminfo | egrep ^[Ss]
cat /proc/meminfo | awk '{if($1~/^[Ss]/) print}'
7.cat /etc/passwd | awk -F":" {'if($NF!="/bin/bash") print $1'}
8.cat /etc/passwd | awk -F":" {'if($NF=="/bin/bash") print $1'}
9.cat /etc/passwd | awk -F":" {'if(length($1)<=2) print $1'}
10.cat /boot/grub/grub.conf | egrep "^[[:space:]]+"
11.cat /etc/rc.d/rc.sysinit | egrep –color "^#[[:space:]]+[[:graph:]]+"
12.netstat -tan | egrep –color "LISTEN[[:space:]]+"
13.for i in bash testbash basher ; do useradd $i ; done ; useradd nologin -s /sbin/nologin && for i in `egrep -o "^[[:alnum:]]+" /etc/passwd `; do egrep "($i).*\1$" /etc/passwd;done
原创文章,作者:未闻花名,如若转载,请注明出处:http://www.178linux.com/43420
评论列表(1条)
没有很好的按照第三周老师的方式来改善哦,希望改进下;
PS:题目+格式渲染更好。加油