What are the differences among grep, egrep and fgrep? How to search for files by file names? And how to search for files with specific texts in content? What are the default separators for utility awk and sort? And how to define a new separator for them respectively in the command? What is the output of the following sequence of bash commands: echo\'Hello World\' |sed \'s/$/Welcome/g\' a. WelcomeHello World b. HelloWelcome World c. Hello WorldWelcome d. Welcome e. None of above Which awk command outputs the 5th field of lines that have at least five fields. a. 5 = 5 {print $5} c./$5/{print $4} d./$5!= \"\"/{print $4} e. None of above What is the output on your screen after trying following command line: echo CSC3320 | sed -n \'s/CSC/CSc/p\' a. no output on screen b. Csc c. CSc3320 d. CSC3320 e. None of above Which awk command outputs all lines where a dollar sign $ appears at the beginning of line? a./^$/{print $0} b./$$/{print $0} c./$A/{print $0} d./^\\$/{print $0} e. None of above Which command below delete the first 5 lines of \"file\"? a. sed \'5 d\' file b. sed \'5 p\' file c. sed \'1, 5 d\' file d.sed \'5, $ d\' file e. None of above
[1] Difference Between grep, egrep (Extended GREP), fgrep (Fixed GREP
1. egrep and fgrep are derived from the base grep command. .egrep is encoded as “grep-e” and “fgrep” is encoded as “grep-f.”
2. egrep command allows the use of extended regular expressions
3. grep only searches for the matching word or term that the user specified in the command.
4. The frep doesn’t recognize or understand regular or extended regular expression.
[2] Search By name
--> find -name file_name
Search By texts
--> grep search_string directory_path
[3] For AWK space by default and For SORT Blank space is the default field separator.
To define New Separator
For AWK define a field separator by using the \"-F\"
Ex - awk -F# \'{print $1}\' (Now filed separator is #)
For SORT define a field separator by using the \"-t\"
[4]
[1] [c] Hello WorldWelcome
[2] [b] FN >={print $5}
[3] [c] CSc3320
[4] [c]/$^{print $0}
[5] [c] sed \'1,5d\' file