Results 1 to 5 of 5

Thread: need help with cp command

  1. #1
    Join Date
    Mar 2009
    Beans
    24

    need help with cp command

    I entered the following command in the terminal:

    cp `ls /usr/share/pixmaps | grep .*xpm` ~/TEST2

    and got this error for each matching file:

    cp: cannot stat `aisleriot.xpm': No such file or directory
    cp: cannot stat `baobab.xpm': No such file or directory
    cp: cannot stat `blackjack.xpm': No such file or directory

    what have I done wrong?

    cheers

  2. #2
    Join Date
    May 2007
    Beans
    1,091

    Re: need help with cp command

    try using
    sudo cp /usr/share/pixmaps/*.xpm ~/TEST2

  3. #3
    Join Date
    Mar 2009
    Beans
    24

    Re: need help with cp command

    thanks that works, however I would still like to know what was wrong with the way i did it because i still dont quite understand how the backticks work. I tried all the stuff between the ticks just by itself which worked, and from my understanding the output of that should have been used in the copy command?

  4. #4
    Join Date
    Mar 2007
    Location
    Denver, CO
    Beans
    7,958
    Distro
    Ubuntu Mate 16.04 Xenial Xerus

    Re: need help with cp command

    Sounds to me like the full path is not included in the output.

  5. #5
    Join Date
    Mar 2009
    Beans
    24

    Re: need help with cp command

    Ah no wonder!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •