Saturday 12, Apr 2025
We are moved to new domain
Click -> www.ehowtonow.com
Wednesday, 6 September 2017

egrep Linux Command

egrep

egrep [options] [regexp] [files]
Search one or more files for lines that match an extended regular expression regexp. egrep doesn't support the regular expressions \(, \), \n, \<, \>, \{, or \}, but it does support the other expressions, as well as the extended set +, ?, |, and ( ). Remember to enclose these characters in quotes. Regular expressions are described in Chapter 7. Exit status is 0 if any lines match, 1 if none match, and 2 for errors.

See grep for the list of available options. Also see fgrep.

Examples

Search for occurrences of Victor or Victoria in file:
egrep 'Victor(ia)*' file egrep '(Victor|Victoria)' file
Find and print strings such as old.doc1 or new.doc2 in files, and include their line numbers:
egrep -n '(old|new)\.doc?' files

Shop and help us

Flipkart Offer Snapdeal offer Amazon.in offer Amazon.com offer

Related Posts:

  • showkey Linux Command showkey showkey [options] Print keycodes, scancodes, or ASCII codes of keys pressed on the keyboard. The default is to show keycodes. In keycode and scancode mode, the program terminates 10 seconds after the last key is pr… Read More
  • paste Linux Command paste paste [options] files Merge corresponding lines of one or more files into tab-separated vertical columns. Use - to read from standard input, instead of specifying a file. See also cut, join, and pr. Options -dchar, … Read More
  • mcopy Linux Command mcopy mcopy [options] sourcefile target Copy files between Unix and MS-DOS format partitions. See cp and mtools for more information. Multiple source files can be specified and written to a target directory. Options The m… Read More
  • iptables Linux Command iptables iptables command [options] System administration command. Configure netfilter filtering rules for kernels 2.4 and later. Rules for iptables consist of some matching criteria and a target, a result to be applied if… Read More
  • lockfile Linux Command lockfile lockfile [options] filenames Create semaphore file(s), used to limit access to a file. When lockfile fails to create some of the specified files, it pauses for eight seconds and retries the last one on which it fa… Read More
  • Blogger Comments
  • Facebook Comments
  • Disqus Comments

0 comments:

Post a Comment

Item Reviewed: egrep Linux Command Rating: 5 Reviewed By: eHowToNow