« Commandes BASH » : différence entre les versions
| Ligne 146 : | Ligne 146 : | ||
== Trouver == | == Trouver == | ||
=== Compter le nombre de fichiers en excluant un répertoire === | === Compter le nombre de fichiers en excluant un répertoire === | ||
<syntaxhighlight lang="bash" | <syntaxhighlight lang="bash" copy> | ||
find /rep/ -maxdepth <big>4</big> -type f ! -path '*/repexclu/*' | wc -l | find /rep/ -maxdepth <big>4</big> -type f ! -path '*/repexclu/*' | wc -l | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Trouver les chemins des fichiers recherchés === | === Trouver les chemins des fichiers recherchés === | ||
<syntaxhighlight lang="bash" | <syntaxhighlight lang="bash" copy> | ||
find /volume1/video/perso/2017 -name '*.MOV' -type f | find /volume1/video/perso/2017 -name '*.MOV' -type f | ||
</syntaxhighlight> | </syntaxhighlight> | ||
=== Recherche === | === Recherche === | ||
<syntaxhighlight lang="bash" | <syntaxhighlight lang="bash" copy> | ||
find /home/rep/ \( -name '*.ai' \) | find /home/rep/ \( -name '*.ai' \) | ||
</syntaxhighlight> | </syntaxhighlight> | ||