当前位置: 技术问答>linux和unix
UNIX命令
来源: 互联网 发布时间:2015-01-30
本文导语: 我想请教UNIX高手,关于GREP,EGREP,FGREP有什么作用,输入的格式又是怎么样的呢?谢谢 我还想问问,象我这样的初学UNIX的人应该买什么样的书来学习呢?! | 呵呵,初学者就随便一本书都行的...
我想请教UNIX高手,关于GREP,EGREP,FGREP有什么作用,输入的格式又是怎么样的呢?谢谢
我还想问问,象我这样的初学UNIX的人应该买什么样的书来学习呢?!
我还想问问,象我这样的初学UNIX的人应该买什么样的书来学习呢?!
|
呵呵,初学者就随便一本书都行的.
|
grep/egrep/fgrep search a file for a pattern. It can support Regular expression. You need to learn regular expression to find it's powerful function.
syntax:
grep [-E|-F] [-c|-l|-q] [-bhinsvwx] pattern [file ...]
egrep [-cefilnsv] [expression] [file ...]
fgrep [-cefilnsvx] [strings] [file ...]
egrep/fgrep are provided for backward compatibility.
You need to buy a book to learn or read man carefully. A simple e.g.:
grep timeval *.h
The command can list all the lines in the .h files that contains timeval.
UNIX In A NutShell
syntax:
grep [-E|-F] [-c|-l|-q] [-bhinsvwx] pattern [file ...]
egrep [-cefilnsv] [expression] [file ...]
fgrep [-cefilnsvx] [strings] [file ...]
egrep/fgrep are provided for backward compatibility.
You need to buy a book to learn or read man carefully. A simple e.g.:
grep timeval *.h
The command can list all the lines in the .h files that contains timeval.
UNIX In A NutShell
|
跟你简单说说GREP吧,搜索当前路径下所有文件中的ABC串方法:
grep abc *
grep abc *
|
使用帮助吧!
man grep
man grep
|
其实帮助的英文不是很难,只是你刚接触,慢慢就熟悉了。按帮助列出来的语法多试几次就明白了。
|
一般来说MAN的参数就是你所要查找的函数名,不过有时还得加上页数.