Chmager noms de fichiers indexés

fifi -  
 fifi -
Bonjour,
je voufrais changer tous les noms de fichier dans un directoire qui ont des noms

toto.titi.1 jusqu'au toto.titi.300

dans les fichiers

titi.1 jusqu'à titi.300
Configuration: Linux
Firefox 2.0.0.11

1 réponse

  1. jipicy Messages postés 40842 Date d'inscription   Statut Modérateur Dernière intervention   4 898
     
    Salut,
    jp@MDK:~/tmpfs ssh$ ls -1
    toto.titi.1
    toto.titi.10
    toto.titi.11
    toto.titi.12
    toto.titi.13
    toto.titi.14
    toto.titi.15
    toto.titi.2
    toto.titi.3
    toto.titi.4
    toto.titi.5
    toto.titi.6
    toto.titi.7
    toto.titi.8
    toto.titi.9
    
    jp@MDK:~/tmpfs ssh$ for fich in * ; do echo "mv ${fich} => ${fich#*.}"; done
    mv toto.titi.1 => titi.1
    mv toto.titi.10 => titi.10
    mv toto.titi.11 => titi.11
    mv toto.titi.12 => titi.12
    mv toto.titi.13 => titi.13
    mv toto.titi.14 => titi.14
    mv toto.titi.15 => titi.15
    mv toto.titi.2 => titi.2
    mv toto.titi.3 => titi.3
    mv toto.titi.4 => titi.4
    mv toto.titi.5 => titi.5
    mv toto.titi.6 => titi.6
    mv toto.titi.7 => titi.7
    mv toto.titi.8 => titi.8
    mv toto.titi.9 => titi.9
    
    jp@MDK:~/tmpfs ssh$
    Si c'est bon, change :
    do echo "mv ${fich} => ${fich#*.}"
    par :
    do mv "${fich}" "${fich#*.}"
    ;-))
    -1
    1. fifi
       
      Merci superbe
      0