- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: list file creadted year using ll cmd
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
08-14-2009 11:57 AM
08-14-2009 11:57 AM
list file creadted year using ll cmd
How do I list the files with created year , ll -lrt want give the year.
-rw-r--r-- 1 root sys 10731 Jul 18 23:44 cart.txt
-rw-r--r-- 1 root sys 0 Jul 18 23:44 comp.txt
-rw-r--r-- 1 root sys 773 Jul 18 23:44 devices.txt
-rw-r--r-- 1 root sys 24890 Jul 18 23:44 media.txt
-rw-r--r-- 1 root sys 0 Jul 18 23:44 mtmp.txt
-rw-r--r-- 1 root sys 596 Jul 18 23:44 pools.txt
-rw-r--r-- 1 root sys 351 Jul 18 23:44 stores.txt
Thanks!
Ashan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2009 12:10 PM
08-14-2009 12:10 PM
Re: list file creadted year using ll cmd
UNIX because I majored in cryptology...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2009 12:20 PM
08-14-2009 12:20 PM
Re: list file creadted year using ll cmd
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2009 12:22 PM
08-14-2009 12:22 PM
Re: list file creadted year using ll cmd
The standard UNIX behavior is described in the 'ls' manpages, "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."
You can, however, do something like this:
# ls -alrt|awk -v YEAR=$(date +%Y) '{if ($8~/:/) {$8=YEAR};$NF=$NF;print}'
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2009 03:43 PM
08-14-2009 03:43 PM
Re: list file creadted year using ll cmd
may represent one of the worst "design"
decisions anywhere in UNIX. On the bright
side, GNU "ls" offers more date-time format
options than anyone should want, including
"--time-style=style=+
do nearly anything except send e-mail.
http://www.gnu.org/software/coreutils/manual/
http://www.gnu.org/software/coreutils/manual/html_node/Formatting-file-timestamps.html
I quote:
To avoid certain denial-of-service
attacks, timestamps that would be
longer than 1000 bytes may be treated
as errors.
If that's not scary, what is?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-14-2009 03:48 PM
08-14-2009 03:48 PM
Re: list file creadted year using ll cmd
You can modify a copy of ls.cat to have your own format:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1320053
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1279941
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1207493
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1182062
>Mel: ls, not ll as you mentioned,
ls(1) and ll(1) are the same executable.
> Tingli: or maybe 180 days
Right, 180 days, or an hour in the future.
- Tags:
- ls.cat