UNIX Publication - Debian: http://unix.pub/docs/debian/ - APT用法: http://unix.pub/docs/debian/apt_usage/ - dpkg用法: http://unix.pub/docs/debian/dpkg_usage/ - Debian发行版: http://unix.pub/docs/debian/DebianReleases/ - Debian基本命令备忘录: http://unix.pub/docs/debian/Debian-Basic-Command-Memo/ - Debian软件包: http://unix.pub/docs/debian/debian_packages/ - Distribution: http://unix.pub/docs/distributions/ - Waydog Linux: http://unix.pub/docs/distributions/Waydog/ - Lilidog Linux: http://unix.pub/docs/distributions/Lilidog/ - GNU核心工具: http://unix.pub/docs/coreutils/ - base32命令用法: http://unix.pub/docs/coreutils/base32_usage/ - base64命令用法: http://unix.pub/docs/coreutils/base64_usage/ - basenc命令用法: http://unix.pub/docs/coreutils/basenc_usage/ - cat命令用法: http://unix.pub/docs/coreutils/cat_usage/ - fmt命令用法: http://unix.pub/docs/coreutils/fmt_usage/ - fold命令用法: http://unix.pub/docs/coreutils/fold_usage/ - head命令用法: http://unix.pub/docs/coreutils/head_usage/ - nl命令用法: http://unix.pub/docs/coreutils/nl_usage/ - od命令用法: http://unix.pub/docs/coreutils/od_usage/ - pr命令用法: http://unix.pub/docs/coreutils/pr_usage/ - tac命令用法: http://unix.pub/docs/coreutils/tac_usage/ - Linux文档: http://unix.pub/docs/LinuxDoc/ - DAE用法: http://unix.pub/docs/LinuxDoc/dae_usage/ - Linux透明代理: http://unix.pub/docs/LinuxDoc/Linux_Transparent_proxy/ - OpenWrt: http://unix.pub/docs/openwrt/ - RaspberryPi: http://unix.pub/docs/raspberrypi/ - WDMyCloud vs Debian: http://unix.pub/docs/WDMyCloud/ - WD MyCloud Home安装运行Debian 11: http://unix.pub/docs/WDMyCloud/Running-Debian-11-on-WD-MyCloud-Home/ - WD MyCloud安装Debian Jessie: http://unix.pub/docs/WDMyCloud/Install-Debian-Jessie-on-WD-MyCloud-Gen1/ - WDMycloud救砖: http://unix.pub/docs/WDMyCloud/WDMycloud_Recovery/ - WDMycloud安装Debian: http://unix.pub/docs/WDMyCloud/WDMycloud_Crack_install_debian/ # fmt命令用法 `fmt`负责填充并连接文本行,生成长度不超过指定字符数(默认为 75)的输出行。 ```sh $ cat push.sh #!/bin/bash TIMESTAMP=$(date +%s) rm -rf resources/ public/ .hugo_build.lock git add . git commit -m "update: ${TIMESTAMP}" git push sleep 3s echo "Done! Commit${TIMESTAMP}" sleep 3s $ fmt push.sh rm -rf resources/ public/ git commit -m "update: ${TIMESTAMP}" sleep 3sne! Commit${TIMESTAMP}" ``` `fmt`常用选项如下: `-c` `--crown-margin` 悬挂缩进(crown margin)模式:保留段落中前两行的缩进,并将后续每一行的左边界与第二行的左边界对齐。 `-t` `--tagged-paragraph` 标记段落(tagged paragraph)模式:类似于悬挂缩进模式,但如果段落第一行的缩进与第二行相同,则将第一行视为单行段落。 `-s` `--split-only` 仅拆分行。不合并短行以形成长行。这可以防止代码示例及其他此类“已格式化”文本被不适当地合并。 `-u` `--uniform-spacing` 统一间距。将单词间的间距缩减为一个空格,句子间的间距缩减为两个空格。 `-width` `-w width` `--width=width` 将输出行填充至 width 个字符的宽度(默认值为 75,或者若提供了 goal 参数,则为 goal 加上 10)。 `-g goal` `--goal=goal` fmt 最初尝试使行宽达到 goal 个字符。默认情况下,该值比 width 小 7%。 `-p prefix` `--prefix=prefix` 仅对以 prefix 开头的行(其前可带有空白字符)进行格式化。在格式化过程中,会移除前缀及前面的空白字符,随后将其重新附加到每个格式化后的输出行上。此选项的一种用途是格式化特定类型的程序注释,同时保持代码不变。