← 返回命令列表

Linux command

pretty-bytes 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Convert bytes to human readable

pretty-bytes [1024]

Convert from stdin

echo [1048576] | pretty-bytes

Convert large values

pretty-bytes [1099511627776]

说明

pretty-bytes converts raw byte values into human-readable strings with appropriate unit suffixes (kB, MB, GB, TB, etc.). It automatically selects the best unit for readability, making large numbers easier to understand at a glance. This Node.js CLI utility is useful in scripts and pipelines where file sizes or data amounts need to be displayed in a user-friendly format rather than as raw numbers.

FAQ

What is the pretty-bytes command used for?

pretty-bytes converts raw byte values into human-readable strings with appropriate unit suffixes (kB, MB, GB, TB, etc.). It automatically selects the best unit for readability, making large numbers easier to understand at a glance. This Node.js CLI utility is useful in scripts and pipelines where file sizes or data amounts need to be displayed in a user-friendly format rather than as raw numbers.

How do I run a basic pretty-bytes example?

Run `pretty-bytes [1024]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

Where can I find more pretty-bytes examples?

This page includes 3 examples for pretty-bytes, plus related commands for nearby Linux tasks.