to list a particular line in the file
Answers were Sorted based on User's Feedback
Answer / jam
To print a specific line without using a string.
sed -n '1p' <filename>
Where 1 is teh line number
| Is This Answer Correct ? | 5 Yes | 0 No |
Answer / deepak
grep -i " give_the search keyword here" (specify the directory location/file to search)
| Is This Answer Correct ? | 3 Yes | 2 No |
sed -n '1p' <filename>
head -n filename | tail -1
(change n as per your requirements)
| Is This Answer Correct ? | 0 Yes | 0 No |
Answer / ranjitha
using head and tail command we can print the required line
as an output.
| Is This Answer Correct ? | 2 Yes | 7 No |
How to replace the exact word in vi editor?? suppose a file contains words like amaze,amazed,amazement in some of the line.But i want to replace only 'amaze' with delight but don't wanna replace amazed or amazement. thanks
6 Answers Polaris, Tech Mahindra,
What is the nmap command?
what is the command to find out which shell you are running?
how to make IGNITE-BACKUP in HP-UX?
distinguish between multi-tasking,multi-user,multi- processing and time sharing?
4 Answers Infosys, Nikhil Construction,
Which command will print your home directory on screen?
boot process?
Briefly, how do you install Oracle software on UNIX.
When the shell is reading the command line what is the difference between text enclosed between double quotes ( ” ) and text enclosed between signal quotes ( ’ )?
how will you convert a general file to a hidden file?
what is the functionality of kernel in unix architecture?
How to use grep command to list find the records of a file containing 10 different strings?