360 Secure SkillHub
360 安全技能中心

Head Tool

该 Skill 提供 head-tool 命令行工具,可输出文件开头默认 10 行,并支持用 -n 指定行数、用 -c 指定字节数、用 -q 隐藏文件名标题,或在未提供文件时从标准输入读取;适合快速查看日志、CSV 表头和大型文本文件的开头。

分类:效率
dinghaibin
dinghaibin
热度 23.44
最近更新 2026-05-11 17:46:25

安装

发给 Agent
帮我安装这个技能:npx secure-skills-cli add dinghaibin/head-tool
兼容性
通用兼容
联网要求
不联网
数据出网
数据不出本机
Metadata
name
head-tool
description
Display the first lines of files. Use for quickly previewing file contents, checking headers, or sampling data.

File Header Viewer

Output the beginning of files, defaulting to the first 10 lines. Essential for previewing log files, CSV headers, and large text files without loading them entirely.

Usage

head-tool [options] [file...]

Options

  • -n N: Show first N lines (default: 10)
  • -c N: Show first N bytes instead of lines
  • -q: Quiet mode (suppress filename headers)
  • Read from stdin when no file specified

Examples

# Show first 10 lines
head-tool data.csv

# Show first 20 lines
head-tool -n 20 log.txt

# Show first 100 bytes
head-tool -c 100 config.yaml