Pour renommer de nombreux fichiers, la commande c’est “rename” :
$ rename 's/motif1/motif2' *

Exemple : Pour renommer tous les fichiers, récursivement dans tous les répertoires, en changeant le motif â par â en 1 seule commande (super rapide), se placer dans le répertoire parent et :
$ find . -name "*â*" | xargs rename 's/â/â/g'

Brackets
if [ CONDITION ]           Test construct
if [[ CONDITION ]]         Extended test construct
Array[1]=element1        Array initialization
[a-z]                               Range of characters within a Regular Expression

Curly Brackets
${variable}                                                          Parameter substitution
${!variable}                                                         Indirect variable reference
{ command1; command2; . . . commandN; }    Block of code
{string1,string2,string3,…}                                 Brace expansion
{a..z}                                                                   Extended brace expansion
{}                                                                        Text replacement, after find and xargs

Parentheses
( command1; command2 )                       Command group executed within a subshell
Array=(element1 element2 element3)      Array initialization
result=$(COMMAND)                               Command substitution, new style
>(COMMAND)                                          Process substitution
<(COMMAND)                                          Process substitution

Double Parentheses
(( var = 78 ))                            Integer arithmetic
var=$(( 20 + 5 ))                      Integer arithmetic, with variable assignment
(( var++ ))                                C-style variable increment
(( var– ))                                  C-style variable decrement
(( var0 = var1<98?9:21 ))       C-style trinary operation

=~ Comparison operator takes a string on the left and an extended regular expression on the right. It returns 0 (success) if the regular expression matches the string, otherwise it returns 1 (failure)
| = OR
s = Substitute
g = Many times on the same line

^ = Beginning of a line; also represents the characters not in the range of a list
$ = End of a line
[ab] = a or b
[1-5] = 1, 2, 3, 4 or 5
[:alpha:] or [A-Za-z] = Alphabetic characters
[:alnum:] or \w = Alphanumeric characters
[:blank:] = Blank characters: space and tab
[:digit:] or \d = Digits: ‘0 1 2 3 4 5 6 7 8 9’
[:lower:] = Lower-case letters: ‘a b c d e f g h i j k l m n o p q r s t u v w x y z’
[:space:] or \s = Space characters: tab, newline, vertical tab, form feed, return, and space
[:upper:] = Upper-case letters: ‘A B C D E F G H I J K L M N O P Q R S T U V W X Y Z’
[:punct:] = Punctuation symbols . , ” ‘ ? ! ; : # $ % & ( ) * + – / < > = @ [ ] \ ^ _ { } | ~
. = Wildcard (Joker)
? = The preceding item is optional and will be matched, at most, once
* = The preceding item will be matched zero or more times
+ = The preceding item will be matched one or more times
{N} = The preceding item is matched exactly N times
{N,} = The preceding item is matched N or more times
{N,M} = The preceding item is matched at least N times, but not more than M times
\b = Matches the empty string at the edge of a word
\B = Matches the empty string provided it’s not at the edge of a word
\< = Match the empty string at the beginning of word
\> = Match the empty string at the end of word

Ex :
[^0-9] or [^[:digit:]] or \D = Matches any character which is not a digit
[^[:alnum:]] or \W = Match any character NOT the range 0 - 9, A - Z and a - z
^$ = Empty line
^..$ = A line with 2 characters
^\.[0-9] = A line starting with a dot and a digit
[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3}\.[[:digit:]]{1,3} = Ip address

LFTP c’est comme FTP, mais en mieux.
# apt-get install lftp

Se connecter au serveur ftp :
$ lftp -u username,password -p portnumber x.x.x.x -e 'cd httpdocs'
username = nom de l’utilisateur du compte ftp
password = mot de passe de l’utilisateur ftp
x.x.x.x = adresse ip du serveur
portnumber = numéro du port utilisé
-e = lancer une commande une fois connecté.

Télécharger récursivement, tous les fichiers d’un répertoire :
lftp ~> mirror -c /repertoire_serveur
-c = continue en cas de coupure

Pousser récursivement, tous les fichiers d’un répertoire local sur le serveur :
lftp ~> mirror -R -c /repertoire_local

Quelques options :

Permet d’écraser les fichiers si il existe des fichiers plus récents :
lftp ~> set xfer:clobber on

Ne pas vérifier le certificat du serveur :
(En cas d’erreur : Fatal error: Host key verification failed)
Faire :
lftp ~> set sftp:auto-confirm yes

ou
(En cas d’erreur : Fatal error: Certificate verification: subjectAltName does not match...)
Faire :
lftp ~> set ssl:verify-certificate no

Afficher les fichiers cachés :
lftp ~> set ftp:list-options -a

Afficher toutes les options en cours :
lftp ~> set -a

Obtenir de l’aide sur une commande :
lftp ~> help <commande>

Efface récursivement tous les fichiers qui ont le même MOTIF :

Script à exécuter sur l’ordinateur local

#!/bin/bash
server="-u ftp_username,ftp_password -p portnumber xxx.xxx.xxx.xxx"
work_folder="httpdocs/wp-content/uploads"
motif="motif a chercher"

{
  {
    lftp ${server} << EOF
    find ${root_folder} | grep ${motif}
    quit
    EOF
  } | awk '{ printf "rm \"%s\"\n", $0 }'
} | lftp ${server}
# (Commenter le dernier pipe pour obtenir une simulation du résultat)

SFTP :

$ lftp sftp://<LOGIN>@<ADRESSE IP>:<PORT>

Afficher tous les fichiers, dans le répertoire actuel, dont le nom comporte un motif :
$ ls -al | grep "motif"

La même chose, mais récursivement dans tous les répertoires, depuis le répertoire actuel :
$ find . -name "*motif*"

Afficher avec FIND de la même manière que ls :
$ find . -name "*motif*" -exec ls -al {} \;

Effacer récursivement tous les fichiers qui correspondent à un motif :
$ find . -name "*motif*" -exec rm {} \;

Afficher tous les fichiers qui ont une taille supérieure à 10Mo :
$ find . -size +10M

Chercher à l’intérieur des fichiers :

$ find . -name "*.php" -print | xargs grep "motif"
Cherche QUE dans les fichiers .php

$ find . -type f -print | xargs grep "motif"
Cherche dans TOUS les fichiers
<=> Find in project

Pour traiter les fichiers qui contiennent des espaces :
$ find . -type f -print0 | xargs -0 grep "motif"