# grep ABC *.htm # grep -i ABC *.htm ignore maj/min # grep -v ABC *.htm ne contient pas # grep -c ABC *.htm count # grep -l ABC *.htm nom du fic
recherche de fic contenant le pattern bibi # find . -type f -print | xargs grep bibi -- ne contient pas "nav" -- be4@indy3:/be4.free.fr/ski$ grep -L "nav>" *.htmparadis2013_map.htm paradis2013v2.htm ...ou
be4@indy3:/be4.free.fr/ski$ grep -rvlH "nav>" *.htmparadis2013_map.htm paradis2013v2.htm ...-- contient "nav" -- be4@indy3:/be4.free.fr/ski$ grep -rlH "nav>" *.htmargentiere2013.htm-- verif -- be4@indy3:/be4.free.fr/ski$ grep nav *.htmargentiere2013.htm:nav> argentiere2013.htm:/nav>-- ne contient ni "nav" ni "map" -- be4@indy3:/be4.free.fr/ski$ grep -Ev "nav|map" *.htmindex.htm
find+exec (lent) VS find+xargs (rapide) be4@indy3: $ cd /mnt/d/data_html/internet/be4.free.fr $ time find . -name \*.htm -type f -print0 | xargs -0 grep -Hn 'wiki' |grep class ======= nom du fichier sur la même ligne ====== plus rapide que -exec
be4@indy3: $ time find . -name "*htm" -exec grep -w wiki {} \;./alsace/index.htm:.wk { background-color: #333333; color: white; font-size: 60%; padding-left:6px; padding-right:6px } ./alsace/index.htm:Alsace wiki
./doc/continent/index.htm: Sardaigne , ./rando/20190915/index.htm:101:info 2019: pas d'article wikipedia pour Gaschney ... ./rando/nanga.htm:42:suiv... du Nanga Parbat W ./vtt2020/markstein_neige.htm:44: 47°56′52″N, 7°01′38″ E ./wiki.htm:44:wiki
./wiki.htm:110:be4.free.fr/wiki.htm real 0m0.459s user 0m0.031s sys 0m0.406sbe4@indy3: find . -name index.htm |xargs grep wikiwiki, wiki
be4.free.fr/wikini/wakka.php?wiki= be4.free.fr/wiki.htm Binary file ./wiki.htm matches real 0m12.799s user 0m0.797s sys 0m9.344s./voyage/c2019/index.htm:khmer
./voyage/c2019/index.htm:quelques articles wikipedia
./voyage/c2019/index.htm:Pol Pot 1925-1998
./voyage/c2019/index.htm:Norodom Sihanouk
2 3 exemples évolués compter ------- be4@indy3: find . -name index.htm |xargs grep wiki|wc -l 478 fichiers modifiés ces 90 derniers jours (sauf répertoire) ---------------------------------------be4@indy3:/mnt/d/data_html$ find . -path ./internet -prune -o -name "*.htm" -mtime -90 -print |wc -l ========================== = sauf dans le rep. internet 114 be4@indy3:/mnt/d/data_html$ cdbe4 be4@indy3:/mnt/d/data_html/internet/be4.free.fr$ find . -mtime -90 -print |wc -l 1088 be4@indy3:/mnt/d/data_html/internet/be4.free.fr$ cd ../.. be4@indy3:/mnt/d/data_html$ find . -mtime -90 -print |wc 1388 be4@indy3:/mnt/d/data_html$ find . -path ./internet -prune -o -mtime -90 -print |wc -l 296
dos.htm = DOS vs Unix commands
en.wikipedia.org/wiki/grep
en.wikipedia.org/wiki/Find_(Unix)
les articles francais sont trop nuls :-(
en.wikipedia.org/wiki/grep
en.wikipedia.org/wiki/Find_(Unix)
les articles francais sont trop nuls :-(