Read & Display Single Line of a File
- By devnet
- 18 November, 2008
- 7 Comments
Sometimes when I’m troubleshooting a PHP error and a function is called in the debugger that gives me a line number of a file to look at, I want to know what that line says without opening up the file. Using the command line, you can accomplish this in the following way:
head -n 96 filename.php | tail -n 1
This allows you to quickly display the 96th line of filename.php. Hope this helps someone like it has me.
This content is published under the Attribution-Noncommercial-Share Alike 3.0 Unported license.
-
http://lindesk.com/ Binny V A
-
http://it.jessupblogs.com Jeff
-
Udo
-
sharoosunidhi
-
rlw
Copyright © 2013