Run range

World's simplest linux tool

This online utility implements a brand new Linux command called range. This command combines the head and tail commands and outputs a range of characters, words, or lines from the given data. The range indexes can be both positive or negative numbers (if they are negative, the range is extracted from the end of data). 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.
Lines, Words, and Symbols
Line start.
Line end.
Word start.
Word end.
Symbol start.
Symbol end.
Line Range Options
Include blank lines when printing a range of lines.
Run range tool What is a run range?
This browser-based JavaScript program implements a new Linux command called range. A common operation in Linux is to extract a range of data from a file. We solved this problem quickly and efficiently by creating range. You can simply specify the start and end positions of the range and extract the text piece that falls in this range. The new command has three modes for finding and printing ranges. The line-range matches (and prints) all lines from the starting line position to ending line position. The word-range matches (and prints) all words between the starting word position and ending word position. The character-range matches (and prints) all symbols from the starting character index to ending character index. The range indexes can be either positive or negative integers. Positive indexes count lines/words/characters from the beginning of text and negative positions count lines/words/characters from the end of text. For example, the range 5 to 10 will match either lines 5 to 10 (inclusive), or 5th word to 10th word, or 5th char to 10th char. The range 5 to -10 will match from the 5th line to the 10th line from the end (same for words and chars). The range -15 to -5 will match lines from the 15th line from the end to the 5th line from the end. If the start position field is left blank, then it's set to 1 and the extraction will start at the first symbol at the beginning of text. If the end field is left blank, then the extraction will continue to the last symbol of the end of text. For extra convenience, we've also added an option that can skip blank lines in the line range mode. Tuxabulous!
Run range examples Click to use
Print a Range of Lines
In this example, we're using our browser version of the Linux range command to extract certain titles from a list of the all time greatest books. To do this, we select the line printing option and enter the range from 4 to 8. We also exclude blank lines from the output by unchecking the "Output Empty Lines" option.
In Search of Lost Time Don Quixote Moby Dick War and Peace Hamlet The Odyssey Crime and Punishment The Divine Comedy Pride and Prejudice The Iliad To Kill a Mockingbird Great Expectations Jane Eyre
War and Peace Hamlet The Odyssey Crime and Punishment The Divine Comedy
Required options
These options will be used automatically if you select this example.
Line start.
Line end.
Include blank lines when printing a range of lines.
Get a Range of Characters
In this example, we slice a part of Leo Tolstoy's quote and extract a range of characters from it. We set the start of the range to a positive value of 7 and the end of the range to a negative value of -13. This way, the output text is a passage that starts at the beginning at the 7th character position and goes to the 13th position from the end (this is what the minus sign in -13 means – count 13 positions from the end).
Great things are always simple and modest. Leo Tolstoy
things are always simple and modest.
Required options
These options will be used automatically if you select this example.
Symbol start.
Symbol end.
Match Till End
In this example, we switch on the word range mode and print the last nine words from an interesting fact about people. In the start position field, we enter the value -9, which anchors the starting position to the ninth word from the end, and we leave the end position empty, which means match all words till the end.
The average person consumes over a ton of food and drinks every year.
over a ton of food and drinks every year.
Required options
These options will be used automatically if you select this example.
Word start.
Word end.
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!
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.