LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (http://www.linuxquestions.org/questions/linux-software-2/)
-   -   displaying file access times in console (http://www.linuxquestions.org/questions/linux-software-2/displaying-file-access-times-in-console-107875/)

k4zau 10-24-2003 12:56 AM

displaying file access times in console
 
ls -l only displays the modification time for files, right? i want to be able to see the time a file was last accessed without using one of KDE's tools. is there a command that shows all the known information for an individual file?

slakmagik 10-24-2003 01:24 AM

ls -lu shows access time. I don't think there's any single option that shows *everything* at once - that'd be a lot of stuff.

k4zau 10-24-2003 12:36 PM

thanks, that gave me the info i needed. ls -lu works fine for that purpose.
i'm going to write a shell script to make it quicker to do.

i looked in O'Reilly's "Linux in a Nutshell" and apparently there is a command called 'stat' that displays all the inode information for a given file, including modification and access times. although it doesn't seem to be on my system.

slakmagik 10-24-2003 08:28 PM

Sure is. Thanks in return. :) In Slack it's part of coreutils-5.0 and is in /usr/bin. One day I'll actually know what every file on the system does. Heh.

Output looks like so

Code:

  File: `statfile'
  Size: 0              Blocks: 0          IO Block: 4096  regular empty file
Device: 344h/836d      Inode: 4135        Links: 1   
Access: (0600/-rw-------)  Uid: ( 1000/      user)  Gid: (  100/  users)
Access: 2003-10-24 20:26:27.000000000 -0400
Modify: 2003-10-24 20:26:27.000000000 -0400
Change: 2003-10-24 20:26:27.000000000 -0400


k4zau 10-26-2003 11:48 PM

glad to know that it actually exists. it seems to me that redhat doesn't include all the little console apps that any decent Unix system would. i have an old 486 box at home running Slack 8.1 and i remember using a lot of utilities on it that are nowhere to be found on my redhat machine. thanks for the tip.


All times are GMT -5. The time now is 09:31 AM.