Print a file with line numbers #file #nl

If you want a file with line numbers (say for printing), you can use the 'nl' command in Linux:

$ nl file.c

This prints the file with line numbers to standard output or this can be even redirected to a

file as shown below:

$nl file.c > output.txt

Here, output.txt will have the codes of file.c with each line having a line number.

0 comments:

Post a Comment

Note: Only a member of this blog may post a comment.