Text Processing

CommandDescription
cat fileDisplay file with line numbers
head [-n N] fileShow first N lines (default 10)
tail [-n N] fileShow last N lines (default 10)
grep [flags] pattern [files]Search files for pattern
sort [-r/-n/-u] fileSort lines
uniq [-c/-d] fileRemove consecutive duplicate lines
wc [-l/-w/-c] fileCount lines, words, or characters
diff file1 file2Compare two files
tr [-d] s1 s2 fileTranslate or delete characters
cut -d/-f/-c fileExtract fields or characters
rev fileReverse characters in each line
tac filePrint file with lines in reverse order
paste [-d] file fileMerge lines from multiple files
view fileView file in pager with markdown rendering
more/lessPaginated output viewer

view

Open a file in the interactive pager. Markdown files (.md, .markdown) are rendered with ANSI formatting — headers, bold, italic, inline code, code blocks, tables, lists, blockquotes, links, and horizontal rules all render with colors and box-drawing characters.

Non-markdown files are displayed as plain text.

Shell
> view README.md
┌──────────┬────────┬───────┐
│ Name     │ Type   │ Size  │
├──────────┼────────┼───────┤
│ Parser   │ Core   │ 2.4K  │
│ Lexer    │ Core   │ 1.8K  │
└──────────┴────────┴───────┘

Navigation is the same as more/less — arrow keys, j/k, Page Up/Down, / to search, q to quit. The pager uses the alternate screen buffer so your scrollback history is preserved.

Supported Markdown

ElementSyntax
Headers#, ##, ### — bold with distinct colors
Bold**text**
Italic*text*
Inline code`code`
Code blocksFenced with ```
TablesPipe-delimited with box-drawing borders
Bullet lists- item rendered with
Numbered lists1. item
Blockquotes> text with bar
Links[text](url) — text underlined, URL dimmed
Horizontal rules--- rendered as line

grep

Search for patterns in files with highlighted matches. Supports recursive search, case-insensitive matching, line numbers, and match counting.

Shell
> grep -rn "TODO" src/
src/Parser.cs:42:    // TODO: Handle forward references
src/Interpreter.cs:156:    // TODO: Optimize stack layout

> grep -ic "error" logs/
logs/app.log:15
logs/server.log:3

Flags: -i case insensitive, -n line numbers, -r recursive, -c count only.

sort

Shell
> sort -r names.txt
Zara
Mike
Alice