One linux command every day (14): head Command

Source: Internet
Author: User
Every day, a linux command (14): head command link: A linux command (1): ls command (2): cd command http://www.2cto.com/ OS /201210/163050.html#a linux command every day ..
One linux command every day (14): head command link: One linux command every day (1): ls command http://www.2cto.com/os/201210/163049.html ; One linux command every day (2): cd command http://www.2cto.com/os/201210/163050.html ; One linux command every day (3): pwd command http://www.2cto.com/os/201210/163462.html ; One linux command every day (4): mkdir command http://www.2cto.com/os/201210/163463.html ; One linux command every day (5): rm command http://www.2cto.com/os/201210/163662.html ; One linux command (6) every day: rmdir command http://www.2cto.com/os/201210/164017.html ; One linux command (7) every day: mv command http://www.2cto.com/os/201210/164247.html ; One linux command every day (8): cp command http://www.2cto.com/os/201210/164254.html ; One linux command every day (9): touch Command http://www.2cto.com/os/201211/165699.html ; One linux command every day (10): cat command http://www.2cto.com/os/201211/165989.html ; One linux command every day (11): nl command http://www.2cto.com/os/201211/165990.html One linux command every day (12): more command http://www.2cto.com/os/201211/165994.html One linux command every day (13): less command http://www.2cto.com/os/201211/165998.html The head and tail are just as easy to understand as their names. they are used to display a certain number of text blocks at the beginning or end, and the head is used to display the beginning of the file to the standard output, and tail takes it for granted that it is the end of the file. 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 <字节> Display byte count-n <行数> Number of lines displayed 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] #
Related Article

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.