Get the App
SLTechnology News&Howtos  ›  Development  › 

How does Linux view the first 10 lines of a file

Shulou Source: shulou.com Published: 2022-06-01 21:22:59 10月02日 Update

This article mainly analyzes how Linux views the relevant knowledge points of the first 10 lines of the file, the content is detailed and easy to understand, the operation details are reasonable, and has a certain reference value. If you are interested, you might as well follow the editor to have a look, and follow the editor to learn more about "how to view the first 10 lines of a file by Linux".

In the Linux system, there is time to view the contents of the file, but mainly to look at the first few lines, there is no need to see all the contents of what to do?

A head & & tail to view the first 10 lines of the file

Head-n 10 / tmp/tmpfile 10 lines after viewing the file

Tail-n 10 / tmp/tmpfile starts at 10 lines and displays 20 lines, that is, 10-19 lines

Cat filename | tail-n + 10 | head-n 20 shows 100 to 300 lines

Cat filename | head-n 300 | tail-n + 100 decomposition

Tail-n 500 # displays the last 500 lines tail-n + 1000 # displays from 1000 lines, displays head-n 1000 # lines after 1000 lines, displays the first 1000 lines, two sed view files, 100lines to 300lines

Sed-n'5, 10p 'filename on "how to view the first 10 lines of Linux file" is introduced here, more related content can be searched for previous articles, hope to help you answer questions, please support the website!

Tags: Documents content knowledge follow necessity value interest how to do articles time easy to understand more knowledge points questions and answers articles systems details websites analysis references Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Redmi Microsoft Shulou Information Huawei