Text Processing
| Command | Description |
|---|---|
cat file | Display file with line numbers |
head [-n N] file | Show first N lines (default 10) |
tail [-n N] file | Show last N lines (default 10) |
grep [flags] pattern [files] | Search files for pattern |
sort [-r/-n/-u] file | Sort lines |
uniq [-c/-d] file | Remove consecutive duplicate lines |
wc [-l/-w/-c] file | Count lines, words, or characters |
diff file1 file2 | Compare two files |
tr [-d] s1 s2 file | Translate or delete characters |
cut -d/-f/-c file | Extract fields or characters |
rev file | Reverse characters in each line |
tac file | Print file with lines in reverse order |
paste [-d] file file | Merge lines from multiple files |
view file | View file in pager with markdown rendering |
more/less | Paginated 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
| Element | Syntax |
|---|---|
| Headers | #, ##, ### — bold with distinct colors |
| Bold | **text** |
| Italic | *text* |
| Inline code | `code` |
| Code blocks | Fenced with ``` |
| Tables | Pipe-delimited with box-drawing borders |
| Bullet lists | - item rendered with • |
| Numbered lists | 1. 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:3Flags: -i case insensitive, -n line numbers, -r recursive, -c count only.
sort
Shell
> sort -r names.txt
Zara
Mike
Alice