preload preload preload preload

Shell Script : remplacer des espaces dans un nom de ficher


Le vendredi 21 décembre 2012 par madpellzo Linux, Shell Script 7 commentaires
La commande "find" cherche tous les fichiers dans le répertoires courant et applique une jolie expression régulière afin de remplacer les espaces contenus dans le nom des fichiers par un tiret haut ou par rien (2 commandes distinctes)

Remplacer les espaces par un tiret haut :

find . -type f -regex ".*\ .*" \
-exec bash -c 'echo "$1";mv "$1" "${1// /-}"' '{}' '{}' \;


Remplacer les espaces par rien :

find . -type f -regex ".*\ .*" \
-exec bash -c 'echo "$1";mv "$1" "${1// /}"' '{}' '{}' \;


Et voilà !

Mots clés : aucun

  • Commentaires

  • Avatar Gravatar
     Wisata Flores
     #1 Le 07 novembre 2017

    Great post. I was checking continuously this blog and I am impressed!
    Very helpful information specifically the ultimate part :) I maintain such info a lot.

    I used to be seeking this certain information for a very long time.
    Thank you and good luck.

  • Avatar Gravatar
     BandarQ online terpercaya
     #2 Le 15 décembre 2017

    Hey! I understand this is sort of off-topic but I had to ask.
    Does managing a well-established website such as yours require
    a massive amount work? I'm completely new to blogging however I do write in my diary daily.

    I'd like to start a blog so I can easily share my personal experience and feelings online.

    Please let me know if you have any kind of recommendations
    or tips for brand new aspiring bloggers. Thankyou!

  • Avatar Gravatar
     set alarm using siri
     #3 Le 27 décembre 2017

    Wonderful article! This is the kind of info that are supposed to be shared across the
    web. Shame on the search engines for no longer positioning this put up upper!
    Come on over and talk over with my website . Thank you =)

  • Avatar Gravatar
     Daftar Togel
     #4 Le 09 avril 2018

    Hi there, I found your blog by meawns of Google even as looking ffor a related matter, yoour website got here up, it looks
    great. I have bookmarked itt in my google bookmarks.
    Hello there, just turned into alert to your blog through Google, and found that it's really informative.
    I'm goong to watch out for brussels. I will apprwciate
    for those who continue this in future. Lots of people wilkl probably
    be benefited from youur writing. Cheers!

  • Avatar Gravatar
     Http://read68.com
     #5 Le 30 avril 2018

    My codeг is trying to cօnvіnce me to move too .net from
    ᏢHP. I have always disⅼiked tһe idea because of
    thе expenses. But he's tryiong none the lesѕ. I've ƅesen usіhg Movable-type on numerous webѕites for about a year and am
    anxious about swіtching to anothyer platform. I have heard very good thingѕ about blogengine.net.
    Is there a way I can import all mʏ wordpress cohtent іnto it?
    Any kkind of help wօuld bе greatly appreciɑted!

  • Avatar Gravatar
     91video.Co
     #6 Le 30 avril 2018

    Have you еver considered writing an ebook or guest authoring on othedr websitеs?
    I have a blog bаseԀ upon on the same toріcs you discuss and would lоve tо һave you sһare somme stories/information. I қnow my readers would enjoy
    your work. If you are even remotely interested, feel free
    to send mе an email.

  • Avatar Gravatar
     Dominoqq Online
     #7 Le 07 juin 2018

    Thanks for finally writing about >Shell Script :
    remplacer des espaces dans un nom de ficher - Madpellzo <Loved it!

  • Ecrire un commentaire








    Quelle est la deuxième lettre du mot eyks ?