- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Unix Command "ls"
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
тАО07-18-2001 07:50 AM
тАО07-18-2001 07:50 AM
I was wondering if the ls command can list all files in a current directory with file size that is greater than some number and less than some number? If so, how will this be done? If not, are there any other commands that will do this function? or maybe a small script?
Perhaps, some clever individual could answer this question?
arrivederci...
Solved! Go to Solution.
- Tags:
- ls
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2001 07:55 AM
тАО07-18-2001 07:55 AM
Re: Unix Command "ls"
If you want to use 'ls' and limit the results returned by filesize, consider this method:
# ls -l /tmp|awk '$5 > 1000 && $5 < 3000 {print $0}'
...this will return all files in the /tmp directory whose size is greater than 1000 and less than 3000.
Regards!
...JRF...
- Tags:
- awk
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2001 07:57 AM
тАО07-18-2001 07:57 AM
Re: Unix Command "ls"
I can only think of using the cmd find with size option with -a (logical AND operator)...
So man find...
All the best
Victor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2001 08:01 AM
тАО07-18-2001 08:01 AM
Re: Unix Command "ls"
do
ls -l | awk ' { if ($5 > "aaa" && $5 < "BBB" ) print $NF,$5 }' > /tmp/test.
will give you what you need from the present working directory , incase you want to search everythin under that directory
replace ls -l with ls -lR .
Manopj Srivastava
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2001 08:01 AM
тАО07-18-2001 08:01 AM
Re: Unix Command "ls"
This command will find in /tmp files greater than 1000000 bytes - modify size and dir to suit.
find /tmp -size +1000000c -exec ls -l {} \;
Paula
- Tags:
- find
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО07-18-2001 08:09 AM