Options Available in cut Command
Here is a list of the most commonly used options with the `cut`
command:
Option |
Description |
---|---|
-b, –bytes=LIST |
Selects only the bytes specified in |
-c, –characters=LIST |
Selects only the characters specified in |
-d, –delimiter=DELIM |
Uses |
-f, –fields=LIS |
Selects only the fields specified in |
-n |
Do not split multi-byte characters (no effect unless |
–complement |
Invert the selection of fields/characters. Print the fields/characters not selected. |
cut command in Linux with examples
The cut command in linux is a command for cutting out the sections from each line of files and writing the result to standard output. It can be used to cut parts of a line by byte position, character, and field. The cut command slices a line and extracts the text. It is necessary to specify an option with a command otherwise it gives an error. If more than one file name is provided then data from each file is not preceded by its file name.
Table of Content
- Syntax of cut Command
- Options Available in cut Command
- Practical Examples of cut Command
- Extract Specific Bytes (-b) Using cut Command
- Cut by Character (-c) Using cut Command
- Cut by Field (-f) Using cut Command
- Complement Output (–complement) Using cut Command
- Output Delimiter (–output-delimiter) Using cut Command
- Display Version (–version) Using cut Command
- How to use tail with pipes(|) in cut Command
- Frequently Asked Questions on cut Command in Linux – FAQs