sign in
|
add example
|
see also:
gzip
,
zgrep
,
read
,
pcrepattern
,
terminfo
,
regex
grep
print lines matching a pattern
[
package
|
man 1
|
usage
|
info
|
wiki
|
homepage
]
examples
configs
questions
[
new example
]
copy
169
11
grep -w -e '(.)(.).21' file
grep
details
|
copy
53
6
grep -rH --include='*.c' 'hello' /home/gigi
grep
details
|
copy
46
4
grep -w 'hello' *
grep
details
|
copy
43
13
grep --label=foo something
grep
details
|
copy
36
3
grep -E -e '^(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?)(.?).?987654321$' file
grep
details
|
copy
33
3
grep -H 'eli' /etc/passwd
grep
details
|
copy
28
2
grep -e '--cut here--' *
grep
details
|
copy
23
0
ls -l | grep '^d' | awk '{print "rm -r "$9}' | sh
Remove only the directories
awk
grep
ls
8 years, 1 month ago
john2
0 |
details
|
copy
22
7
grep -C 2 'hello' *
grep
details
|
copy
21
1
grep -l 'main' *.c
grep
details
|
copy
18
0
dd if=/dev/mem | hexdump -C | grep 'default'
To search memory for the string default
dd
grep
hexdump
details
|
copy
17
2
grep -r 'hello' /home/gigi
grep
details
|
copy
15
0
grep -R root *
look for the keyword root in all files recursively form the current directory
grep
8 years, 1 month ago
john
0 |
details
|
copy
13
1
grep -rH 'hello' *.c
grep
details
|
copy
13
0
Check if your computer is 32 or 64bit
grep --color=always -iw lm /proc/cpuinfo
if you see "lm" in the out put your computer is 64bit
grep
64bit
arch
6 years, 9 months ago
gitweb
0 |
copy
12
0
cat /var/log/apache/access_log | grep 404
Look for 404 logs in apache
cat
grep
8 years, 1 month ago
john
0 |
details
|
copy
11
0
grep --binary-files=text
grep
source
|
details
|
copy
11
0
echo 1 2 3 4 | grep 4
look for occurrences of 4 in 1 2 3 4
echo
grep
8 years, 1 month ago
john
0 |
details
|
copy
8
0
cat /etc/passwd | grep root
look for the root user in /etc/passwd
cat
grep
8 years, 1 month ago
john
0 |
details
|
copy
7
0
grep -P
grep
source
|
details
|
[
new config
]
[
ask question
]