← 返回
未分类 中文

Wc Tool

Count lines, words, characters, and bytes in one or more files with per-file and total summary. Use for document statistics, code analysis, and data volume e...
统计一个或多个文件的行数、词数、字符数和字节数,提供每个文件及总计摘要。适用于文档统计、代码分析和数据量评估等。
dinghaibin dinghaibin 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 236
下载
💾 0
安装
1
版本
#latest

概述

WC Tool — Word, Line & Character Counter

Multi-file word count utility. Count lines, words, characters (multibyte-aware), and bytes across one or more files with per-file breakdown and grand total. Supports standard input for pipeline use.

Quick Start

# Count everything for a file
wc-tool document.txt

# Count lines only
wc-tool -l script.py

# Count from stdin
cat file.txt | wc-tool -w

Usage

wc-tool [OPTIONS] [FILE...]
cat INPUT | wc-tool [OPTIONS]

Options:
  -l, --lines     Count lines only
  -w, --words     Count words only
  -c, --bytes     Count bytes only
  -m, --chars     Count characters (multibyte-aware)
  -L, --max-line  Print length of longest line
  --files0-from FILE   Read input file list from FILE (null-separated)
  --total          Show grand total (default with multiple files)
  --json          Output as structured JSON

Examples

# Full count (lines, words, chars, bytes)
wc-tool README.md

# Lines only (code file size metric)
wc-tool -l src/main.py src/utils.py

# Characters in a file (UTF-8 aware)
wc-tool -m document.txt

# Longest line length
wc-tool -L src/main.py

# Pipe from another command
ls /usr/bin | wc-tool -l

# JSON output for automation
wc-tool -l -w *.py --json

# Multiple files with total
wc-tool *.txt

Features

  • 4 modes — lines, words, characters (multibyte), bytes
  • Multi-file — process many files, show per-file + total
  • Stdin support — pipe input from other commands
  • Longest line — detect max line length
  • JSON output — structured for scripts
  • Null-separated file list — safe file name handling
  • Exit code 0/1 — script-friendly

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-05-12 05:37 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

Automation Workflow

dinghaibin
创建并管理自动化工作流,以处理重复性任务。适用于需要安排周期性数据同步、链式API调用、设置触发动作等场景。
★ 0 📥 374

Schedule Task

dinghaibin
在 Linux/Unix 系统上调度和运行周期性任务。适用于设置 cron 作业、定时备份、周期性数据同步、自动报告等场景。
★ 0 📥 407

Datetime Tool

dinghaibin
全面的日期时间操作工具包,支持多种格式、时区转换、日历计算、自然语言解析以及日期...
★ 0 📥 413