Linux view the contents of files and wc command Detailed

The cat command (and display connection file contents)
use 'cat' command no matter how much the contents of the file, only the last one screen .

more command (Paged view file contents)

  • Press Enter to scroll down line by line
  • Press the spacebar to turn down one screen
  • Press q to exit the
    less command (Paged view file contents)

The same as the more command, but more extensions

  • Page Up Page Up, Page Down Page Down
  • Press the "/" key to find the content, the next content on a content "n", "N"
  • Other features and more basic commands similar to
    the head command (see the beginning of the file contents)

    -15 head / lisi1
    # View lisi1 file begins with 15 lines (default 10 lines)

    tail command (see the end of the file contents)

    -15 tail / lisi1
    # View lisi1 content files ending 15 lines

head and tail can be combined by "|"
columns such as:

head -15 / lisi1 | tail -5
starting with # View lisi1 file 15 lines and look at the last five lines in 15 lines inside

wc command (count the number of words in the document (Word Count) and other information)

  • -l: count the number of rows
  • -w: count the number of words
  • -c: count the number of bytes

Guess you like

Origin blog.51cto.com/14304225/2438934