-
Look at the first 3 lines of a file
Transfered from Linux Config:
Question:
What command could you use to look at the first 3 lines of a file named "grades.report" if you had such a file? What command would you use to see the last 2 lines?
Answer:
head command without any options will return first 10 lines of any given text file supplied as an argument. However, using -20 option will return first 20 lines. Therefore,
Code:
head -3 grades.report
returns first 3 lines and
Code:
tail -3 grades.report
returns last 3 lines of a file grades.report.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules