Você pode usar sort
e sed
para obter uma lista de arquivos maiores que algumas cadeias como esta:
$ ls -v
0?#Li 23?24 E.See NULib Yoush ce-Su edint ethat ibble itwil lines of16 plesA ryGen t6?#C witht #ver
0?#mo 25?i Examp NYWAR along cribb edist ev ibrar ix B. mapfo ofthe ppend sdist tetot y8?#9 (atyo
0,22 27?# FORAP NextA areFo dacop edwar frees ic11 lPubl mored oftwa publi sefor theGN yGene )1995
1.scr 02111 Finla Peter aryis datio eful, ftheG ight( landJ mport on23# ralPu se,or tunde yofth ,USA.
1-200 ARTIC GIMPT RANTY avere difyi eitan ftwar imbal lbeus ncerK on,MA raryG shedb t,wri ytheF ;ifno
2John Appen HANTA Softw bleof dix B enera ght(C impli ld7?# nc.,5 oolki raryi simpl ublic #19?# ;with
4?#Th BILIT HOUTA TNESS blic2 e.py4 enthe gtk26 ingar lePla ngpix opyri rdraw sion. ucanr #Bost Code
5?#GT Backi K-The U17?# brary e.pyB eralP he21 ion)a lesPr nseas oshMa reeSo sion2 undat #Free
9Temp Conte Libra ULARP cDona eExam ermso hehop ion,I lesTa ntsB. ouldh re;yo slibr uropt #Lice
13?#1 Copyr Licen URPOS ceive eFoun erver her12 islib lescr nylat outev ribut s,Spe utWIT #MERC
15?#b C)200 Matti YorFI cense eGNUL etail hisli ite33 lesim n;eit ple.p rthet s.18 vpyth #Thi
$ mkdir greater-than-sion
Aqui está a mágica:
$ find -type f -print0 |
sort -z |
sed -z '1,/sion/d' |
xargs -0 mv -t greater-than-sion
Linhas:
- imprime uma lista de arquivos, separados por
NUL
em vez de novas linhas (-print0
) - ordene-os
- excluir linhas menor que (inclusive) alguma string (aqui
sion
) - observe que isso funciona apenas com o GNUsed
, que implementa uma opção-z
para analisarNUL
- entrada terminada - passar esta lista para
mv
comxargs
E o resultado desejado:
$ ls -R
.:
Code ;ifno 25?i avere Conte edist erver GIMPT ic11 K-The lines nseas opyri raryG se,or
#19?# ;with 27?# Backi Copyr edwar etail greater-than-sion/ ight( landJ lPubl ntsB. oshMa raryi sefor
#Bost 0?#Li 2John BILIT cribb eExam ethat gtk26 imbal lbeus mapfo NULib ouldh rdraw shedb
#Free 0?#mo 4?#Th bleof dacop eFoun ev HANTA impli ld7?# Matti nylat outev re;yo simpl
#Lice 0,22 5?#GT blic2 datio eful, Examp he21 ingar lePla mored NYWAR Peter reeSo sion.
#MERC 02111 9Temp brary difyi eGNUL Finla hehop ion)a lescr mport of16 ple.p ribut
#Thi 1.scr along C)200 dix B eitan FORAP her12 ion,I lesim n;eit ofthe plesA rthet
#ver 1-200 Appen cDona e.py4 enera frees hisli islib lesPr nc.,5 oftwa ppend ryGen
(atyo 13?#1 areFo ceive e.pyB enthe ftheG HOUTA ite33 lesTa ncerK on,MA publi s,Spe
)1995 15?#b ARTIC cense E.See eralP ftwar ibble itwil Libra NextA on23# ralPu s.18
,USA. 23?24 aryis ce-Su edint ermso ght(C ibrar ix B. Licen ngpix oolki RANTY sdist
./greater-than-sion:
sion2 Softw t6?#C theGN tunde ublic ULARP uropt utWIT witht yGene YorFI ytheF
slibr t,wri tetot TNESS U17?# ucanr undat URPOS vpyth y8?#9 yofth Yoush