One Day One GNU/Linux Command (TOUCH)

2 views
Skip to first unread message

Bharathi Subramanian

unread,
May 12, 2008, 1:57:47 AM5/12/08
to GNU/Linux User Group of TCE, GNU/Linux Users Group - Trichy, VEC-FOSS
One Day One GNU/Linux Command
=============================

touch - Change File Timestamps

Summary :

Update the access and modification times of each FILE to the current
time. If FILE not exist, then it will create an empty file with that
name.

Examples :

$ touch myfile -- Set the time stamp to current time.

$ touch -c myfile -- Same as above. But if myfile not exist, then
it won't create it.

$ touch -r f1 f2 -- Set f1's time to f2 instead of current time.

$ touch -r f1 -B 5 f2 -- Set f2's time to 5 secs older then f1.

$ touch -r f1 -F 5 f2 -- Set f2's time to 5 secs newer then f1.

$ touch -a myfile -- Change only access time.

$ touch -m myfile -- Change only the modification time.

$ touch -t 200412251122.33 -- Set this time instead of current time.

$ ls -lu myfile -- Shows the last access time.

Read : man touch

HTH :)
--
Bharathi S

Reply all
Reply to author
Forward
0 new messages