360 Secure SkillHub
360 安全技能中心

Head Tool

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

dinghaibin
dinghaibin
热度 30.94
最近更新 2026-05-11 17:46:25
分类:效率依赖:代码执行 / 读写文件应用场景:数据处理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add 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