Home
About
Top Tens
Blogs
Add Recipe
CATEGORIES
UNIX
FreeBSD
Linux
Solaris
UNIX shell
UNIX software
Apple Mac
Computer programming
Database
Entertainment
Green computing
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
its my first time: my google nexus one / android experience (part 1)
Nikon (Nikkor) 55-200mm lens repair
How to Download YouTube Videos onto your Nexus One Device
PS3 Slim Quickie: Harddrive Upgrade in less than 5 mins (video)
Facebook My Town Cheat: Send Multiple Free Gifts to Your Neighbors
gadget pr0n: my Google Nexus One and super cheap data...
PS3 and PSP remoteplay styled (video)
my wii and emulators in action (nes, snes, genesis, n64)