To display the first lines of a file, you can use the head command in Unix-like operating systems. Here’s how to do it:
Syntax:
head -n <number> <filename>
Example:
If you want to display the first 5 lines of a file named example.txt, you would run:
head -n 5 example.txt
Additional Notes:
- By default,
headdisplays the first 10 lines of a file if you do not specify the-noption. - You can replace
<number>with any positive integer to specify how many lines you want to see from the beginning of the file.
If you have any more questions or need further clarification, feel free to ask!
