标签:list inux code lin 文件中 test conf 地址 利用
1 方法一:cat /proc/meminfo |grep -i ^s 2 方法二:cat /proc/meminfo |grep ^[sS]
1 cat /etc/passwd | grep -v /bin/bash
1 方法一:cat /etc/passwd |grep "^rpc\b" |cut -d: -f7 2 方法二:getent passwd rpc |cut -d: -f7
1 cat /etc/passwd |grep "\b[0-9]\{2,3\}\b"
1 cat /etc/grub2.cfg |egrep "^[[:space:]]+[[:graph:]].*"
1 netstat -tan |grep "LISTEN[[:space:]]\+$"
1 方法一:getent passwd |cut -d: -f1,3 |grep -v root |grep "\b[[:digit:]]\{1,3\}\b$" 2 方法二:getent passwd |cut -d: -f1,3 |grep -ve root -e "\b[[:digit:]]\{4,\}\b"
1 cat /etc/passwd |grep -o "^\(.\+\b\).*\b\1$"
1 df |grep sd |grep -Eo "[0-9]{1,3}%" |sort -nr
1 cat /etc/passwd |egrep "^(root|mage|wang)\b" |cut -d: -f3,7
1 cat /etc/rc.d/init.d/functions |egrep "^[[:alpha:]](.*|_)+\(\)"
1 方法一:echo /etc/rc.d/init.d/functions | egrep -o "[[:alpha:]]*$" 2 方法二:echo /etc/rc.d/init.d/functions | egrep -o "[^/]+/?$"
1 方法一:echo /etc/rc.d/init.d/functions | egrep -o "(/).*\1" 2 方法二:echo /etc/rc.d/init.d/functions | egrep -o "^/.*/\b"
1 方法一:last |grep ^root |tr -s ‘ ‘ |cut -d ‘ ‘ -f3 |grep ^[0-9] |sort |uniq -c 2 方法二:last |grep ^root |egrep -o "([0-9]{1,3}\.){3}[0-9]{1,3}" |sort |uniq -c
1 echo {0..1000} |egrep -o "\b[0-9]\b" 0-9 2 echo {0..1000} |egrep -o "\b[0-9]{2}\b" 10-99 3 echo {0..1000} |egrep -o "\b[1][0-9]{2}\b" 100-199 4 echo {0..1000} |egrep -o "\b[2][0-4][0-9]\b" 200-249 5 echo {0..1000} |egrep -o "\b[2][5][0-5]\b" 250-255
1 ifconfig |grep netmask |tr -s ‘ ‘|cut -d ‘ ‘ -f3
1 echo "welcome to magedu linux" |tr -d ‘ ‘ |grep -o "." |sort |uniq -c |sort -nr |tr -s " " |cut -d " " -f3 |tr "\n" " ";echo
标签:list inux code lin 文件中 test conf 地址 利用
原文地址:http://www.cnblogs.com/keerya/p/7254091.html