Linux command line

  
        Cat: View all Format: cat [options]… filename … -n: display the line number before each line (including blank lines) more:Read Format: more [options] filename … press Enter to scroll down one row Press the space bar to scroll down one screen Press b to scroll up one screen Press q or Q to exit, /to search backwards Press the ? key to understand the operation instructions less reading (better) less [options] File name … Press PgUp to flip forward Page, PgDn page backward Press the ? button to forward, press /to search backward (n, N switch) Others are similar to the more command

Extract text content head/tail: Intercept file header/tail Format: Head -n number file name ???tail -n number file name 1. When no line number is specified, the default output is 10 lines. 2. The option 'ld';-n number” can be abbreviated as “-number”

Redirect output

>: Redirect output Example: Save the man page of the ls command as a file.txt file #man ls > file.txt

Pipeline operation
>

View lines 8-12 of the file #head -n 12 /etc/passwd

Copyright © Windows knowledge All Rights Reserved