Linux basic commands on file operations (in case)

Source: Internet
Author: User
Linux basic commands on file operations (in case) in the root directory (/) to create a new directory tew.kdir/test to change the current directory to/test, under this directory, create an empty file with the abbreviation of your own name, and then create two subdirectories (-xh) and (ah );... linux basic commands on file operations (in case) in the root directory (/) to create a new directory test mkdir/test to change the current directory to/test, under this directory, create an empty file with the abbreviation of your own name, and then create two subdirectories (-xh) and (ah ); mkdir-p/test/ycy/ah mkdir/test/ycy/-xh enter the (-xh) subdirectory and create an empty file text1; touch/test/ycy/-xh/text1 enter the (ah) subdirectory, create a new subdirectory (abc), and create an empty file text2; mkdir test/ycy/ah/abc Touch/test/ycy/ah/text2 move the newly created text1 file to the newly created abc subdirectory and change it to text3, copy the text2 file to the-xh subdirectory; mv/test/ycy/-xh/text1/test/ycy/ah/abc/text3 cp/test/ycy/ah/text2/test/ycy/-xh delete the text3 file and -files in the xh subdirectory and directory; and delete the abc subdirectory; rm/test/ycy/ah/abc/test3 Rm-rf/test/ycy/-xh Delete a non-empty directory Rmdir/test/ycy/ah/abc clear screen; clear creates a directory test1 under the root directory (/), copies/etc/passwd to/test1 and/test respectively, and changes it to file1 and file respectively; mkdir/test1 Cp/etc/passwd/test1/file1 Cp/etc/passwd/test/file view and record the first two and last two lines of the file1 file; head-2/test1/file1>/fish Tail-2/test1/file1>/fish: view the files in the/etc/directory and record the names of the first two files; ls/etc | head-2> fish2: view and record all files in the/etc/directory that contain the sys letter; find-name/etc/* sys *> view the first two files in the/etc/directory that contain conf; ls/etc/* conf * | head-2: compress the file to/test1, and name it file.gz Zip/test1/file.zip/test/file. package file1into file.tar.gz and decompress it to/test; tar-zcvf file.tar.gz file1 tar-zxvf file.tar.gz/test to create a soft link file in the/test/file. soft to/test1; ln/test/file/test1/file. soft clear screen; clear

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.