Skip to content

Comment on Cool, but obscure Unix toolsparent

Comments

Yup, use awk for similar tasks:

  awk '{ print FNR "\t" $0 }' test.txt
  1	one
  2	two
  3	three
  4	
  5	five

Yeah, I usually use awk or perl for this (depends on my mood). Just find it annoying that the unix program whose stated purpose is to number lines is basically dead to me.

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.