12.2k views
5 votes
You have a file named "students.txt" that lists the names of all the students in the schoolsystem. You want to count how many of the names (either first or last) contain Franklin. Which command would do this for you?

User Irishbuzz
by
4.3k points

1 Answer

7 votes

Answer:

grep -c Franklin students.txt

Step-by-step explanation:

The grep command in Unix/Linux is the short form of 'global search for the regular expression' is usually used as a filter to search for text or for lines in a given file that will match a given string or words.

In the given filename "Franklin students.txt" to count how many names that contain Franklin, the command grep -c Franklin students.txt will search for texts in the file that will match the string "Franklin".

User Kaya
by
4.2k points