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

Answer Posted / abhishek

awk 'NR % 2 == 0 {print}' abc.txt

Is This Answer Correct ?    3 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is an inode block?

577


How do I edit a .sh file?

621


What is shell variable?

527


What shell is bin sh?

532


How to print pid of the current shell?

604






Which shell is the best?

574


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

591


State the advantages of shell scripting?

594


Why is a script important?

562


What are the different types of shell scripting?

532


c program which behaves like a shell(command interpreter). it has its own prompt say "NewShell$".any normal shell command is executed from your shell by starting a child process to execute a system program corrosponding to the command

4690


What is basename in shell script?

591


What is shell company all about?

575


What is the conditional statement in shell scripting?

658


Is shell scripting a programming language?

575