LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > AIX
User Name
Password
AIX This forum is for the discussion of IBM AIX.
eserver and other IBM related questions are also on topic.

Notices

Reply
 
Search this Thread
Old 02-22-2006, 08:24 AM   #1
Uday123
Member
 
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, 08:39 AM   #2
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,415

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

Rep: Reputation: 53
Code:
ls -l
long output format

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

Rep: Reputation: 30
Post ls -al

Better ls -al
 
Old 02-23-2006, 03:55 AM   #5
Uday123
Member
 
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, 10:42 AM   #6
Mark Taylor
Member
 
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

Rgds
Mark Taylor
 
Old 02-23-2006, 09:26 PM   #7
shadow5277
Member
 
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.

shadow5277
 
  


Reply


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 08:42 PM
backup from date keep directory structure secretlydead Linux - General 1 09-30-2005 04:51 PM
GTKMM - Compilation Errors - Can't find files or Directory sixtensixone Programming 3 04-06-2005 11:06 AM
How to sort files in a directory by date in KDE? Ace_Azzameen Linux - Software 7 05-24-2004 03:49 PM
Find string pattern in directory of text files magnum818 Linux - Newbie 2 10-15-2003 09:19 PM


All times are GMT -5. The time now is 02:57 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration