Rename multiple folder

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

  1. laurentv

    laurentv New Member

    Messages:
    29
    Likes Received:
    2
    Trophy Points:
    3
    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,243
    Likes Received:
    420
    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 New Member

    Messages:
    29
    Likes Received:
    2
    Trophy Points:
    3
    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:
    121
    Likes Received:
    43
    Trophy Points:
    28

Share This Page