- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - Linux
- >
- Re: ls options
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
Discussions
Discussions
Forums
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
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
тАО05-03-2007 12:13 AM
тАО05-03-2007 12:13 AM
ls -l will give only hh:mm only..
i need even the seconds..
plsssss help
Solved! Go to Solution.
- Tags:
- ls
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2007 12:31 AM
тАО05-03-2007 12:31 AM
Re: ls options
GNU 'ls' has the '--full-time' switch. It also supports colorized output, which is a beautiful thing. The GNU coreutils depot is available here:
http://hpux.connect.org.uk/hppd/hpux/Gnu/coreutils-6.7/
Alternatively, try the following perl construct:
perl -e 'foreach(@ARGV){$time=localtime((stat($_))[9]);printf("%-30s%s\n",$_,$time)}' *
PCS
- Tags:
- Perl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2007 12:37 AM
тАО05-03-2007 12:37 AM
Re: ls options
Unfortunately, using ls, you cannot get this information.
if you do man ls
you will not find any such switch.
good luck!
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2007 12:39 AM
- Tags:
- cpio
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2007 12:44 AM
тАО05-03-2007 12:44 AM
Re: ls options
Spex's perl solution works fine..
$ perl -e 'foreach(@ARGV){$time=localtime((stat($_))[9]);printf("%-30s%s\n",$_,$time)}' *
v_syt280_1.sql Thu Mar 30 08:19:02 2006
vknt1002.sql Thu Mar 30 08:19:02 2006
yd.sql Thu Mar 30 08:19:02 2006
ydcmtpfs.sql Thu Mar 30 08:19:02 2006
ydtest.sql Thu Mar 30 08:19:02 2006
$
kind regards
yogeeraj
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2007 12:48 AM
тАО05-03-2007 12:48 AM
Re: ls options
# perl -MPOSIX -le 'for (@ARGV) {-e $_ && print join " ",$_,strftime("%x %X",localtime((stat($_))[9]))}' /tmp /etc/hosts
/tmp 05/03/07 08:46:36
/etc/hosts 05/05/06 08:33:12
That is, pass as many file or directory names as arguments as you want.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2007 12:48 AM
тАО05-03-2007 12:48 AM
Re: ls options
# perl -MPOSIX -le 'for (@ARGV) {-e $_ && print join " ",$_,strftime("%x %X",localtime((stat($_))[9]))}' /tmp /etc/hosts
/tmp 05/03/07 08:46:36
/etc/hosts 05/05/06 08:33:12
That is, pass as many file or directory names as arguments as you want.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2007 03:28 PM
тАО05-03-2007 03:28 PM
Re: ls options
but John`s solution works perfectly fine.
Thanks John..
Thanks to everybody...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-03-2007 04:07 PM
тАО05-03-2007 04:07 PM
Re: ls options
> actually i dint want the solution in perl.
Then SAY SO in your requirements up front so that we don't waste our time. You asked for help and you got it --- this time.
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-09-2007 05:45 PM
тАО05-09-2007 05:45 PM
Re: ls options
in temp directory, there are files with filetype ABC and if i give
ls -lrt *ABC, it will give a listing according to timestamp.
But from other directories if i give
ls -lrt /temp/*ABC,
the output differs than the above.
y is it different?? any idea??