- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- File Listing with Date/Time Rephrase.
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2001 05:16 AM
01-05-2001 05:16 AM
Thanks for the replies but I'm not sure I was being clear enough. My user typically uses ll for getting time and date stamps on his output. Is there not a command, or combination of commands, that will list all files with date and time ?
Thanks again !
It's much appreciated!
Sincerely,
Pam Goodwin
Original Note Below --------------------
I'm hoping someone here can help me. I've got a user who's trying to list files in a directory but he requires the output to include a file's eight digit create date and 4-6 digit time stamp. Is this possible? I could not find any command which returned this information. Any guidance you could give me would be greatly appreciated.
Thank You In Advance,
Sincerely and Respectfully,
Pamela Goodwin
UNIX Systems Admin
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2001 05:27 AM
01-05-2001 05:27 AM
Re: File Listing with Date/Time Rephrase.
Most probably because you're new in this forum, you didn't know that you should "reply" to your own question if you want to clarify something instead of starting a new thread.
No problem, but hitting the "reply" button will help all of us as all relevant info is in the same thread.
Back to your problem:
'ls -lR' will recursively list all directories
dont type 'ls -lR /' as this will take a LONG time ;-)
another way of listing files in a tree is with using 'find', like this:
find /$where_from -type f -exec ll {} \;
note the escaped semicolon, it's needed !
replace $where_from with the top directory name from which you want to search for files.
You can even refine your 'find', using flags like -mtime or -atime for example:
find /$where_from -type f -mtime +7 -exec ll {} \;
will list all files who have been modified more than a week ago.
Have a look at manpage for 'find'. You'll surely discover something in there.
Best regards,
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2001 05:34 AM
01-05-2001 05:34 AM
Re: File Listing with Date/Time Rephrase.
Thanks in Advance.
~ Pam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2001 06:38 AM
01-05-2001 06:38 AM
Re: File Listing with Date/Time Rephrase.
If I understand your question, the problem is that the ll or ls -l commands do not show the time for files older than 6 months but show the year - and files that show the time do not show the year.
Also you would like the date and time in a YYYYMMDD HHMM format.
If this is so, then this would be best done with perl, but my perl is not that good, a search on the forum for perl and date would give you lots of examples!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2001 06:40 AM
01-05-2001 06:40 AM
Re: File Listing with Date/Time Rephrase.
The problem is that 'ls' and 'll' will only give the time if the date is less than 6 months old. Otherwise, only the date is given.
There was another post this morning where a similar question was asked and a perl script was given. I didn't check the script.
Here is the link:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,1150,0x51b5854994d9d4118fef0090279cd0f9,00.html
Best regards,
Dan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2001 10:33 AM
01-05-2001 10:33 AM
Re: File Listing with Date/Time Rephrase.
Thanks very much for taking the time to respond. It's appreciated.
All The Best,
~ Pam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2001 10:54 AM
01-05-2001 10:54 AM
SolutionThere is a "super ls" available from the porting archive. It's man page notes that, "sls is a program designed to overcome the limitations of the standard UNIX ls(1) program, providing a more consistent interface to file inode information. It is particularly designed for use by shell scripts...". You might find this of interest.
http://hpux.cs.utah.edu/hppd/hpux/Shells/sls-1.0/man.html
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2001 11:33 AM
01-05-2001 11:33 AM
Re: File Listing with Date/Time Rephrase.
Actually, thanks to everyone.
All The Best,
Sincerely and Respectfully,
~ Pam Goodwin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2001 11:37 AM
01-05-2001 11:37 AM
Re: File Listing with Date/Time Rephrase.
I'm glad to have helped. Your most welcome!!!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-05-2001 03:24 PM
01-05-2001 03:24 PM
Re: File Listing with Date/Time Rephrase.
OOPS! "your" (sic) "you're" !!! -> Paula C. would have my US-English hide. ;-)
...JRF...