Give a regular expression that finds two things, try to
come up with regular expressions that find each
individually using "egrep" command?

Answer Posted / niranjan

Gud command egrep but it not available in all unix flaviours.

grep -e option do the same as egrep

syntax:-
egrep 'pattern1|pattern2|pattern3' filename

grep -e 'pattern1' -e 'pattern2' -e 'pattern3' filename

Is This Answer Correct ?    2 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the terms ‘system calls’ and ‘library functions’ with respect to unix commands?

759


How do I open a port?

662


What does 'mkdir' command do in UNIX?

762


What are grep patterns?

674


What is the command to find hidden files in the current directory?

691






What is a command and examples?

677


What difference between cmp and diff commands?

819


What is {} in find command?

661


What is rmdir command?

656


Which unix command lists files/folders in alphabetical order?

692


What is the difference between cat command and more command?

676


How do you grep recursively?

655


What does grep v grep do?

637


how to sort the content of the file based on numeric values

1375


Explain how to use grep command to list find the records of a file containing 10 different strings?

682