Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 05-22-2006, 05:35 AM   #1
LQ Newbie
Registered: Sep 2005
Location: Milky Way
Posts: 14

Rep: Reputation: 0
Touch can't change access time

Actually it does, but not to the time specified.

I wanted to change access time of a file with the command:

touch -a -t 0505051559 filename

however the result returned with 'ls -cl' is always the (current) time of the last touch command.

What do I miss?
Old 05-22-2006, 07:37 AM   #2
LQ Guru
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682Reputation: 682
To list the access time, use "ls -l --time=atime".
$ echo :>sample
$ ls -l sample
-rwxr-xr-x 1 schiwalj mkpasswd 2 May 22 06:38 sample
$ touch -a -t 0505051559 sample
$ ls -l --time=atime sample
-rwxr-xr-x 1 schiwalj mkpasswd 2 May  5  2005 sample

Last edited by jschiwal; 05-22-2006 at 07:40 AM.
Old 05-22-2006, 07:51 AM   #3
LQ Newbie
Registered: Sep 2005
Location: Milky Way
Posts: 14

Original Poster
Rep: Reputation: 0
Originally Posted by jschiwal
To list the access time, use "ls -l --time=atime".
Now I understand what they mean with "--time=WORD" from 'man ls'.

Thanks a lot jschiwal.

Last edited by activeco; 05-22-2006 at 08:01 AM.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Need ACCESS to change files! Every time I try to change a setting,"Permission Denied" Balarabay1 SUSE / openSUSE 2 03-06-2006 10:54 AM
Disable access to Time change yunus.raza Linux - Security 1 05-16-2005 01:10 PM
Time without touch the keyboard or move the mouse fariz83 Programming 0 03-28-2004 01:28 AM
Can't enable touch-pad and usb-mouse at the same time... Beavis_73 Linux - Laptop and Netbook 2 03-01-2004 07:40 PM
Change access time of files via c-program code 10gecko66 Linux - General 2 01-15-2004 10:51 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:52 PM.

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