- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- find date including year of file modification
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
09-05-2002 10:15 PM
09-05-2002 10:15 PM
Can anyone tell me if it is possible to get the year included in the date of last modification for a file.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2002 10:33 PM
09-05-2002 10:33 PM
Re: find date including year of file modification
yep.... it is possible. You need two commands to get what you want:
man touch
--> use the touch command to create a reference file. You can give a time stamp to your file when you generate it.
touch time_stamp file_name
man find
have a look to the -newer option. You can also do a logical combination of dates to get, if needed, use the -a option.
find /start_point -newer reference_file -exec ls -al {} \;
Allways stay on the bright side of life!
Peter
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2002 10:40 PM
09-05-2002 10:40 PM
Re: find date including year of file modification
There are two ways:
One install 'super ls' you can get it from here:
http://gatekeep.cs.utah.edu/hppd/hpux/Shells/sls-1.0/
or another suggested example that I've kept.
$ ll /usr/conf/lib/libspt.a
-r--r--r-- 1 bin bin 63556 Oct 30 1997 /usr/conf/lib/libspt.a
$ echo /usr/conf/lib/libspt.a | cpio -o 2>/dev/null | cpio -ivt 2>/dev/null
100444 bin 63556 Oct 30 23:50:34 1997 /usr/conf/lib/libspt.a
There are aslo some further examples here:
http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xeb38c4c76f92d611abdb0090277a778c,00.html
HTH
Michael
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-05-2002 10:42 PM
09-05-2002 10:42 PM
Re: find date including year of file modification
Hi,I assume you are talking about the output of the ls command.
The man-page says:
If the time of last modification is greater
than six months ago, or any time in the future, the year is
substituted for the hour and minute of the modification
time.
If you write your own little c-program you can use the stat() function
to get the info as creation- modification- and access-time info all
are available as time_t info.
Regards
Olav
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2002 12:38 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2002 12:45 AM
09-06-2002 12:45 AM
Re: find date including year of file modification
Some perl to give you the full modification time:
perl -e '{print scalar localtime((stat(shift))[9]),"\n"}' filename
Rgds, Robin