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/ # nl命令用法 `nl`命令将文件输出时附带显示所有行号或部分行号,默认使用效果等同于`cat -n` ```sh $ nl push.sh 1 rm -rf resources/ public/ .hugo_build.lock 2 git add . 3 git commit -m "update" 4 git push 5 sleep 3s 6 echo "Done!" 7 sleep 3s ``` `-n format`选项用来设置编号样式,有以下三种 - rn 右对齐,nl默认 - ln 左对齐 - rz 右对齐,0填充 ```sh $ nl -n ln push.sh 1 rm -rf resources/ public/ .hugo_build.lock 2 3 4 git add . 5 git commit -m "update" 6 git push 7 sleep 3s 8 echo "Done!" 9 sleep 3s $ nl -n rn push.sh 1 rm -rf resources/ public/ .hugo_build.lock 2 3 4 git add . 5 git commit -m "update" 6 git push 7 sleep 3s 8 echo "Done!" 9 sleep 3s $ nl -n rz push.sh 000001 rm -rf resources/ public/ .hugo_build.lock 000002 000003 000004 git add . 000005 git commit -m "update" 000006 git push 000007 sleep 3s 000008 echo "Done!" 000009 sleep 3s ``` `-s string`选项用来设置编号和文本内容之间的分隔符,默认为TAB ```sh $ nl -s :: push.sh 1::rm -rf resources/ public/ .hugo_build.lock 2:: 3:: 4::git add . 5::git commit -m "update" 6::git push 7::sleep 3s 8::echo "Done!" 9::sleep 3s ``` `-v number`选项用来设置编号起始号,默认为1,也可以设置为负数 ```sh $ nl -v 5 push.sh 5 rm -rf resources/ public/ .hugo_build.lock 6 7 8 git add . 9 git commit -m "update" 10 git push 11 sleep 3s 12 echo "Done!" 13 sleep 3s $ nl -v -5 push.sh -5 rm -rf resources/ public/ .hugo_build.lock -4 -3 -2 git add . -1 git commit -m "update" 0 git push 1 sleep 3s 2 echo "Done!" 3 sleep 3s ``` `-w number`选项来设置编码位数宽度,默认为6 ```sh $ nl -w 2 push.sh -n rz 01 rm -rf resources/ public/ .hugo_build.lock 02 03 04 git add . 05 git commit -m "update" 06 git push 07 sleep 3s 08 echo "Done!" 09 sleep 3s $ nl -w 8 push.sh -n rz 00000001 rm -rf resources/ public/ .hugo_build.lock 00000002 00000003 00000004 git add . 00000005 git commit -m "update" 00000006 git push 00000007 sleep 3s 00000008 echo "Done!" 00000009 sleep 3s ```