Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free.

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 am trying to move a text file from folder 1 to folder 2 via terminal. I'm doing this for a school project to show what actually happens when you copy paste.

I'm doing


and I get

rits@W:~$ cp/home/rits/desktop/folder1
bash: cp/home/rits/desktop/folder1: No such file or directory

If you guys can help me out or have any other commands to show how to do basic things like formatting a USB, deleting a file, making a new folder, copying and pasting, moving files via terminal please comment.

share|improve this question
You may find this cheatsheet useful, which lists and gives explanations of some of the most common commands. – konapun Sep 5 '13 at 15:00
Any command in bash require minimum one space between its name and its arguments. cp is not an exception from the rule. Please see man cp. – Radu Rădeanu Sep 5 '13 at 16:08

Spot the difference:

cp /home/rits/Desktop/folder1/name_of_textfile /home/rits/Desktop/folder2/
  • a space after cp
  • desktop will be with a D, not a d
  • after that are 2 arguments: filename and destination
  • if you want to copy directories you need -R as an option after cp.
share|improve this answer
what if the folder name has a space in it? do i have to use an escape character? – BKSpurgeon Jan 28 at 4:17
Easier: use " (cp "/test /a" "/test /b") – Rinzwind Jan 28 at 7:34

You're using cp the incorrect way, and possibly your desktop folder is called Desktop (but in fact I am on a national language version, so I cannot be sure).

Let's assume that you have these 2 folders:

  1. /home/rits/Desktop/folder1
  2. /home/rits/Desktop/folder2

Also assume that folder1 contains the file: text.txt. Now if you'd like to copy text.txt from folder1 to folder2, you'd go:

cp /home/rits/Desktop/folder1/text.txt /home/rits/Desktop/folder2 

To learn more about commands, either read the manual page of that command by typing man command_name or you can search the internet, and find a vast amount of beginner information like:

share|improve this answer
Location for folder1 is /home/rits/Desktop – Destro Sep 5 '13 at 15:24
Unix paths are case sensitive, so your commands must follow suit. Besides the syntax issues, it is just one other reason when the No such file or directory error message appears. – lgarzo Sep 5 '13 at 16:04

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.