Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

ls -u

Status
Not open for further replies.

ddrillich

Technical User
Joined
Jun 11, 2003
Messages
546
Location
US
Good Day,

man ls says the following about the –u option:

-u Uses time of last access instead of last modification for sorting (with the -t option) or printing (with the -l option).

Does anybody know the definition of "last access"?


$ ls -lu
total 426
-rw-r--r-- 1 vgnadmin vgnadm 1143 Mar 6 00:01 caCertificate.txt
-rw-r--r-- 1 vgnadmin vgnadm 62335 Mar 6 00:01 confSSLws.txt
-rw-r--r-- 1 vgnadmin vgnadm 27220 Mar 6 00:01 configureSSLws.txt
-rw-r--r-- 1 vgnadmin vgnadm 124 Mar 6 00:01 local.cshrc
-rw-r--r-- 1 vgnadmin vgnadm 607 Mar 6 00:01 local.login
-rw-r--r-- 1 vgnadmin vgnadm 582 Mar 6 00:01 local.profile
-rw-r--r-- 1 vgnadmin vgnadm 0 Jan 12 16:30 nohup.out
-rw-r--r-- 1 vgnadmin vgnadm 112363 Mar 6 00:01 unconfigureWS.txt
$ ls -lt
total 426
-rw-r--r-- 1 vgnadmin vgnadm 0 Jan 12 16:30 nohup.out
-rw-r--r-- 1 vgnadmin vgnadm 112363 Dec 28 18:19 unconfigureWS.txt
-rw-r--r-- 1 vgnadmin vgnadm 62335 Dec 28 18:19 confSSLws.txt
-rw-r--r-- 1 vgnadmin vgnadm 27220 Dec 28 17:47 configureSSLws.txt
-rw-r--r-- 1 vgnadmin vgnadm 1143 Dec 28 16:54 caCertificate.txt
-rw-r--r-- 1 vgnadmin vgnadm 124 Aug 4 2005 local.cshrc
-rw-r--r-- 1 vgnadmin vgnadm 607 Aug 4 2005 local.login
-rw-r--r-- 1 vgnadmin vgnadm 582 Aug 4 2005 local.profile

Regards,
Dan
 
Hi Dan. My understanding is that it's the time the file was last accessed by any application or OS process which makes use of it.
 
The stat man page under
st_atime specifies which system calls update that field:

st_atime
Time when file data was last accessed. Changed by the
following functions: creat(), mknod(), pipe(),
utime(2), and read(2)

So creating the file, or reading. But if the
file is previously created and you move it, no.

gene

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top