ODOC: nl

Saturday, November 12, 2005

nl - Number lines of files

Summary :

Write each FILE to stdout, with line numbers added.
With No FILE or -, read stdin

Examples :
nl myfile -- Writes all non-empty lines with number.

nl -ba myfile -- Number all lines.

nl -ba -l2 myfile -- Count 2 empty line as 1 and display

nl -nln myfile -- Numbers are left justified.

nl -nrz myfile -- Numbers are right justified and leading zeros

nl -w2 myfile -- Uses 2 column for the line number.

nl -s"> " myfile -- Insert "> " in between number and line.

ls | nl -- ls Output with line numbers
Read : man nl

Tech Tags:

comments links to this post Listen to this article Listen to this article


Post a Comment

Links to this post:

Create a Link

<< Home

Previous Posts

referer referrer referers referrers http_referer

  • Subscribe to Free Software Blog
  • Google
  • Subscribe in Yahoo
  • Subscribe
in Bloglines
  • Link to Podcast

(RSS feed) for this blog
    Computers Blog Top Sites
  • Computers Blogs by Indian Bloggers
  • BLogstreet Profile