adspace


How to print/display the first line of a file in Unix?

Answer Posted / Rishabh Kanthariya

To display the first line of a file in Unix, you can use the `head` command with an argument specifying the number of lines. In this case, since we want only the first line, we use `head -n 1`. Here's an example: `head -n 1 filename.txt`

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How can you edit a large file without opening it in unix?

988