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 |
Which command is used to create a directory?
What is the significance of the 'tee' command?
Hi All, Can you please let me know how to grep for a particular pattern in unix. I want to print the dates from the file exp.txt. the date pattern is DD:MM:YYYY, I just want to print all the dates from the file exp.txt.
8 Answers Concentrix, IBM, Symantec, TCS,
What does sed command do in unix?
What are the unix commands?
How do I search for text in vi?
Is there any method to erase all files in the current directory, along with its all sub-directories, by using only one command?
Give the command to display space usage on the UNIX file system.
How to know a process is a zombie or orphan process?
What is unix command?
If JFS file system is 100% full how we can increase the file system ?
How do I run a bash script?