LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Timestamp Help (https://www.linuxquestions.org/questions/linux-newbie-8/timestamp-help-344678/)

jch02140 07-19-2005 11:17 AM

Timestamp Help
 
Does anyone know how I can change a timestamp of the modification time or access time without changing the other?

Kdr Kane 07-19-2005 12:55 PM

touch -a -m

man touch

jch02140 07-19-2005 01:07 PM

I have tried touch -a <199501052126> test.txt and
touch -m 200311251030 text.txt but after I press enter the date revert back to the current date and time...

Did I do something wrong?

Kdr Kane 07-19-2005 01:23 PM

Are you the owner of the file?

If not, run it as root.

jch02140 07-19-2005 01:52 PM

I have all the read, write, and execute permission.

How do I run it as root?...

cj24900 03-16-2006 12:12 PM

You have to log in as root.

rickh 03-16-2006 12:17 PM

Double posting under two different user names is still double posting.

timmeke 03-17-2006 02:33 AM

Read the man pages. It clearly says you need to put -t before you give the timestamp.

So, correct command is:
Code:

touch -m -t 200311251030 text.txt


All times are GMT -5. The time now is 05:28 AM.