- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Extracting file details name and creation yyyy/mm/...
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
04-25-2002 04:19 AM
04-25-2002 04:19 AM
Can anyone suggest how I can extract the following details from a standard text file details :
filename and yyyymmdd, and hh:mm of creation
I understand that I could use ll | grep awk for columns 6,7,8 and 9 - however, on an ll output, newer files do not output the year, and older files do not output the time.
Is there any exe which will show all the details :
Filename
yyyy created
mm created
dd created
hh created
mm (minutes) created
Many thanks
Russell
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 04:52 AM
04-25-2002 04:52 AM
Re: Extracting file details name and creation yyyy/mm/dd hh:mm
Tough ... I don't think that is possible (with a "standard" command). See the following post http://forums.itrc.hp.com/cm/QuestionAnswer/1,,0xbbb5854994d9d4118fef0090279cd0f9,00.html
Hope this helps,
Tom
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 05:00 AM
04-25-2002 05:00 AM
Re: Extracting file details name and creation yyyy/mm/dd hh:mm
http://hpux.connect.org.uk/hppd/hpux/Gnu/findutils-4.1.5/
and issue the command ls --full-time
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 05:01 AM
04-25-2002 05:01 AM
Re: Extracting file details name and creation yyyy/mm/dd hh:mm
Example:
$ ./lt lt
8628 -rwxr-xr-x 1 trond crc 20480 lt
Access time | Modification time | Mode change time:
25/04-102 15:07:19 | 27/01-95 13:04:51 | 21/04-102 0:21:52
Regards,
Trond
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 05:07 AM
04-25-2002 05:07 AM
Re: Extracting file details name and creation yyyy/mm/dd hh:mm
2001/10/15 09:17 ./linda.errorlog
2002/04/08 08:16 ./llbdbase.dat
2001/10/10 14:10 lost+found
2001/12/03 09:55 ./lp.err
l1:/tmp 115 > ll -d l*
38 -rw-r--r-- 1 linda softwr 107 Oct 15 2001 linda.errorlog
702 -r--r--r-- 1 root root 0 Apr 8 08:16 llbdbase.dat
3 drwxr-xr-x 2 root root 96 Oct 10 2001 lost+found
746 -rw-rw-rw- 1 lp lp 400 Dec 3 09:55 lp.err
l1:/tmp 116 >
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 05:07 AM
04-25-2002 05:07 AM
Re: Extracting file details name and creation yyyy/mm/dd hh:mm
cc prog.c -o prog
Where prog is the executable you would run and supply a parameter name.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 05:27 AM
04-25-2002 05:27 AM
Re: Extracting file details name and creation yyyy/mm/dd hh:mm
Save the attached as a.out
cc a.out
or
gcc a.out
Run it
./a.out
HTH,
Dave.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 06:34 AM
04-25-2002 06:34 AM
Solution$ echo /stand/system | cpio -o 2>/dev/null | cpio -ivt 2>/dev/null
100444 root 531 Feb 16 08:45:08 2000 /stand/system
$
In a script you can assign the result to a variable:
result=`echo $file | cpio -o 2>/dev/null | cpio -ivt 2>/dev/null`
The cutting and re-arranging of the order is left as an exercise. With "set --" it becomes easy, i.e.
set -- `echo $file | cpio -o 2>/dev/null | cpio -ivt 2>/dev/null
time=$6
year=$7
[etc.]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 06:56 AM
04-25-2002 06:56 AM
Re: Extracting file details name and creation yyyy/mm/dd hh:mm
http://hpux.cs.utah.edu/
It dumps all kinds of file info and allows you to format the way you prefer.
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 08:05 AM
04-25-2002 08:05 AM
Re: Extracting file details name and creation yyyy/mm/dd hh:mm
you can get only three time stamps:
- atime = access time = reading
- mtime = modification time = writing
- ctime = CHANGE time = chrgp/chown/chmod
but there is NO *creation* time!
The date (=mtime) of the parent directory is changed when a file is created, but then, other files may have caused that, or your file has been created in another directory and then moved to the new one...
Just my $0.02,
Wodisch