What is use of "cut" command?

Answer Posted / seshadri sethi

Cut - Utility used to cut/Strip out the required data/text
from the source.

Cut can be used in three modes,

Stripping by Character

cut -c 1-3

Striping by Byte length

cut -b -1-72

Stripping by delimiter and fields.

cut -d “|” -f1

Where

-d “|” -> Delimiter used in input text to separate columns

-f1 -> Field/Column number

While processing huge input files, Cut’s performance is far
better than awk

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to calculate the number of passed arguments?

553


What is the syntax of "nested if statement" in shell scripting?

629


What is $1 in shell scripting?

589


How to redirect both standard output and standard error to the same location?

630


How will you copy a file from one machine to other?

544






How do I open the shell in cmd?

524


What is bash eval?

547


What is a shell made of?

556


How do we create command aliases in a shell?

540


What is web script?

580


Explain about non-login shell files?

692


I want to connect to a remote server and execute some commands, how can I achieve this?

573


How do I start a shell script?

574


What are the various stages of a linux process it passes through?

624


How does path variable work?

544