One linux Command every day (14): head command

Source: Internet
Author: User
Tags touch command


One linux Command every day (14): head command link: One linux Command every day (1): ls command http://www.bkjia.com/ OS /201210/163049.html#linuxlinuxcommand every day (2): cd command serial (3 ): pwd command Export (4): mkdir command http://www.bkjia.com/ OS /201210/1620.3.html#a linuxcommand every day (5): rm command Export (6): rmdir command http://www.bkjia.com/ OS /201210/164017. Html; one linux Command every day (7): mv command running (8): cp command http://www.bkjia.com/ OS /201210/163164.html#a linuxcommand every day (9): touch command running (10): cat command running (11 ): nl command http://www.bkjia.com/ OS /201211/165990.htmla linuxcommand every day (12): more command http://www.bkjia.com/ OS /201211/165994.htmllinuxcommand every day (13): Less command http://www.bkjia.com/ OS /201211/165998.html head and tail are as simple as their names, it is used to show a certain number of text blocks at the beginning or end, head is used to display the beginning of an archive to the standard output, while tail takes it for granted as the end of the archive. 1. command Format: www.2cto.com head [parameter]... [file]... 2. command: The head command is used to display the beginning of the file to the standard output. By default, the head command prints the first 10 lines of the corresponding file. 3. command Parameter:-q hide file name-v display file name-c <byte> display number of bytes-n <number of rows> display number of rows 4. use instance: instance 1: display the first n lines of the file command: head-n 5 log2014.log output: [root @ localhost test] # cat log2014.log 2014-012014-022014-032014-042014-052014-062014-072014-082014-092014-102014-12 ==== =================================== [root @ localhost test] # head-n 5 log2014.log 2014-012014- 022014-032014-042014-05 [root @ localhost test] # instance 2: command to display the first n Bytes of the file: head-c 20 log2014.log output: [root @ localhost test] # head-c 20 log2014.log2014-012014-022014 [root @ localhost test] # instance 3: Command for the content of the file except the last n Bytes: head-c-32 log2014.log output: [root @ localhost test] # head-c-32 log2014.log2014-012014-022014-032014-042014-052014-062014-072014-082014-092014-102014-112014-12 [root @ localhost test] # instance 4: command: head-n-6 log2014.log output: [root @ localhost test] # head-n-6 log2014.log2014-012014-022014-032014-042014-052014-062014-07 [root @ localhost test] #

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.