#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2003
    Posts
    4
    Rep Power
    0

    Question copy mulitple items with unique names


    Hi, I'm trying to copy multiple items with unique names from one remote location to another. I'm wondering if this is possible using cp (or something else)?

    Here's what i'm trying to do - i've got these files, one called cat. jpg, another called dog.jpg and another called hamster.jpg, and i want to copy all of them to another directory using just one line instead of three. Any ideas?

    Thanx.
    AN
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2004
    Location
    USA
    Posts
    61
    Rep Power
    14
    cp *.jpg ~/

    This will copy all the .jpg files in the current directory to your home folder. If you only want to copy cat.jpg, dog.jpg, and hamster.jpg then you can use:

    cp cat.jpg ~/ | cp dog.jpg ~/ | cp hamster.jpg ~/

    Which technically is one line but still a pain.
    Last edited by Locke; May 1st, 2004 at 11:56 AM.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    May 2004
    Location
    Pacific NW, USA
    Posts
    27
    Rep Power
    0
    alternatively -

    $ cp cat.jpg ~/ ; cp dog.jpg ~/ ; cp hamster.jpg ~/

IMN logo majestic logo threadwatch logo seochat tools logo