GenWikiLinux

From birchyHistory
Jump to: navigation, search
Line 3: Line 3:
  
 
== GREP ==
 
== GREP ==
  grep [options] "foo" [file(s)]
+
  grep [OPTIONS] "foo" [FILES(s)]
  
*You can omit the quotes if there are no spaces in the search term.
+
*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.
 
*If file is omitted, all files in current dir are searched.
 
*Multiple files can be specified separated by spaces or wildcarded (*.txt)
 
*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.''''
+
*''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
 
  -i  ignore case
 
  -n  print line #s
 
  -n  print line #s
Line 20: Line 22:
  
  
foo can be any [[Regular Expression]]
+
"foo" can be any [[Regular Expression]]
 
+
  
 
egrep supports pipes ("or") (= grep -E)
 
egrep supports pipes ("or") (= grep -E)

Revision as of 12:41, 12 September 2015

Personal tools
Namespaces

Variants
Actions
Navigation
Tools