Shell Data Processing - cut command

Card Puncher Data Processing


cut is a filter command that remove text sections from each line


Suppress only the first part of a line

Take the rest of the line after the first :

cut --delimiter ':' --fields=2-


  • –delimiter specify the delimiter
  • –fields defined the field to chose (ie the columns) and its value 2- means all value from 2

Suppress the first character

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


  • --characters means that we are manipulating characters
  • 2- means character 2 to the end

Discover More
Card Puncher Data Processing
Shell Data Processing - Filter (Stream Operator)

This page is pipeline operator in a shell language. They are known as filter in a shell language. It is a computer program or shell command (subroutine) that: read from standard input (stream)...

Share this page:
Follow us:
Task Runner