We have launched a free Basic Kubernetes Course. Click here to enrol now! Kubernetes is a container orchestration platform used by enterprises worldwide and Kubernetes developers are in high demand!
The cut command is extremely powerful. In this example we look at using the cut command to parse a comma separated file and retrieve columns 1 to 4
cut -d "," -f -4
-d specifies the delimiter
-f specifies which columns to select. In this case we select all columns upto 4
The unix pipe command can be used to further work wonders. For example if you want to create unique values from the first column of a comma separated file then all you have to do is
cut -d "," -f 1