Welcome to the most active Linux Forum on the web.
Go Back > Forums > Other *NIX Forums > AIX
User Name
AIX This forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.


  Search this Thread
Old 02-22-2006, 07:24 AM   #1
Registered: Nov 2005
Posts: 80

Rep: Reputation: 15
How to find the date for all the files in a directory

Hi all,

I know the command 'ls' will give the list of files existing in a directory.but i want to know which option will give the complete date(2006-02-08) and time(15:06).

Please help me ASAP.
Old 02-22-2006, 07:39 AM   #2
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975Reputation: 1975
you never heard of a manpage?? ls -l
Old 02-22-2006, 07:40 AM   #3
Senior Member
Registered: Sep 2005
Location: Out
Posts: 3,307

Rep: Reputation: 55
ls -l
long output format

To have more info:
man ls
Old 02-22-2006, 02:03 PM   #4
Registered: Feb 2006
Location: India
Posts: 167

Rep: Reputation: 31
Post ls -al

Better ls -al
Old 02-23-2006, 02:55 AM   #5
Registered: Nov 2005
Posts: 80

Original Poster
Rep: Reputation: 15
Hi all,

Thanks for ur help.I know ls,man ls ,ls -al,ls -l etc.
But my question is for AIX. Can u plz try on ur AIX machine and let me know if it(ls -al,ls -l etc.) works.
I need complete date(2006-02-08) and time(15:06)of all the files in a directory.
Old 02-23-2006, 09:42 AM   #6
Mark Taylor
Registered: Apr 2004
Posts: 60

Rep: Reputation: 15
from the "ls" man pages -->

-l (Lower case L) Displays the mode, number of links, owner, group, size (in bytes), and time of last modification for each file. If the file is a special file, the size field contains the major and minor device numbers. >>>>> If the time of last modification is greater than six months ago, the time field is shown in the format month date year where as files modified within six months the time field is shown as month date time format <<<<<

So, use istat or write a script that uses "perl->stat()" function

Mark Taylor
Old 02-23-2006, 08:26 PM   #7
Registered: Aug 2005
Location: Texas
Distribution: Redhat FC4, Fedora 8 and AIX 5.3, AIX 6.1
Posts: 39

Rep: Reputation: 16
To find the complete time.

Hello Uday123,

what you will need to do is use the istat command on aix and it will give you the info over the file about access time mod time a nd creation time. You will have to write a script to make istat run on all of the files.



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
Using Bash, Find script files in a directory or subdirectories within... ray5_83 Programming 4 10-10-2008 07:42 PM
backup from date keep directory structure secretlydead Linux - General 1 09-30-2005 03:51 PM
GTKMM - Compilation Errors - Can't find files or Directory sixtensixone Programming 3 04-06-2005 10:06 AM
How to sort files in a directory by date in KDE? Ace_Azzameen Linux - Software 7 05-24-2004 02:49 PM
Find string pattern in directory of text files magnum818 Linux - Newbie 2 10-15-2003 08:19 PM > Forums > Other *NIX Forums > AIX

All times are GMT -5. The time now is 06:08 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration