Linux from Getting started to mastering (i) (creating files, viewing files)

Source: Internet
Author: User

1. Create File command: Touch

    • To create a file:

    • Create a file with spaces: Just wrap the file name with "".

2. View file Contents command: Cat

    • View File: Cat file name
    • View the file and display the line number: cat-n filename, where n means

3. Reverse View File Contents command: TAC (cat in turn)

Such as:

Cat command:

TAC Command:

Content opposite display

4. If the file has more content, you need to use the command: more

Next you can use:

    • Space or F to page through
    • Use Enter to view the line in a row
    • Use Q to exit when you are finished viewing

5. When you flip the page down with the more command, use the command: less

    • Space or F to page through
    • Use Enter to view the line in a row
    • If you turn over, you can use PageUp to turn up.
    • Press the UP ARROW line to go up
    • You can also search by pressing ENTER by/service (/keyword), and after you press ENTER, the results of the search are highlighted, and you can press N to go down (n = next)

6. View the first few lines of the file, command: Head

    • Head-n Service: View the first 20 rows of data in the service file
    • Head Service: View the first 10 rows of data for the service file by default

7. View the following lines of the file, command: Tail

    • Tail-n Service: View the following 20 rows of data in the service file
    • Tail Service: View the following 10 rows of data from the service file by default
    • TAIL-F: Dynamically display the content at the end of a file
      • To view dynamic logs:

8. Bind a virtual network card for the Linux system's network card operation as follows:

  

Linux from Getting started to mastering (i) (creating files, viewing files)

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.