1 [root@localhost ~]# grep -E '^[sS]' /proc/meminfo 2 [root@localhost ~]# sed -r -n '/^[sS]/p' /proc/meminfo 3 [root@localhost ~]# awk '/^[sS]/{print $0}' /proc/meminfo 4 [root@localhost ~]# grep -iE '^s' /proc/meminfo
[root@localhost ~]# grep -rE '^(root|centos|user)' /etc/
[root@localhost ~]# grep -E '\(|\)' /etc/init.d/functions
[root@localhost /etc/sysconfig]# pwd | awk -F/ '{print $NF}'
[root@localhost /etc/sysconfig]# grep -oE '[0-9]+' /etc/sysconfig/network-scripts/ifcfg-eth[01]
[root@localhost /etc/sysconfig]# awk -F: '{arr[$NF]++}END{for(i in arr){print i,arr[i]}}' /etc/passwd
1 [root@localhost /etc/sysconfig]# ip a | grep -oE '([0-9]{1,3}\.){3}[0-9]{1,3}' 2 [root@localhost /etc/sysconfig]# ip a | sed -r -n '/([0-9]{1,3}\.){3}[0-9]{1,3}/p' 3 [root@localhost /etc/sysconfig]# ip a | awk '/([0-9]{1,3}\.){3}[0-9]{1,3}/{if(NR==3){print $2}else{print $2,$4}}'
[root@localhost ~]# grep -rE 'main' `find /etc/ -name "*.html" -o -name "*.php" | xargs ` | wc -l
1 [root@localhost ~]# yum install php php-devel 2 [root@localhost ~]# grep -vE '^\ *;|^$' /etc/php.ini
[root@localhost ~]# grep -E '\ +' /etc/php.ini
[root@localhost ~]# grep -E '^#\ +' /etc/fstab
[root@localhost ~]# grep -roE 'root' /etc/ | wc -l
[root@localhost ~]# grep -E '[0-9a-zA-Z-_]+@qq\.com'
[root@localhost ~]# grep -E 'error' /var/log/messages
[root@localhost ~]# grep -Ei '^s' 11.txt | grep -oE '[0-9a-zA-Z]+' | xargs | awk '{for(i=0;i<(NF-1);i++){print $i}}'
[root@localhost ~]# sed -r 's/[0-9]//g' 11.txt
[root@localhost ~]# awk -F: 'NR%2==1{print $0}' /etc/passwd
[root@localhost ~]# sed -r '/^bin/,/^nobody/d' /etc/passwd
[root@localhost ~]# awk -F: '{n=5;if(NR<n){print $0}else{if((NR-5)%2==0){print "---"};print $0}}' /etc/passwd
[root@localhost ~]# awk -F: '{if(NR%5==0){print " "}; print $0}' /etc/passwd
[root@localhost ~]# grep -vE 'g' 2.txt
[root@localhost ~]# sed -r '1,5s/aaa/AAA/g' 13.txt
[root@localhost ~]# awk -F: '$3%2==1{print $0}' /etc/passwd
[root@localhost ~]# awk -F: '$3>=1000{print $1, $3}' /etc/passwd
[root@localhost ~]# awk '/([0-9]{1,3}\.){3}[0-9]{1,3}/{arr[$1]++}END{for(i in arr){print i}}' access.log
[root@localhost ~]# grep -oE '[0-9a-zA-Z]+' /etc/php.ini | awk '{arr[$1]++}END{for(i in arr){printf "%-15s | %-5d\n", i, arr[i]}}'