Ubuntu – Copying file from folder 1 to folder 2 in terminal

command lineexecute-command

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.

Best Answer

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.