Rename multiple folder

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

  1. laurentv

    laurentv Member

    Joined:
    Aug 11, 2013
    Messages:
    30
    Likes Received:
    2
    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

    Joined:
    Aug 4, 2012
    Messages:
    1,854
    Likes Received:
    652
    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

    Joined:
    Aug 11, 2013
    Messages:
    30
    Likes Received:
    2
    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

    Joined:
    Jan 1, 2014
    Messages:
    12
    Likes Received:
    10
    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

    Joined:
    Oct 30, 2013
    Messages:
    220
    Likes Received:
    62

Share This Page