Home Common Problem Detailed explanation of linux head command

Detailed explanation of linux head command

Sep 02, 2019 pm 03:18 PM
linux

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!

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

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

AI Hentai Generator

AI Hentai Generator

Generate AI Hentai for free.