LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 07-19-2005, 11:17 AM   #1
jch02140
LQ Newbie
 
Registered: Jul 2005
Posts: 15

Rep: Reputation: 0
Timestamp Help


Does anyone know how I can change a timestamp of the modification time or access time without changing the other?
 
Old 07-19-2005, 12:55 PM   #2
Kdr Kane
Member
 
Registered: Jan 2005
Distribution: SUSE, LFS
Posts: 357

Rep: Reputation: 30
touch -a -m

man touch
 
Old 07-19-2005, 01:07 PM   #3
jch02140
LQ Newbie
 
Registered: Jul 2005
Posts: 15

Original Poster
Rep: Reputation: 0
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?
 
Old 07-19-2005, 01:23 PM   #4
Kdr Kane
Member
 
Registered: Jan 2005
Distribution: SUSE, LFS
Posts: 357

Rep: Reputation: 30
Are you the owner of the file?

If not, run it as root.
 
Old 07-19-2005, 01:52 PM   #5
jch02140
LQ Newbie
 
Registered: Jul 2005
Posts: 15

Original Poster
Rep: Reputation: 0
I have all the read, write, and execute permission.

How do I run it as root?...
 
Old 03-16-2006, 12:12 PM   #6
cj24900
LQ Newbie
 
Registered: Mar 2006
Posts: 5

Rep: Reputation: 0
You have to log in as root.
 
Old 03-16-2006, 12:17 PM   #7
rickh
Senior Member
 
Registered: May 2004
Location: Albuquerque, NM USA
Distribution: Debian-Lenny/Sid 32/64 Desktop: Generic AMD64-EVGA 680i Laptop: Generic Intel SIS-AC97
Posts: 4,250

Rep: Reputation: 62
Double posting under two different user names is still double posting.
 
Old 03-17-2006, 02:33 AM   #8
timmeke
Senior Member
 
Registered: Nov 2005
Location: Belgium
Distribution: Red Hat, Fedora
Posts: 1,515

Rep: Reputation: 61
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

Last edited by timmeke; 03-17-2006 at 02:34 AM.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
timestamp in the future comprookie2000 Linux - General 5 05-19-2011 05:45 AM
Unix Timestamp Nargile Linux - Software 1 03-17-2005 09:07 PM
Timestamp inconsistencies J.W. LQ Suggestions & Feedback 3 03-07-2005 04:47 PM
Compilation Timestamp gr33ndata Programming 3 10-16-2004 05:00 PM
syslog timestamp skitzsofrenick Solaris / OpenSolaris 2 03-04-2004 10:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 12:47 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration