- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- ls -l and file date format
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
12-09-2002 07:43 AM
12-09-2002 07:43 AM
ls -l(ell) Reports directory listing in long format, giving amongst date and/or time of last modification for each file. If the time of last modification is greater than six months ago the year is substituted for the hour and minute of the modification time.
Is there a way that I can get always the date instead of the time?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2002 07:49 AM
12-09-2002 07:49 AM
Re: ls -l and file date format
There is a "super ls" utility available at the porting archive that accomodates your request:
http://hpux.cs.utah.edu/hppd/hpux/Shells/sls-1.0/
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2002 07:52 AM
12-09-2002 07:52 AM
Re: ls -l and file date format
As far as I know, no. You will always get the month and day, but the year is only for files older than 6 mos.
Sorry if this didn't give you what you need.
Chris
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2002 07:54 AM
12-09-2002 07:54 AM
Re: ls -l and file date format
I think it's not possible.
Regards, Vicente.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2002 07:59 AM
12-09-2002 07:59 AM
Re: ls -l and file date format
a5:/tmp/empty 112 > ls -l
total 18
-rw-rw-rw- 1 probev softwr 55 Mar 4 2002 empty.al
-rw-rw-rw- 1 probev softwr 474 Mar 4 2002 empty.ao
-rw-rw-rw- 1 probev softwr 3103 Mar 4 2002 empty.aq
-rw-rw-rw- 1 probev softwr 42 Mar 4 2002 empty.as
-rw-rw-rw- 1 probev softwr 3066 Mar 4 2002 empty.bk
-rw-rw-rw- 1 probev softwr 6748 Mar 4 2002 empty.fa
-rw-rw-rw- 1 probev softwr 374 Mar 4 2002 makefile
-rw-rw-rw- 1 merijn softwr 0 Dec 9 16:53 xx
a5:/tmp/empty 113 > perl -le'@ARGV or@ARGV=qw(*);for(map{glob$_}@ARGV){chomp($x=localtime((stat$_)[9]));print"$x $_"}'
Mon Mar 4 18:51:16 2002 empty.al
Mon Mar 4 18:32:04 2002 empty.ao
Mon Mar 4 18:51:07 2002 empty.aq
Mon Mar 4 18:24:57 2002 empty.as
Mon Mar 4 18:49:56 2002 empty.bk
Mon Mar 4 18:51:16 2002 empty.fa
Mon Mar 4 18:32:01 2002 makefile
Mon Dec 9 16:53:53 2002 xx
a5:/tmp/empty 114 >
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2002 08:01 AM
12-09-2002 08:01 AM
Re: ls -l and file date format
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-09-2002 08:03 AM
12-09-2002 08:03 AM
Re: ls -l and file date format
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2002 02:03 AM
12-10-2002 02:03 AM
Re: ls -l and file date format
first thank you all for your respons.
James,
The ???super ls??? I think is not Year2K compliant. Files created yesterday are reported as made in 1910.
Procura,
The Perl statement as you give to me, doesn???t do anything, but when I add en spave between ???-le??? en the quote (' ) it reports some errors:
bmsd210:root:/tmp> perl -le'@ARGV or@ARGV=qw(*);for(map{glob$_}@ARGV){chomp($x=localtime((stat$_)[9]));print"$x $_"}'
syntax error in file /tmp/perl-ea28386 at line 1, next 2 tokens "@ARGV or"
syntax error in file /tmp/perl-ea28386 at line 1, next 2 tokens "map{"
syntax error in file /tmp/perl-ea28386 at line 1, next token "}"
Execution of /tmp/perl-ea28386 aborted due to compilation errors.
bmsd210:root:/tmp>
But I???m not familiar with perl.
And thanks for the lsi-csript but I don???t have an ANSI C-compiler.
Anyone:
I still have my problem with ls ???l and the report of the filedate.
Regards
Wessel.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2002 02:32 AM
12-10-2002 02:32 AM
Solutionif all other possibilities have been exhausted, try the attached script, using the file whose last modification date you request as par1.
It is slow, but works on my system.
regards,
John K.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2002 03:19 AM
12-10-2002 03:19 AM
Re: ls -l and file date format
# which perl
should not be /usr/contrib/bin/perl
# perl -v
should not be 4.036, but preferably 5.6.1 or 5.8.0
lsi.c should not need an ANSI C compiler. The bundled compiler should be enough
Prebuild HP-UX 11.00 and 10.20 binaries for both perl-5.8.0 and gcc-3.2 (free ANSI C compiler) are available on both my ITRC page https://www.beepz.com/personal/merijn and HP porting centers around the world (http://hpux.connect.org.uk/)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2002 03:35 AM
12-10-2002 03:35 AM
Re: ls -l and file date format
I don't like very much this 'super ls' but I modified the source to make it work. Just compile it using 'make' and run 'sls -l *'. It should work ...
Regards.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2002 05:03 AM
12-10-2002 05:03 AM
Re: ls -l and file date format
John, this is what I was looking for. As you said not fast but it works. Thanks.
Procura,
I couldn???t find perl for hpux10.20.
???make lsi.c??? gives errors and no executable. Sorry.
But John (see above) and Jean-Louis (see below) profided me a working solution. But thanks any way.
Jean-Louis,
Super sl works as I wanted. Tanks.
All,
Many thanks for your respons.
Wessel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2002 05:21 AM
12-10-2002 05:21 AM
Re: ls -l and file date format
perl-5.8.0 for 10.20 can be found in the download section https://www.beepz.com/personal/merijn/#Downloads rightmost column, links to https://www.beepz.com/personal/merijn/perl-5.8.0-gcc-3.2-10.20-pa11-ora.tbz
lsi now uploaded as https://www.beepz.com/personal/merijn/lsi-pa1.1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2002 06:17 AM
12-10-2002 06:17 AM
Re: ls -l and file date format
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-10-2002 07:30 AM
12-10-2002 07:30 AM
Re: ls -l and file date format
I cannot offer you anything else for perl ...
I've put lsi on http://home.hccnet.nl/h.m.brand/lsi-pa1.1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-11-2002 12:27 AM
12-11-2002 12:27 AM
Re: ls -l and file date format
If???ve downloaded lsi-pa1.1 and it worked.
Perhaps the problem in contacting www.beepz.com is due to https. I have sometimes problems in contacting secure sites.
Thanks for your help.