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 |
What is the use of pipes?
How do you find files in Unix?
What is the basic difference between unix and windows operating systems?
43 Answers Bopro, College School Exams Tests, CTS, IBM, IT-Kids, Priyadarshini, Sybian Technologies, Tolani Maritime,
What is clustering in HP and how it's work?
Can you write a command to erase all files in the current directory including all its sub-directories?
What does touch command do in unix?
In UNIX, what is the command to kill a process?
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 to create hardlinks and softlinks on files?
Can a process kill itself in UNIX/or in its various versions?
How do you change your account's password?
How do I use grep to find a file?