What is the primary purpose of the 'grep' command?
- A.To search for text patterns within files
- B.To compress files
- C.To change file permissions
- D.To display disk usage
Why A is correct
grep (Global Regular Expression Print) searches for text patterns in files or command output. For example, 'grep error /var/log/syslog' finds all lines containing 'error' in the syslog file. It is one of the most essential tools for log analysis and security investigations.
Know someone studying for Security Fundamentals? Send them this one.