Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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

cp/home/rits/desktop/folder1
cp/home/rits/desktop/folder2

and I get

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

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

2 Answers 2

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

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

 
discard

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.