What is use of "cut" command?
Answers were Sorted based on User's Feedback
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 |
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 |
Answer / suresh
Cut is used for column wise search of strings orto display
it.
| Is This Answer Correct ? | 3 Yes | 1 No |
The information of the two files should be redirect to Third file in such a way that, the third file contain the information like this. 1st line in third file should be from 1st file 2nd line in Third file should be from 2nd file 3rd line in Third file should be from 1st file 4th line in Third file should be from 2nd file - - so on
What is the syntax of while loop in shell scripting?
What is the best shell scripting language?
Which scripting language is best for automation?
What does .sh file contain?
How u convert string "hi pravin how are you?" to "Hi Pravin How Are You?"
What is shell scripting used for?
What does it mean by #!/Bin/sh or #!/Bin/bash at the beginning of every script?
How can you find out how long the system has been running?
What is the difference between a variable and value?
How can you get the value of pi till a 100 decimal places?
How to redirect both standard output and standard error to the same location?