Home > Common Problem > Detailed explanation of linux head command

Detailed explanation of linux head command

(*-*)浩
Release: 2019-09-02 15:18:59
Original
6319 people have browsed it

Detailed explanation of linux head command

Overview: head command is used to display file text blocks(Recommended learning: web front-end video tutorial)

1. Format

head [Parameter] [File]

2. Parameter

-q Hide file name

-v Display file name

-c Number of bytes displayed

-n Number of lines displayed

3. Example

#创建文件 head.txt
cat > head.txt<<EOF
> 1
> 2
> 3
> 4
> 5
> 6
> 7
> 8
> 9
> 10
> 11
> 12
> EOF
Copy after login
#显示前5行
head -n  5 head.txt
Copy after login
#显示前5个字节
head -c 5 head.txt
Copy after login

The above is the detailed content of Detailed explanation of linux head command. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template