350-201 Question 273
Single answerYou are investigating a potential unauthorized modification to a critical configuration file on a Linux-based server. You suspect that the file's timestamp might provide clues about when the change occurred. Which Bash command would you use to view the last modification time of the file?
- A
cat <file_name>
- B
ls -l <file_name>
- C
echo $PATH
- D
chmod 644 <file_name>
Show answer and explanation
Correct answer: B
Explanation
The 'ls -l <file_name>' command is used to list detailed information about a file, including its size, permissions, owner, group, and last modification timestamp. This makes it an appropriate choice for investigating when a file was last modified, which is crucial in cybersecurity investigations.
- A. Incorrect.
This command displays the contents of the file but does not provide information about the file's modification time.
- B. Correct.
This command lists detailed information about the file, including the last modification time, making it the correct choice.
- C. Incorrect.
This command displays the current value of the PATH environmental variable and is unrelated to file modification timestamps.
- D. Incorrect.
This command is used to change file permissions and does not provide any information about the file's modification time.