- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: ls commands
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
07-23-2003 09:39 AM
07-23-2003 09:39 AM
ls commands
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2003 09:44 AM
07-23-2003 09:44 AM
Re: ls commands
You may need to work sort into it as well.
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2003 09:55 AM
07-23-2003 09:55 AM
Re: ls commands
I think something like this should do what you want (if I'm interpreting correctly):
"find /starting_dir -size +20000c -mtime +910 -exec ls {} \; |sort -n"
Replace 20000c with your size limit in bytes. The 910 is an approximation of the number of days since 01/01/2000.
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2003 10:08 AM
07-23-2003 10:08 AM
Re: ls commands
After further review, make that:
"find /starting_dir -size +20000c -mtime +910 -exec ll {} \; |sort -n"
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2003 10:13 AM
07-23-2003 10:13 AM
Re: ls commands
Pete
Pete
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2003 10:19 AM
07-23-2003 10:19 AM
Re: ls commands
"ls -l |sort -n -k 5"
You're going to need find commands to go after files over a certain size or older than a set date.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2003 10:21 AM
07-23-2003 10:21 AM
Re: ls commands
Use 'find' with a reference file to get an exact date and time boundry. Thus:
# touch -amt 200001010000 /tmp/ref # 01/01/2000 at 0000 hours
# find /tmp -xdev \( -size +10000c -a -newer /tmp/ref \) -exec ls -l | sort -k5nr
...will produce a list of all files in the /tmp directory whose size is greater than 10,000 bytes and newer than 01/01/2000 at 0000 hours. The output will be sorted in descending size order.
Regards!
...JRF...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2003 10:46 AM
07-23-2003 10:46 AM
Re: ls commands
You want a list of files:
sorted by size
the size greater than some value
and all older than 2000.
Still go with the
# touch -amt 200001010000 /tmp/ref # 01/01/2000 at 0000 hours
but try
# find / -size +10000 \( ! -newer /tmp/ref \) -exec ls -al {} \;|sort -k5nr
if I understand correctly, the files will all be larger than 512bytes x 10000, or about 5Mb.
np, pls. (and I'm adding this to my list of strange little one liners).
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2003 11:38 AM
07-23-2003 11:38 AM
Re: ls commands
ls -ltr
This lists files in reverse time order, so you could awk this & pront any files greater than a particular size.... (I'm at home so dont know the filed size is in)
ls -ltr | awk '$4>20000{print $0}'
Tim
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2003 07:04 PM
07-23-2003 07:04 PM
Re: ls commands
ls -l | awk '{if ($5 > 1000000) { if (substr($8,3,1) == ":" || $8 > 2000) {print $0}}}'