In Linux, cp command stands for copy, the main role is to copy a file or folder, similar to the copy function under Windows.
Suppose the user is currently in the home directory WinTest, the path is / home / wintest, folder exists testA, testB and TestC, subfolders exist testD the testA, the presence of file testB test.ini
- In testB, test.ini files copied to the TESTC
cp test.ini ../testC - In the current user's home directory, copy the entire folder testA to testC next
cp -r testA / ./testC
Note: Here, the role of -r parameter recursive continuous replication, because there are other directories under testA testD, can not be directly copied to testC, if you do not use the -r option, it will error: cp: omitting Directory testA `/ '