← BYTES
Troubleshooting·Starter·Ref: 16.1.9
What is the purpose of the `grep` command when searching log files?
Have a question about this video? Mention reference 16.1.9 when you contact us.
a.To search text for lines matching a given pattern (e.g., 'ERROR' or 'timeout'), printing just the matching lines
b.To delete lines containing a pattern
c.To sort a file alphabetically
d.To count the total number of files in a directory
`grep` filters input (often piped from a log file or another command) down to only the lines matching a given pattern -- e.g., `grep ERROR app.log` quickly surfaces every error line in a large log without manually scanning through everything else.
Find this on YouTube & Instagram
Every BYTES video is tagged with its reference number and topic — search any of these on YouTube or Instagram to find this one:
#BYTES#BYTES1619#Troubleshooting