Movatterモバイル変換


[0]ホーム

URL:


hydroculのメモ >コマンドの使い方(Linux) >nl コマンド

nl コマンド2017/01/30

行番号を先頭に表示してくれるコマンド。

空行には行番号が付与されず、カウントもされない。

$ cat foo.txtabcdefABCabc$ nl foo.txt     1  abc     2  def     3  ABC     4  abc$ nl -b afoo.txt     1  abc     2  def     3  ABC     4     5  abc$ nl -n rz foo.txt000001  abc000002  def000003  ABC000004  abc$ nl -v 0 foo.txt     0  abc     1  def     2  ABC     3  abc

cat -n,cat -b,less -Nでも同じようなことができる。

インストール2016/03/17

Coreutilsというパッケージに入っているので、CentOSにもUbuntuにも始めから入っている。

このサイトは筆者(hydrocul)の個人メモの集合です。すべてのページは永遠に未完成です。
スポンサーリンク

[8]ページ先頭

©2009-2025 Movatter.jp