In a file , how to retrieve the lines which are the
multiples of 50 ? like 50,100,150th lines etc.
Answer Posted / shivu
root@chandru-VirtualBox:~# egrep "^[0-9]*[0|5]0" file
50
100
150
200
250
300
350
400
450
500
501
502
503
504
505
506
507
508
509
550
600
650
700
750
800
850
900
950
1000
But the below one is
root@chandru-VirtualBox:~# egrep "^[0-9][0|5][0]" file
100
150
200
250
300
350
400
450
500
550
600
650
700
750
800
850
900
950
1000
This is also not correct. up to some extend it is ok.
Is This Answer Correct ? | 1 Yes | 4 No |
Post New Answer View All Answers
What lives in a shell?
Where are cowrie shells found?
What exactly is a shell?
how to get part of string variable with echo command only?
What are the different communication commands available in the shell?
What is shell variable?
What language is bash written in?
What is meant by dos operating system?
What does egrep mean?
Explain about debugging?
What are the four fundamental components of every file system on linux?
How will you emulate wc –l using awk?
What is a beat in a script?
What is path in shell script?
Can we run shell script in windows?