What is use of "cut" command?

Answers were Sorted based on User's Feedback



What is use of "cut" command?..

Answer / 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

What is use of "cut" command?..

Answer / swaroopa

cut is used to get a specific data from a file. Supppose
you want to get a data in a file from column 10 to 20, you
can get it by using cut

eg: cat filename.txt | cut -c 10-20
eg: cut -c10-20 <filename.txt>

Is This Answer Correct ?    4 Yes 1 No

What is use of "cut" command?..

Answer / suresh

Cut is used for column wise search of strings orto display
it.

Is This Answer Correct ?    3 Yes 1 No

Post New Answer

More Shell Script Interview Questions

How to take input values from the user?

4 Answers  


What exactly is a shell?

0 Answers  


if i have 2 files file1 and file2.... file1 contains 2 columns like b a 11 aa 12 as 13 ad 15 ag 11 ar 13 ah 15 ak file2 contains b c 10 ds 11 at 15 gh 15 jk 13 iu 11 fg 13 yy can any 1 give me the program to display in this way? a b c aa 11 at ar 11 fg ad 13 iu ah 13 yy ag 15 gh ak 15 jk

3 Answers  


Given a file find the count of lines containing the word "abc".

0 Answers  


How do we delete all blank lines in a file?

0 Answers  






What are the three main forms of enabling debugging in a shell script?

6 Answers   ADC, Wipro,


How do I read a .sh file?

0 Answers  


What lives in a shell?

0 Answers  


write a shell script to generate a alert ? like when ur birthday came then generate a alert ur birthday is today like that ?

0 Answers   Wells Fargo,


What language is used in terminal?

0 Answers  


Explain about debugging?

0 Answers  


what are command line arguments? what is the need of those?

1 Answers   Flipkart,


Categories