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 pass an argument to a script?

594


How to write a function?

594


I have 2 files and I want to print the records which are common to both.

698


What does it mean to debug a script?

573


What are "c" and "b" permission fields of a file?

564






what is info area how many types?

2289


What are script files?

551


How important is shell scripting?

544


How will you pass and access arguments to a script in linux?

586


What does path stand for?

640


Explain about stdin, stdout and stderr?

635


Why do we use shell scripting?

552


Explain how you Automate your application using Shell scripting.

1849


How to get the 3rd element/column from each line from a file?

694


What is bash command used for?

581