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 command will work as well…
sed -n ’96p’ filename.txt
Sweet Binny! There are always multiple ways to do things in Linux and it’s fantastic to be able to have so much versatility at your fingertips 🙂 Thanks for the extra tip 😀
Thanks for your help. Exactly what I was looking for!
Jeff,
You bet! Glad it helped out 🙂
xargs -i -t -exec grep -i -w {} file_1 >>test < file_2
This was meant to search for the contents of file_2 in file_1 and write the respective lines into file"test" . But instead it writes
grep -i -w "string1" File_1
grep -i -w "string2" File_1
grep -i -w "string3" File_1
to the standard output and creates an empty file "test"
Any ideas why this doesn't work?
Your help is very much appreciated
Udo
Hi,
I am newly join in this site.This site is very useful to others.Anyone can join and post a profile for free but cannot respond to messages from members until they pay their membership fee. Paying users can view others' profiles and access communication services such as anonymous email, chat, webcam, a webzine, and blogging. Members can purchase higher membership levels for benefits such as higher search rankings. Members can broadcast their webcam publicly to each other. Chat room viewers can page the broadcasting member in an attempt to initiate a chat session.For more information please visit the link.
=======================
sharoo
Adult Dating
hooray! exactly what i needed. love it when that happens.
sed ’96!d’ filename.txt