Home
About
Top Tens
Blogs
Add Recipe
CATEGORIES
UNIX
FreeBSD
Linux
Solaris
UNIX shell
UNIX software
Green computing
Apple Mac
Computer programming
Database
Entertainment
Internet
Networking
Technology reviews
Windows
View a file with line numbers
Contributed by
qmchenry
September 4, 2003
Tagged:
UNIX
Using the cat command in UNIX, a file can be displayed with the line number of each line preceding the line
cat -n filename
Previous recipe
|
Next recipe
|
Anonymous
pr -n
will do the same thing, if one wants pretty-printed (line wrapped, with headers), say when dumping to a line printer.
blog comments powered by
Disqus
POPULAR RECIPES
Copy and paste text with vi or vim
Show line numbers in vi or vim
Create a symbolic link in UNIX
Remove ^M characters at end of lines in vi
Recursive grep
Create a TAR archive of a directory
Decompress and extract a tgz or tar.gz archive in a single step
Find a file by name in UNIX/Solaris/Linux
View our Top Tens
TECH-RECIPES BLOGS
post release: Windows 7, homegroups and me
fall 2009 and some geek thoughts, reflections
Facebook Cafe World Cheat: Close Your Cafe When You are Away for Long Periods of Time (to preserve your Buzz Rating)
Facebook Cafe World Cheat: Serve Your Customers Instantly
Facebook Cafe World Cheat: Send Multiple Free Gifts to Your Neighbors
Windows 7 Quickie: Setting up TV recording and sharing to other Windows 7 computers (turn windows 7 into a dvr / media server)
Mafia Wars Cheat: Send Multiple Gifts to Your Friends
Facebook Mafia Wars Cheat: How to Quickly Receive 5 Extra Godfather Points