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 |
What are the 3 standard streams in linux?
What does egrep mean?
Why is it called a shell?
what is the difference between writing code in shell and editor?
Create a bash shell script to sort and then uniq the file from the command line & store it to a new file and output the results to the screen. Name this script "sortAndUniq.sh"
What is shift command in shell script?
There is a record with fields namely name,roll no.,salary,grade etc.Now,write a script to create a file with multiple records have same combination of fields but with unique roll numbers.The script should work for different names in the input file.
What is the best scripting language?
Please anyone suggest atleast 2 good training institutes in Hyderabad, INDIA where i can learn unix shell scripting.
Determine the output of the following command: name=shubham && echo ‘my name is $name’.
write a shell script to identify the given string is palindrome or not?
17 Answers CTS, HP, IBM, InfoEst, Wipro,
Given a file find the count of lines containing the word "abc".