Cant copy a file in Linux: cp: target '/.local/lib/python3.6/site-packages/certifi' is not a directory
I am using Ubuntu 18. I want to copy two files in a directory from the desktop to the following directory: home/me/.local/lib/python3.6/site-packages/certifi
I executed this command:
~/Desktop$ sudo cp servers-certs/cert1.pem servers-certs/cert2.pem /home/me/.local/lib/python3.6/site-packages/certifiI get this error:
cp: target '/.local/lib/python3.6/site-packages/certifi' is not a directoryI tried to navigate manually through the GUI. But when I enter the \home\me I can't find the .local directory.
My questions:
1) How to copy the two files from the desktop directory I specified to the other directory?
2) Why I can not see .local directory? how can I see it?
2 Answers
If the target was /home/me/.local/lib/python3.6/site-packages/certifi as you claim, cp would be complaining about it literally (if ever). It complains about /.local/lib/python3.6/site-packages/certifi instead. Note this is a different path. Two explanations:
- Either you put a space between
/home/meand/.local/lib/…you didn't want to put (highly probable); runcpwith the right target path. Or there really is a space after
me, the directory name is"me "(uncommon but still technically possible); in this case you should quote the whole target:"/home/me /.local/lib/python3.6/site-packages/certifi"
Normally you cannot see .local because objects starting with . (dot) are "hidden". With ls you need -a option. Many GUI tools react to Alt+. (dot), this toggles the visibility of such objects.
The error cp: target '/.local/lib/python3.6/site-packages/certifi' is not a directory means there is no directory /home/me/.local/lib/python3.6/site-packages/certifi, you need to make it, from the terminal:
cd /home/me/.local/lib/python3.6/site-packages
mkdir certifi this is assuming the directory /home/me/.local/lib/python3.6/site-packages exists
then do you cp command again
The reason you don see the .local is because files and direcories starting with a dot are hidden, you can make them visible in nautilis by clicking the "View" menu and then click on the "Hidden Files" option.
1