Outils pour utilisateurs

Outils du site


cmd:mv

Différences

Ci-dessous, les différences entre deux révisions de la page.

Lien vers cette vue comparative

cmd:mv [2018/02/17 21:29] – Création avec "Convertir les noms de fichiers en lowercase" rootcmd:mv [2020/04/28 22:41] (Version actuelle) – mhtml -> html root
Ligne 1: Ligne 1:
 ====Convertir les noms de fichiers en lowercase==== ====Convertir les noms de fichiers en lowercase====
 ===Méthode propre et lente=== ===Méthode propre et lente===
-Il faut commencer par obtenir le nombre de sous-dossier maximum : [[https://unix.stackexchange.com/questions/369453/how-to-find-a-depth-of-a-directory|How to find a depth of a directory]] {{ :cmd:mv:command_line_-_how_to_find_a_depth_of_a_directory_-_unix_linux_stack_exchange.mhtml |Archive}}+Il faut commencer par obtenir le nombre de sous-dossier maximum : [[https://unix.stackexchange.com/questions/369453/how-to-find-a-depth-of-a-directory|How to find a depth of a directory]] {{ :cmd:mv:command_line_-_how_to_find_a_depth_of_a_directory_-_unix_linux_stack_exchange_2020-04-28_10_37_57_pm_.html |Archive du 06/06/2017 le 28/04/2020}}
 <code bash> <code bash>
 find . -printf '%d\n' | sort -rn | head -1 find . -printf '%d\n' | sort -rn | head -1
 </code> </code>
  
-Puis faire une boucle en renommant progressivement l'arborescence : [[https://stackoverflow.com/questions/152514/how-to-rename-all-folders-and-files-to-lowercase-on-linux|How to rename all folders and files to lowercase on Linux?]] {{ :cmd:mv:how_to_rename_all_folders_and_files_to_lowercase_on_linux_-_stack_overflow.mhtml |Archive}}+Puis faire une boucle en renommant progressivement l'arborescence : [[https://stackoverflow.com/questions/152514/how-to-rename-all-folders-and-files-to-lowercase-on-linux|How to rename all folders and files to lowercase on Linux?]] {{ :cmd:mv:how_do_i_rename_all_folders_and_files_to_lowercase_on_linux_-_stack_overflow_2020-04-28_10_38_05_pm_.html |Archive du 30/09/2008 le 28/04/2020}}
 <code bash> <code bash>
 for j in $(seq 1 `find . -printf '%d\n' | sort -rn | head -1`); do for i in $( find -maxdepth $j | grep [A-Z] ); do mv -i "$i" "`echo $i | tr 'A-Z' 'a-z'`"; done; done; for j in $(seq 1 `find . -printf '%d\n' | sort -rn | head -1`); do for i in $( find -maxdepth $j | grep [A-Z] ); do mv -i "$i" "`echo $i | tr 'A-Z' 'a-z'`"; done; done;
Ligne 12: Ligne 12:
  
 ===Méthode rapide et bourrin=== ===Méthode rapide et bourrin===
-[[https://stackoverflow.com/questions/152514/how-to-rename-all-folders-and-files-to-lowercase-on-linux|How to rename all folders and files to lowercase on Linux?]] {{ :cmd:mv:how_to_rename_all_folders_and_files_to_lowercase_on_linux_-_stack_overflow.mhtml |Archive}}+
 <code bash> <code bash>
 zip -r foo.zip foo/* zip -r foo.zip foo/*
 unzip -LL foo.zip unzip -LL foo.zip
 </code> </code>
cmd/mv.1518899356.txt.gz · Dernière modification : 2018/02/17 21:29 de root