ls -tr | find -type f -name "*" -size +1M
find -type f -name "*" -size +1M | ls -tr
I am trying to find all files larger than 1MB and list them in chronological order.
But both ways is not piping properly.
Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230
[solved] ls | find not piping
- sunrat
- Administrator
- Posts: 6497
- Joined: 2006-08-29 09:12
- Location: Melbourne, Australia
- Has thanked: 118 times
- Been thanked: 476 times
Re: ls | find not piping
You forgot to give find a location to search for starters.
That will recursively find all files in current directory. Add -maxdepth 1 to find if you don't want it to search subdirectories. Add -r to ls if you want it to show oldest to newest.
This came up as the first result at StackExchange using a Startpage search for the term "find all files larger than 1MB and list them in chronological order". Search is much faster than a forum question usually.
Code: Select all
find . -type f -size +1M -print0 | xargs -0 ls -halt
This came up as the first result at StackExchange using a Startpage search for the term "find all files larger than 1MB and list them in chronological order". Search is much faster than a forum question usually.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!
Those who have lost data
...and those who have not lost data YET ” Remember to BACKUP!