Rename multiple folder

Discussion in 'Command Line' started by laurentv, Sep 16, 2013.

  1. laurentv

    laurentv Member

    Messages:
    30
    Likes Received:
    2
    Trophy Points:
    8
    I try to rename multiple folder :
    /var/www/html/site1/mailing/ >> /var/www/html/site1/_mailing/
    /var/www/html/site2/mailing/ >> /var/www/html/site1/_mailing/

    Help :)

  2. ryanvade

    ryanvade Administrator Staff Member Staff Writer

    Messages:
    1,274
    Likes Received:
    431
    Trophy Points:
    83
    mv /var/www/html/site1/mailing/ /var/www/html/site1/_mailing/
    mv /var/www/html/site2/mailing/ /var/www/html/site1/_mailing/

    if needed run as root or use sudo
  3. laurentv

    laurentv Member

    Messages:
    30
    Likes Received:
    2
    Trophy Points:
    8
    in fact I get a list of directory after a find command, and I want to rename these folders automatically
  4. ryanc

    ryanc New Member

    Messages:
    12
    Likes Received:
    7
    Trophy Points:
    3
    I think this is going to be a little tricky but where you want to start looking is the command xargs and piping.

    eg.

    find <options> | xargs <some other stuff>
  5. GrumpyOldMan

    GrumpyOldMan Active Member

    Messages:
    136
    Likes Received:
    45
    Trophy Points:
    28

Share This Page