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

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

4693


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

533


How to redirect both standard output and standard error to the same location?

635


How do I run a .sh file on mac?

681


Print a given number, in reverse order using a shell script such that the input is provided using command line argument only.

704






What are the different variables present in linux shell?

613


What is a shell made of?

558


What is the first line in every perl script called?

557


How to replace following lines, catch (DAOException e) { objLogger.error(this.getClass () + "addUpdateIssues() " + e); throw new BOException(5122); } catch (BOException e) { objLogger.error(this.getClass () + "addUpdateIssues() " + e); throw e; } catch (Exception e) { objLogger.error(this.getClass () + "addUpdateIssues() " + e); throw new BOException(5122); } Needs to be changed in to, catch (DAOException e) { AppException.handleException (null, null, e, null, null, null, "BOException", this.getClass() + "addUpdateIssues() ", null, null, null, null, null, null, null, null, 5122); } catch (BOException e) { AppException.handleException (null, null, null, e, null, null, "BOException", this.getClass() + "addUpdateIssues() ", null, null, null, null, null, null, null, null, 0); } catch (Exception e) { AppException.handleException (null, null, null, null, null, e, "BOException", this.getClass() + "addUpdateIssues() ", null, null, null, null, null, null, null, null, 5122); }

1857


What is shell scripting?

593


What is the significance of the shebang line in shell scripting?

532


What are the different types of shell scripting?

538


What are the default permissions of a file when it is created?

499


Write a script to print the first 10 elements of fibonacci series.

1769


What does echo mean in scripting?

592