欢迎访问我的网站,希望内容对您有用,感兴趣的可以加入免费知识星球。

Linux常用命令-15:head

常用命令 迷途小书童 2年前 (2022-06-03) 652次浏览 0个评论

head 命令用来显示文件的内容,和 cat 类似,不接参数时默认打印文件的前10行。

语法格式:head [参数] [文件]

常用参数:

linux head

示例

# 默认显示
head test.txt

# 显示文件的前20行
head -n 20 test.txt

# 显示文件的前20个字符,注意和行的区别
head -c 20 test.txt
喜欢 (0)

您必须 登录 才能发表评论!

Ads Blocker Image Powered by Code Help Pro

Ads Blocker Detected!!!

请关闭 Adblock 等类似浏览器插件,然后刷新页面访问,感谢您的支持!

We have detected that you are using extensions to block ads. Please support us by disabling these ads blocker.