User Guide

Online Linux Text Tools — grep, awk, sed and Pipelines

Filter pasted logs with grep, extract columns with awk, replace text with sed, and count duplicates with sort and uniq pipelines using supported options.

How to use

  1. Copy the log or text into Source text. This input accepts multiple lines.
  2. Enter a command in the single-line Command input. Use grep 'ERROR' alone or connect commands: grep 'ERROR' | sort | uniq -c.
  3. Click Run or press Ctrl+Enter (⌘+Enter on Mac) in the command input. Editing does not run automatically. Use Stop to interrupt execution.
  4. Read the result, expand it for a larger view, or copy the full output. The source input remains unchanged.
  5. After changing the source or command, run again. The previous result cannot be copied or expanded until rerun. Each reset icon clears its own input and focuses it.

Input and output example

Count duplicate error log lines

Example input

Source text:
ERROR host api
INFO host web
ERROR host api
ERROR host worker

Command:
grep 'ERROR' | sort | uniq -c

Example result

      2 ERROR host api
      1 ERROR host worker

Background knowledge

Standard input, output and pipes
Standard input supplies data to a command; standard output is its result. A pipe (|) passes one command’s output to the next. Order matters: grep filters the lines that awk receives.
grep: find lines
grep selects matching lines. Patterns are regular expressions by default; -F matches literal text and -E enables extended patterns. In grep -E 'ERROR|WARN', the quoted | means “or”, not a pipeline.
awk: fields, conditions and totals
awk splits each line into fields, selects records and computes totals. Whitespace is the default separator. $1 is the first field, $3 the third, and $0 the entire line. -F changes the separator; END prints final totals.
sed: replace or remove lines
s/find/replace/g replaces all matches on a line; /pattern/d removes matching lines from the output. sed '/DEBUG/d' excludes DEBUG lines.
sort and uniq: order and count duplicates
sort -n uses numeric order; -r reverses it. uniq groups adjacent identical lines, so sort first to count duplicates throughout the input. uniq -c adds counts; sort -nr sorts those counts from largest to smallest.
cut and tr: extract and transform
cut selects positions or separated fields, for example cut -d ',' -f 1. tr transforms or removes characters; tr a-z A-Z converts ASCII letters to uppercase.
head, tail and wc: inspect and count
head -n 3 shows the first three lines and tail -n 3 the last three. wc -l counts newlines, -w words, and -c bytes. Without a final newline, wc -l can be smaller than the visible line count.
Quotes and regular expressions
Quote patterns or programs containing spaces or pipes. Use single quotes for awk: awk '{print $1, $3}'. A pipe inside quotes does not split commands. Regex characters such as . and * have special meanings.

Notes

Frequently asked questions

What can I use this online tool for?

Filter pasted logs with grep, extract columns with awk, replace text with sed, and count duplicates with sort and uniq pipelines using supported options.

Can I paste a terminal command unchanged?

Only supported commands and options work. Replace grep ERROR app.log with grep ERROR and paste the file contents into Source text. This is not a full shell or a complete GNU/Linux environment.

Does sed modify my source?

No. Deletion and replacement affect the output only. Neither your input nor PC/server files are modified, and no new file is written. Copy the result to use it elsewhere.

Why did the result not change after editing?

Execution is manual. Run again with the button or Ctrl+Enter. The old result stays visible, but copy and expand remain disabled until rerun.

What if there are no matches or execution takes too long?

No grep matches produces an empty result. Stop a long task or wait for the 10-second limit. Narrow the filter or reduce the data and run again.

Why does uniq -c list the same value more than once?

uniq only groups adjacent equal lines. Use sort | uniq -c to count all duplicates, then sort -nr to put the largest counts first.

Baro Work is a collection of tools with no login. Inputs and results are not stored on the site server or in browser storage. See the translation and DNS guides for external transfers.

Use all tools on the home page →