Bash head: Difference between revisions
Jump to navigation
Jump to search
Line 15: | Line 15: | ||
==Extract a Specific Line from a File== | ==Extract a Specific Line from a File== | ||
{{Internal|Bash_Input/Output#With_head_and_tail|Extract a Specific Line from a File}} | {{Internal|Bash_Input/Output#With_head_and_tail|Extract a Specific Line from a File}} | ||
==Print the First 24 Characters of the First Line of the File== | |||
<syntaxhighlight lang='bash'> | |||
head -c 24 somefile | |||
</syntaxhighlight> |
Latest revision as of 20:24, 18 February 2022
Internal
Overview
head
is used to print the first ten lines (by default) or a specified number of lines.
head -15 <file>
Usage
Extract a Specific Line from a File
Print the First 24 Characters of the First Line of the File
head -c 24 somefile