In a file , how to retrieve the lines which are the
multiples of 50 ? like 50,100,150th lines etc.

Answer Posted / kavita

awk 'NR % 50 ==0 {print}' filename

Is This Answer Correct ?    6 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is gui scripting?

602


Rewrite the command to print the sentence and convert the variable to plural: echo “i like $variable”.

565


What can scripts do?

663


Determine the output of the following command: name=shubham && echo ‘my name is $name’.

530


Is shell script a programming language?

568






Why should we use shell scripts?

590


I have 2 files and I want to print the records which are common to both.

695


How does shell scripting work?

612


How to get the 3rd element/column from each line from a file?

687


What is the fastest scripting language?

547


How do I run a shell script in powershell?

554


how to get part of string variable with echo command only?

591


How do I run a bin bash script?

572


How to use arguments in a script?

579


how will you find the total disk space used by a specific user?

578