Home  >  Article  >  Detailed explanation of linux head command

Detailed explanation of linux head command

(*-*)浩
(*-*)浩Original
2019-09-02 15:18:596274browse

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

-c342ea603c775b9916829f2440f436499 Number of bytes displayed

-ne1bb43da1dc495f3a2319be5fe7b6df5 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
#显示前5行
head -n  5 head.txt
#显示前5个字节
head -c 5 head.txt

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!

Statement:
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