标签:Linux基础
1、who | cut -d" " -f1 | sort -u
2、lastlog | grep "\<tty"
lastlog | grep -v "[**]"
3、cut -d: -f7 /etc/passwd | sort -f | uniq -c -d | sort -r | head -1 | grep -E -o "/.*"
4、cat /etc/passwd | sort -nrk 3 -t : | head -10 | tr 'a-z' 'A-Z' > /tmp/maxusers.txt
5、ifconfig eth0 | grep -E -o "addr:[0-9.]+" | cut -d: -f2
ifconfig eth0 | grep -E -o "addr:[0-9.]+" | grep -E -o "[0-9.]+"
6、ls /etc/ | grep ".conf"$ | tr 'a-z' 'A-Z' > /tmp/etc.conf
7、ls /var | wc -w
8、cat /etc/group | sort -nk 3 -t : | cut -d: -f1 | head -10
9、cat /etc/fstab /etc/issue > /tmp/etc.test
10、
(1)groupadd -g 2016 distro
(2)useradd -u 1005 -g distro mandriva
(3)useradd -d /home/linux -u 1100 mageia
(4)passwd mandriva
(5)userdel mandriva
(6)useradd -u 2002 -g distro -G peguin slackware
(7)usermod -s /bin/tcsh slackware
(8)usermod -a -G admins slackware
标签:Linux基础
原文地址:http://blog.51cto.com/13745888/2121815