PrepAway - Latest Free Exam Questions & Answers

Which of the following commands will John use to accomplish his task?

John works as a Network Administrator for Perfect Solutions Inc. The company has a Linux-based network. John is working
as a root user on the Linux operating system. He wants to change the modified date and time of the file private.txt to 11
Nov 2009 02:59:58 am. Which of the following commands will John use to accomplish his task?
Each correct answer represents a complete solution. Choose all that apply.

PrepAway - Latest Free Exam Questions & Answers

A.
touch -d "11 Nov 2009 02:59:58 am" private.txt

B.
touch -t 200911110259.58 private.txt

C.
rm private.txt #11 Nov 2009 02:59:58 am

D.
touch private.txt #11 Nov 2009 02:59:58 am

Explanation:
touch – change file timestamps
Update the access and modification times of each FILE to the current time.
Mandatory arguments to long options are mandatory for short options too.

-a
change only the access time
-B, –backward=SECONDS
Modify the time by going back SECONDS seconds. For example, touch -r foo -B 5 bar will make the file bar 5 seconds older than file foo.
-c, –no-create
do not create any files
-d, –date=STRING
parse STRING and use it instead of current time
-F, –forward=SECONDS
Modify the time by going forward SECONDS seconds. For example, touch -r foo -F 5 bar will make the file bar 5 seconds newer than file foo.
-f
(ignored)
-m
change only the modification time
-r, –reference=FILE
use this file’s times instead of current time
-t STAMP
use [[CC]YY]MMDDhhmm[.ss] instead of current time
–time=WORD
set time given by WORD: access atime use (same as -a) modify mtime (same as -m)
–help
display this help and exit
–version
output version information and exit

Note that the -d and -t options accept different time-date formats.


Leave a Reply