[linux] Re: reguliere expressies en ls

Cecil Westerhof CecilWesterhof op xs4all.nl
Do Dec 8 04:41:21 CET 2005


Op wo, 07-12-2005 te 21:38 +0100, schreef Bram Mertens:
> > Heb er al iets gevonden:
> > 	ls -1 <DIR>/* 2>/dev/null | grep '/[0-9]\{10\}\.txt$'
> > Doet wat ik wil.
> > De 2>/dev/null is om de foutmelding die je bij een lege directorie
> > krijgt te voorkomen.
> > 
> 
> Een andere mogelijkheid:
> 
> ls `seq -w -s ".txt " 0 1000000000`

Ben bang van niet:
        ls `seq -w -s ".txt " 0 10`
        /bin/ls: 00.txt: Onbekend bestand of map
        /bin/ls: 01.txt: Onbekend bestand of map
        /bin/ls: 02.txt: Onbekend bestand of map
        /bin/ls: 03.txt: Onbekend bestand of map
        /bin/ls: 04.txt: Onbekend bestand of map
        /bin/ls: 05.txt: Onbekend bestand of map
        /bin/ls: 06.txt: Onbekend bestand of map
        /bin/ls: 07.txt: Onbekend bestand of map
        /bin/ls: 08.txt: Onbekend bestand of map
        /bin/ls: 09.txt: Onbekend bestand of map
        /bin/ls: 10: Onbekend bestand of map

-- 
Cecil Westerhof <CecilWesterhof op xs4all.nl>



More information about the Linux mailing list