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 is shell variable?
How can I set the default rwx permission to all users on every file which is created in the current shell?
How do I run a shell script in powershell?
How can you get the value of pi till a 100 decimal places?
What is bourne shell scripting?
Calculate a real number calculation directly from the terminal and not any shell script.
How do you create a shortcut in linux?
What command needs to be used to take the backup?
What is the difference between grep and egrep?
Is bash an operating system?
c program to implement unix/linux command to block the signal ctrl-c and ctrl-\ signal during the execution ls -l|wc -l
How can I send a mail with a compressed file as an attachment?
madhar chod unix ke 10 commands dhang se likh nahi sakta hai
What is the first line in a shell script?
What is option in shell script?