᠎᠎᠎          
51K

Run head

World's simplest linux tool

This online utility implements a simplified and improved version of the Linux head command, which displays the first part of the given data. You can print the specified number of lines, words, or characters to the screen. Also, you can easily skip all empty lines in the print-lines mode. Created by Linux experts from team Browserling.
We put a browser in your browser! Browserling
Check out our project Browserling – get a browser in your browser and browse while you browse.
Head Mode
Displays the first N lines.
Displays the first N words.
Displays the first N characters.
Empty Lines
Include blank lines in the output.
Works only when "Print Lines" mode is active.
Run head tool What is a run head?
This browser-based JavaScript program implements the Linux head command and also somewhat improves it. The original head command can output the first N lines or the first N bytes but our browser version can also output the first N words. Also, instead of printing the first N bytes, it prints the first N characters because the browsers don't like raw bytes and UTF8 encoding issues get in the way as well. When printing lines, another extra feature is skipping empty lines. The original head command can't skip empty lines (to skip empty lines you need to combine it with the grep command) but we implemented an option to directly skip empty lines. We made it so that an empty line is a line that contains no symbols or contains only whitespace characters (spaces and tabs). A little known feature of the head program is using a negative line count. If the count is -N, then the program prints all but the last N lines. We also implemented a negative count for words and characters. For example, if you want to print all the words in the input except the last 5, you can choose the word-mode and enter -5 in the word count option. Tuxabulous!
Run head examples Click to use
Print First 30 Characters
In this example, we use our implementation of the Linux head command to output the starting part of textual data. We select the "Print Characters" mode and enter the number 30 in the character counter field. In the output, we get the first 30 characters that appear in the input string.
The speed of a computer mouse is measured in "Mickeys."
The speed of a computer mouse
Required options
These options will be used automatically if you select this example.
Displays the first N characters.
Include blank lines in the output.
Negative Head Argument
In this example, we use the new feature that we added to this program that finds and prints the specified number of words. We set the word count to a negative value of -8, which means that the tool prints all but the last eight words.
The lyrebird can mimic almost any sounds it hears — including chainsaws, sirens, and cell phone ringtones.
The lyrebird can mimic almost any sounds it hears
Required options
These options will be used automatically if you select this example.
Displays the first N words.
Include blank lines in the output.
Head Lines
This example loads a file with a list of comedy movies and calls the head command to print the first 10 file lines to the screen. To demonstrate all the improvements of our version of head, we turn off the "Print Empty Lines" option. Thus, we effectively execute two Linux commands at once, namely the grep command to skip empty lines and the head command to print the first 10 lines of the remaining non-empty lines.
The Hangover The Grand Budapest Hotel Some Like It Hot Step Brothers Trading Places Bridesmaids Coming to America As Good as It Gets Old School School of Rock The Mask Booksmart Pulp Fiction Mean Girls
The Hangover The Grand Budapest Hotel Some Like It Hot Step Brothers Trading Places Bridesmaids Coming to America As Good as It Gets Old School School of Rock
Required options
These options will be used automatically if you select this example.
Displays the first N lines.
Include blank lines in the output.
Pro tips Master online linux tools
You can pass input to this tool via ?input query argument and it will automatically compute output. Here's how to type it in your browser's address bar. Click to try!
https://onlinelinuxtools.com/head?input=The%20speed%20of%20a%20computer%20mouse%20is%20measured%20in%20%22Mickeys.%22&print-chars=true&char-count=30&print-empty-lines=true
All linux tools
Didn't find the tool you were looking for? Let us know what tool we are missing and we'll build it!
Quickly escape special shell characters in a string.
Quickly output the first part of the input text or data.
Quickly output the last part of the input text or data.
Quickly combine head and tail commands and extract a range.
Quickly print a sequence of numbers to standard output.
Quickly reverse the given lines characterwise.
Coming soon These linux tools are on the way
Run Awk
Run Awk-like commands on the input text.
Run Sed
Run Sed-like commands on the input text.
Printf Data
Run printf-like command on input text or data.
Run Base64
Base64 encode/decode on text and data.
Run Cksum
Print CRC checksum and byte counts.
Run Csplit
Split a file into context-determined pieces.
Run Cut
Remove parts of lines of files.
Run Expand
Convert tabs to spaces.
Run Expr
Evaluate expressions.
Run Factor
Print prime factors of n.
Run Fmt
Run simple text formatter.
Run Numfmt
Convert numbers to and from human-readable strings.
Run Par
Run paragaph reformatter (similar to fmt but better).
Run Strftime
Format time and date according to the given format string.
Run Fold
Wrap each input line to fit in specified width.
Run Join
Join lines of two files on a common field.
Run Md5sum
Compute checksums of files or strings.
Run Nl
Add line numbers to text lines in files.
Run Paste
Merge lines of files.
Run Sha1sum
Print or check SHA-1 digests.
Run Shuf
Shuffle lines of text.
Run Sort
Sort lines of text (with all kinds of options).
Run Split
Split a file into pieces.
Run Tac
Concatenate and print files in reverse.
Run Tr
Translate or delete characters in files.
Run Truncate
Truncate or extend the length of files.
Run Unexpand
Convert spaces to tabs.
Run Uniq
Remove duplicate lines from a sorted file.
Run Wc
Print the number of lines, words, and bytes in files.
Run Cal
Displays a calendar.
Run Colrm
Remove columns from a file.
Run Columns
Convert lists into nice columns.
Run Hexdump
Print ascii, decimal, hexadecimal, octal dump of input data.
Run Uuidgen
Create and print a new universally unique identifier (UUID).
Unescape Shell Characters
Given an escaped shell string, unescape it.
Quote a Shell String
Single or double quote a shell string.
Unquote a Shell String
Remove quotes from a quoted shell string.
Run Yes
Repeatedly output lines with all specified strings or "y".
Run Cowsay
Generate an ASCII picture of the speaking cow.
Run Figlet
Generate ASCII art text in a variety of typefaces.
Run Banner
Print a large, high quality banner using ASCII characters.
Run img2sixel
Convert an image to the DEC Sixel format.
Run sixel2img
Convert DEC Sixel data to an image.
Long to IP
Convert a long integer IP to a dotted string IP address.
IP to Long
Convert a standard IP address to a long numeric IP.
Fuzzy Match
Run the fuzzy matching algorithm on the input data.
Glob Match
Run the glob matching algorithm on the input data.
Unixify File Names
Convert filenames to Unix-friendly filenames.
Print Unix Time
Print time in seconds since 1970-01-01.
Convert UTC to Unix
Convert UTC time to Unix time.
Convert Unix to UTC
Convert Unix time to UTC time.