Example 4. Copy the 1.txt file from the/data directory to the/temp directory
Solution: Under the/data directory, the CP 1.txt/temp/ command can be copied.
Create a new directory temp with the mkdir command in the root directory.
Then use the CD command to enter the/data directory.
Then use the ls command to view the files in the/data
Then use the CP command to copy the 1.txt to the/temp.
Finally use the CD command to enter the/temp directory with the LS command to see if the copy succeeded
The copy was successful!
"Note" If the current path is not under/data, then the use of cp/data/1.txt/temp/ Copy, the above is a single file with cp copy, if you want to copy the directory, you can use cp-a/etc//temp/ command, which means that the directory/etc is completely copied to/temp.
Example 5. Move the/data directory to the/root
Answer: With the mv/data/root/ command.
Linux-26-linux Basic Important Command (L005-08)