How to copy a specific file to a folder using terminal

I am using terminal in linux. Now I am in the current folder. I want to take the file in this folder, which I am currently entering, and copy it in the same folder, and I also want to rename it.

Which command should be used?

+4
source share
2 answers

The copy command works well.

cp /currentfolder/filename /currentfolder/newfilename 
+13
source

If you want to copy the file as a .cpp file, it is very easy to use:

 cp filename.cpp destination 
0
source

Source: https://habr.com/ru/post/1502433/


All Articles