cut Command Generator
Generate cut commands to remove sections from each line
Getting Started with cut
## What is cut?
`cut` prints selected sections from each line of a file. You can select by field (with a delimiter), by character position, or by byte position.
## How to Use
1. **Choose a selection mode**: `-f` fields, `-c` characters, or `-b` bytes. 2. **Set Delimiter** (for fields): `-d` defaults to TAB. 3. **Specify File**: Enter the input file. 4. **Copy & Run**: Copy the generated command into your terminal.
Selection Syntax
### `-f LIST` Fields A comma-separated list of field numbers or ranges, e.g. `1,3`, `1-3`, `2-` (field 2 to end), or `-3` (up to field 3). Requires `-d` if your delimiter is not TAB.
### `-c LIST` Characters Select character positions, e.g. `-c 1-10` for the first 10 characters per line.
### `-b LIST` Bytes Like `-c` but counts bytes (differs from characters for multibyte encodings).
### `-d DELIM` Field delimiter Use `DELIM` as the field separator (default TAB). Only one character.
### `-s` Only delimited Suppress lines that do not contain the delimiter.
### Examples - `cut -d , -f 1,3 data.csv` — extract CSV columns 1 and 3 - `cut -c 1-80 file.txt` — truncate each line to 80 characters
▶What's the difference between -c and -f?
▶Why are my CSV columns wrong?
If this tool has been helpful to you, consider buying me a coffee.
Buy me a coffee