Linux Advanced Commands (II): View the contents of the file command, can speak commands to view large files using the split-screen display

Look at the file command


learning target

  • View Larger files can say split-screen display using the command

1. Check the contents of the file using the command

command Explanation
cat View small file
more Split-screen viewing of large files

Cat command renderings

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-ZrzzY8y8-1583934399870) (imgs / cat.png)]

Description:

  • The cat command redirection can be done in conjunction with the merger of multiple files
  • gedit file editing commands, you can view and edit documents

FIG effect more command

When the information is too long can not be displayed on a screen to view content, you can use the more command to display the contents of a file in the terminal distribution.

[Image dump the chain fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-I25xMT3c-1583934399871) (imgs / more.png)]

Operation Button Description:

Operation keys Explanation
Blank Display the next screen
Enter Display the next line.
b Information is displayed on a screen
f Display the next screen
q drop out

2. The pipe (|) using the command

Pipes (|): a command output can be used as another command is input through the pipeline, will be understood to be a container, the contents stored in the terminal display.

Pipe command renderings:

[Pictures of foreign chains dumping fails, the source station may have security chain mechanism, it is recommended to save the picture down uploaded directly (img-a1eeKF3i-1583934399871) (imgs /% E7% AE% A1% E9% 81% 93% E5% 91% BD% E4% BB% A4.png)]

Description:

Pipe (|) in conjunction with more general command, mainly to see the distribution terminal display.

3. Summary

  • View of small files using cat command
  • Split-screen viewing of large files using the more command,
  • Check the contents of the display terminal and split-screen display, use the pipe (|) combined with more command.
Published 698 original articles · won praise 929 · views 120 000 +

Guess you like

Origin blog.csdn.net/qq_35456045/article/details/104806715
Recommended