Well, here can not complain because of network reasons, several times to write blog is the speed of the good coax to back, Dan Hurt Ah!
1 (1) grep "^[[:alpha:]]*"/proc/meminfo
(2)
grep "^[a-za-z]\+"/proc/meminfo
2 Grep-v ". *\/sbin\/nologin. *"/etc/passwd | Cut-d:-f1
Grep-v ". *\/sbin\/nologin$"/etc/passwd | Cut-d:-f1
3 grep ". *\/bin\/bash. *"/etc/passwd | Cut-d:-f1
grep ". *\/bin\/bash$"/etc/passwd | Cut-d:-f1
4 grep "\<[[:d igit:]][[:d igit:]]\>"/etc/passwd--color=auto
grep "\<[[:d igit:]]\{2\}\>"/etc/passwd--color=auto
5
grep "^[[:space:]]\{1,\}.*"/boot/grub/grub.conf grep "^[[:space:]]\+"
6 Displays the default shell for root, fedora, or User1 users on the current system
Egrep--color "^root|^fedora|^user1"/etc/passwd | cut-d:-f1,7 egrep--color "^ (root|fedora|user1) \>"/etc/passwd | Cut-d:-f1,7
7 Find the line after a word in the/etc/rc.d/init.d/functions file followed by a set of parentheses, such as: Hello ()
Egrep--color=auto "*\<[[:alnum:]]+\>\ (\)"/etc/rc.d/init.d/functions |cut-d "-f1
- o option
8 echo "/etc/sysconfig" | Grep
# basename/etc/sysconfig/
Sysconfig
echo "Etc/sysconfit/net-scripts" | Egrep--color=auto "*[^/]+$"
# Basename/etc/sysconfig
Sysconfig
Extension: Take out its path name
9 find the number between 1-255 in the ifconfig command result
Ifconfig | Egrep "\< ([0-9]|[ 1-9][0-9]|1[0-9][0-9]|2[0-5][0-5]) \> "--color=auto
10 Challenge: Write a pattern to match a reasonable IP address
11 Challenge: Write a pattern to match all email addresses
Because the specific e-mail address rules are unknown, so the following is written by themselves, feel good
Egrep--color=auto "^[[:alnum:]]+ (_?[ [: Alnum:]] +) {0,}@ ([[: Alnum:]]+\.) {0,} [[: alnum:]]+$] Matchmail.regexp
This article is from the "Ops Dog" blog, make sure to keep this source http://yunweigou.blog.51cto.com/6299641/1632012
8 Linux grep