LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
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.

Notices


Reply
  Search this Thread
Old 05-22-2006, 04:35 AM   #1
activeco
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, 06:37 AM   #2
jschiwal
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".
Code:
$ 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 06:40 AM.
 
Old 05-22-2006, 06:51 AM   #3
activeco
LQ Newbie
 
Registered: Sep 2005
Location: Milky Way
Posts: 14

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

Thanks a lot jschiwal.

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

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:26 PM.

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