Jack
Jack

Reputation: 343

How to copy a specific file in a folder using terminal

I am using terminal on linux. I am in my current folder now. I want to take a file in this folder that I am currently in and copy it in the exact same folder and I also want to rename it.

What command should I use?

Upvotes: 14

Views: 33462

Answers (2)

Ali Farshidi
Ali Farshidi

Reputation: 51

If you wanna copy a file like .cpp file it is really easy to use:

cp filename.cpp destination 

Upvotes: 4

Srini V
Srini V

Reputation: 11355

Copy command works well.

cp /currentfolder/filename /currentfolder/newfilename

Upvotes: 28

Related Questions