View source for GenWikiLinux
Jump to:
navigation
,
search
[https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard Standard directory naming] == GREP == grep [OPTIONS] "REGEXP" [FILES(s)] *"REGEXP" can be any [[Regular Expression]] *Single or double quotes can be used. *Quotes can be omitted if there are no spaces in the search term. *If file is omitted, all files in current dir are searched. *Multiple files can be specified separated by spaces or wildcarded (*.txt) *''While most tutorials assume that you are going to specify a file to search, using the search feature in vi makes more sense for working with a single file.'' OPTIONS: -i ignore case -n print line #s -l just show filenames -x exact matches only -w match whole words only -m, --max-count=NUM stop after NUM matches -a text files only -r recursive files inclusion '''egrep''' supports pipes ("or") (= grep -E) egrep "fruit|bread" '''fgrep''' (fast grep, simple text, no RegEXp) (= grep -F) Can pipe the output of another command ls |grep blah lists all files in the current directory whose names contain the string "blah"
Return to
GenWikiLinux
.
Personal tools
Log in
Namespaces
Page
Discussion
Variants
Views
Read
View source
View history
Actions
Search
Navigation
Main page
Recent changes
Random page
Tools
What links here
Related changes
Special pages