Copying file from folder 1 to folder 2 in terminal

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.

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:

  • https://help.ubuntu.com/community/CommandLineResources