Head is another way toview text file in Linux. You can useheadcommand to print a specified number of lines from the beginning of the file. Here’s the syntax of the head command: head [option] [filename] 7 examples of head command Let’s learn how to use the head command in Linux ...
This Linux tutorial explains how to use the Linux head command with syntax and arguments.NAME head - output the first part of files SYNOPSIShead [OPTION]... [FILE]... DESCRIPTIONPrint the first 10 lines of each FILE to standard output. With more than one FILE, precede each with a ...
2. tail Command The tail command allows you to display last ten lines of any text file. Similar to the head command above, tail command also support options ‘n‘ number of lines and ‘n‘ number of characters. The basic syntax of tail command is: #tail [options] [filenames] For ex...
Use head with Other Commands Conclusion Share: The head command prints the first lines (10 lines by default) of one or more files or piped data to standard output. This article explains how to use the Linux head utility through practical examples and detailed explanations of the most common ...
Head command in Linux Head command will obviously on the contrary to tail, it will print the first 10 lines of the file. Till this part of the post, the head command will do pretty much the same as tail in all previous examples, with exception to the -f option, there is no -f opt...
Read on to learn how to use theheadcommand, its syntax, and options with easy-to-follow examples. head Command in Linux Syntax The syntax for using theheadcommand is: head [option] file_nameCopy You can run the command with or without additional options (arguments). ...
Linux head command If you wish to view the topmost of a large text file you can use the Linux head command. It is a handy command that will save you time and can automate your searching and reading and can make your life easier. In this article, we will cover the basic usage of ...
-v, --show-nonprinting use ^ and M- notation, except for LFD and TAB --help display this help and exit --version output version information and exit With no FILE, or when FILE is -, read standard input. Examples: cat f - g Output f's contents, then standard input, then g's co...
The purposes of different `head` command options have explained below. Examples of Head Command Different uses of the `head` command have shown in the following examples. Example – 1: Head Command Without Any Option Theproducts.txtfile has 9 lines with the heading. So, the following command...
How to get an IP address from the hostname and vice-versa in Linux (command) 10 examples of the XARGS command in Linux (examples) 10 examples of tar command in UNIX (examples) 10 examples of Vim in UNIX (examples) How to create, update and delete soft link in UNIX (command) ...