Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've faced a problem when copying a file with the commands,

cp ~/Downloads/sample.pdf ~/Desktop/

But the terminal gives me a message, cp: cannot stat 'sample.pdf': No such file or directory.

share|improve this question
What is the output of ls -al when you run it from ~/Downloads? You'll see the error you're seeing if there isn't a file of the exact same name present to be copied. – user25656 Feb 22 '13 at 18:20
up vote 4 down vote accepted

Have you verified that sample.pdf is the exact filename in the downloads folder? It looks like the path is incorrect and that file doesn't actually exist there. Try this...

ll ~/Downloads

See if sample.pdf shows up in the file list.

share|improve this answer
Actually I got a typo in the terminal, anyway thanks for your answer. – Herks Feb 22 '13 at 13:38

If the file exists you have maybe not the correct permissions zu copy the file. Run in a terminal: sudo chmod 775 /home/<user>/Downloads/sample.pdf to grant yourself the permissions and sudo chown <your-user>:<your-user-group> /home/<user>/Downloads/sample.pdf to own the file and try to copy it again. Your user-group shoul be the same value as your user.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.