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
Related videos on Youtube
Author by
Robin
Updated on September 18, 2022Comments
-
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 over 10 yearsFirst, 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 over 10 yearsPost the output of
[-d /home/advenio/etc/.vim/colors ] && echo "dir" || echo "not dir"
-
Avinash Raj over 10 yearsYou said, i want to copy from
~/Downloads/vim-colorschemes-master
then why do you trycp colors/* ~/etc/.vim/colors
? -
Robin over 10 years@user68186 Ok you were correct abut it.
-
Robin over 10 years@AvinashRaj actually I wan to copy the contents of colors in the vim/color dir
-
Avinash Raj over 10 yearsstill it was unclear.Post the full path(for both source and destination)
-
precise over 10 yearsRobin 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 over 10 yearshe will need sudo for copying into /etc ;)
-
Robin over 10 yearsI tried so, but still getting this error:
cp: target ‘/etc/.vim/colors’ is not a directory
. -
Robin over 10 yearsOk I had to remove
.
from.vim
but now getting this error:cp: cannot stat ‘colors/*’: No such file or directory
. -
Robin over 10 yearsI am getting an error:
cp: cannot stat ‘colors/*’: No such file or directory
-
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 ofcp ~/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 over 10 yearsI fixed the command but make sure that you downloaded/cloned vim-colorschemes in ~/Download
-
Zanna over 7 yearsthis 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 over 7 yearsit seems the correct location was
/etc/vim/colors
(the.
was the whole problem I think)