copying the contents of a directory from Downloads to /etc

8,290

Solution 1

~ refers to the home directory (in your case /home/advenio/). The place you want to copy it to is /etc/vim/colors

Try the command sudo cp ~/Downloads/path_to_colors/colors/* /etc/vim/colors

Solution 2

Try the following command:

sudo mkdir -p /etc/vim/colors && sudo cp ~/Downloads/vim-colorschemes*/colors/* /etc/vim/colors
Share:
8,290

Related videos on Youtube

Robin
Author by

Robin

Updated on September 18, 2022

Comments

  • Robin
    Robin almost 2 years

    I want to copy the contents of a folder colors from ~/Downloads/vim-colorschemes-master to /etc/vim/colors. I tried this as instructed:

    cp colors/* ~/etc/.vim/colors
    

    But I am getting the error:

    cp: target ‘/home/advenio/etc/.vim/colors’ is not a directory
    

    How do I do this correctly?

    • user68186
      user68186 over 10 years
      First, are you sure you have an etc folder in your Home (/home/advenio)? Normally there isn't one there. Second, if your destination is /etc, then are you sure the vim folder has a dot in front of it?
    • Avinash Raj
      Avinash Raj over 10 years
      Post the output of [-d /home/advenio/etc/.vim/colors ] && echo "dir" || echo "not dir"
    • Avinash Raj
      Avinash Raj over 10 years
      You said, i want to copy from ~/Downloads/vim-colorschemes-master then why do you try cp colors/* ~/etc/.vim/colors?
    • Robin
      Robin over 10 years
      @user68186 Ok you were correct abut it.
    • Robin
      Robin over 10 years
      @AvinashRaj actually I wan to copy the contents of colors in the vim/color dir
    • Avinash Raj
      Avinash Raj over 10 years
      still it was unclear.Post the full path(for both source and destination)
    • precise
      precise over 10 years
      Robin just run mkdir -p ~/etc/.vim/colors && cp -rt ~/etc/.vim/colors ~/Downloads/vim-colorschemes-master/colors/* You can check my answer below for more..
  • Rinzwind
    Rinzwind over 10 years
    he will need sudo for copying into /etc ;)
  • Robin
    Robin over 10 years
    I tried so, but still getting this error: cp: target ‘/etc/.vim/colors’ is not a directory .
  • Robin
    Robin over 10 years
    Ok I had to remove . from .vim but now getting this error: cp: cannot stat ‘colors/*’: No such file or directory .
  • Robin
    Robin over 10 years
    I am getting an error: cp: cannot stat ‘colors/*’: No such file or directory
  • Hugo Buff
    Hugo Buff over 10 years
    colors needs to be in your working directory. I don't know the full path, but if you do something along the lines of cp ~/Downloads/vim-colorschemes-master/colors/* /etc/vim/colors it should work fine. Bear in mind that that's a guess since I don't know your file structure.
  • Sylvain Pineau
    Sylvain Pineau over 10 years
    I fixed the command but make sure that you downloaded/cloned vim-colorschemes in ~/Download
  • Zanna
    Zanna over 7 years
    this isn't really what OP wanted, they actually wanted to copy the contents, not the directory, although it wasn't clear from the question
  • Zanna
    Zanna over 7 years
    it seems the correct location was /etc/vim/colors (the . was the whole problem I think)