How can I change the background and text colour How to Check for existence of a
ID: 3681949 • Letter: H
Question
How can I change the background and text colour How to Check for existence of a file? How to use nano editor to save a file? How to search using grep command? Print specifies lines using sed Understanding a time, c time and m time How to use find command and search by name, type,size? Print lines starting, ending or around matching pattern Backup existing data during my command How to create hardlinks in linux? How to create symlinks in linux? How to exact filename and dirname from give path? Create a file with vim editor Find files used by a process What happens when you open a file and delete it Why to use rsync instead of cp command? Want to see more of this?Explanation / Answer
grep is a command which is used for searching.
The syntax for usage is
grep [option] pattern [file....]
the example given by you
grep "S" -i *
which will search for the letter "S" in all the files and displays the line containing "S".
Now the option you have used is -i which is for ignore case. So it searched for "s" also.
Now if you want to change the display of the output, you can do by the following way.
You can use the following options.
-c which will supress the normal output and it will print the number of matching lines.
-n this option will also print the line number
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.