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!