A systems administrator is performing administrative maintenance on macOS and Linux endpoints within an enterprise environment. The administrator needs to execute two specific command-line operations:
1. Recursively update both the user owner and group owner of the entire directory tree located at `/srv/appdata` to `sysadmin` on a Linux server.
2. Search through the system log `/var/log/auth.log` and display all lines that contain the exact phrase "Failed password" to audit security events.
Which of the following commands will successfully accomplish these tasks? (Select TWO.)
- sudo chown -R sysadmin:sysadmin /srv/appdataAnswer
- grep "Failed password" /var/log/auth.logAnswer
- Csudo chmod -R sysadmin:sysadmin /srv/appdata
- Dps aux | findstr "Failed password" /var/log/auth.log
Answer
The command 'sudo chown -R sysadmin:sysadmin /srv/appdata' successfully changes user and group ownership recursively, while 'grep "Failed password" /var/log/auth.log' searches for and extracts matching string entries from the designated authentication log.
Executing 'sudo chown -R sysadmin:sysadmin /srv/appdata' properly invokes superuser privileges to recursively change both the user owner and group owner of the specified directory path. Executing 'grep "Failed password" /var/log/auth.log' scans the authentication log file directly and outputs any lines containing the target string.
Step-by-Step Solution
Key Concept
macOS and Linux Command Line Utilities (chown, chmod, grep, ps)
Estimated Time:2m 0s