M HYPE SPLASH
// updates

Cant copy a file in Linux: cp: target '/.local/lib/python3.6/site-packages/certifi' is not a directory

By Emily Wilson

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/certifi

I get this error:

cp: target '/.local/lib/python3.6/site-packages/certifi' is not a directory

I 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:

  1. Either you put a space between /home/me and /.local/lib/… you didn't want to put (highly probable); run cp with the right target path.
  2. 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.

1

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

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy