LPIC-1 Exam 101 (Linux Administrator) — Question 28
Which of the following commands will NOT update the modify timestamp on the file /tmp/myfile.txt?
Answer options
- A. file /tmp/myfile.txt
- B. echo "Hello" >/tmp/myfile.txt
- C. sed -ie "s/1/2/" /tmp/myfile.txt
- D. echo -n "Hello" >>/tmp/myfile.txt
- E. touch /tmp/myfile.txt
Correct answer: A
Explanation
The command 'file /tmp/myfile.txt' is used to determine the type of the file and does not alter its contents or modify timestamp. In contrast, the other options either overwrite the file or append data to it, which will update the modification timestamp accordingly.