- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: command find + sort
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
10-19-2004 05:42 AM
10-19-2004 05:42 AM
$ find . -name *.old -exec ls -ltr {} \;|more
-rw-r--r-- 1 named named 351 Aug 3 2001 ./a/a/aaaimar.com.old
-rw-r--r-- 1 named named 360 Jul 12 2001 ./a/a/aaci.org.ar.old
-rw-r--r-- 1 named named 408 Mar 14 2003 ./a/a/aacolombo.com.old
-rw-r--r-- 1 named named 410 Mar 14 2003 ./a/a/aaconcagua.com.old
-rw-r--r-- 1 named named 664 Mar 14 2003 ./a/a/aaehsa.com.ar.old
-rw-r--r-- 1 named named 603 Nov 12 2003 ./a/a/aaqct.com.ar.old
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2004 05:50 AM
10-19-2004 05:50 AM
Re: command find + sort
Try this:
find ./ -name *.old | xargs ls -ltr {} \;|more
Rgds...Geoff
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2004 05:56 AM
10-19-2004 05:56 AM
Re: command find + sort
********************************
yes, work with errors
find ./ -name *.old | xargs ls -ltr {} \;|more
-rw-r--r-- 1 named named 347 Aug 15 2001 ./a/r/aroxt.com.old
-rw-r--r-- 1 named named 361 Aug 15 2001 ./a/r/arihernandez.com.old
-rw-r--r-- 1 named named 353 Aug 21 2001 ./a/r/arqsovic.com.old
--More--{}: No such file or directory
;: No such file or directory
{}: No such file or directory
;: No such file or directory
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2004 06:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2004 06:07 AM
10-19-2004 06:07 AM
Re: command find + sort
Here is a one liner that should work-
find . -name "*.old" | perl -ne 'chomp; print STDOUT (-M $_),"\t",$_,"\n"' | sort -n | cut -f2 | xargs -n1 ll -d
This works by getting the age of the file, prepending to the filename, then calling sort, then calling cut (to remove the file age), then xargs to do "ll" command.
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2004 01:16 PM
10-19-2004 01:16 PM
Re: command find + sort
xargs will process the filenames in chunks, so that each chunk will be sorted, but not sorted as a whole.
my 2 cents...
-- Rod Hills
PS- gnu find command, available on the software porting and archive centre, has extended capabilities that might be of use to solve your problem.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-19-2004 05:40 PM
10-19-2004 05:40 PM
Re: command find + sort
ls -ltr `find . -name "*.old"` | more
HTH.