Portál AbcLinuxu, 15. července 2025 12:39
find ./ -regex .*nieco.*[^\(txt\)] -exec rm {} \;
Ale je tam pravdepodobne problem s escape-ovanim.
(?!txt)
! -regex
' a u grepu to bude přepínač -v
. Jinak ten regex dej mezi apostrofy (pak nemusíš escapovat).
ako v bashi zmazem vsetky subory okrem tych ktore zacinaju na "nieco" ale nemaju priponu *.txt ?
find -mindepth 1 -type f ! -regex ".*/nieco.*\.txt$" | xargs rm
find ./ -type f -regex '.*/daco.*[^(txt)]'
Tiskni
Sdílej:
ISSN 1214-1267, (c) 1999-2007 Stickfish s.r.o.