Computer Science - Unix - Discussion
Discussion Forum : Unix - Section 1 (Q.No. 22)
22.
Which of the following commands is used to update access and modification times of a file?
Discussion:
6 comments Page 1 of 1.
Ganesh said:
1 decade ago
Explain how?
Reetu said:
1 decade ago
How touch command update access?
Thiru said:
1 decade ago
I agree with Reetu
S.R.R. said:
1 decade ago
Touch:
-a, change the access time only.
-c, if the file does not exist, do not create it and do not report this condition.
-d date_time, use the date_time specified to update the access and modification times.
-m, change the modification time only.
-r file, use the access and modification times of file.
-t time, use the time specified (in the format below) to update the access and modification times.
-a, change the access time only.
-c, if the file does not exist, do not create it and do not report this condition.
-d date_time, use the date_time specified to update the access and modification times.
-m, change the modification time only.
-r file, use the access and modification times of file.
-t time, use the time specified (in the format below) to update the access and modification times.
Raj said:
9 years ago
How touch command update access of file?
Saurabh said:
9 years ago
There are various options with touch I will be talking about -m (modification time).
Let say you created a file and modified it at 12.
Use the command "stat file_name" it will give details about access, modify and change time it will show the modify time as 12.
Now let say at 12 : 30 you enter the command "touch -m file_name" it will change the modify time to 12 :30.
You can check that by "stat file_name".
Let say you created a file and modified it at 12.
Use the command "stat file_name" it will give details about access, modify and change time it will show the modify time as 12.
Now let say at 12 : 30 you enter the command "touch -m file_name" it will change the modify time to 12 :30.
You can check that by "stat file_name".
Post your comments here:
Quick links
Quantitative Aptitude
Verbal (English)
Reasoning
Programming
Interview
Placement Papers