Table of Contents

Shell Data Processing - cut command

About

cut is a filter command that

Example

Field management

Suppress the first field

Take all fields separated by space after the second one

echo "Hello World to foo" | cut --delimiter ' ' --fields=2-

where:

Output:

World to foo

Get the Nth field

echo "Hello World to foo" | cut --delimiter ' ' --fields=2

Output:

World

Suppress the first character

echo foo | cut --characters=2-
# short form
echo foo | cut -c2-
oo

where: