Linux-26-linux Basic Important Command (L005-08)

Source: Internet
Author: User

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)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.