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
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)