Interview questions

Awk interview questions

103 questions. Tap “Show answer” to check yourself.

  1. Write a command to print all line except first line?

  2. Write a command to rename the files in a directory with "_new" as postfix?

  3. In the text file, some lines are delimited by colon and some are delimited by space. Write a command to print the third field of each line.?

  4. Write a command to print the squares of numbers from 1 to 10 using awk command?

  5. Write a command to print the second and third line of a file without using nr?

  6. Write a command to find the total number of lines in a file without using nr?

  7. How to get only zero byte files which are present in the directory?

  8. How to display even number of records into one file and odd number of records into another file?

  9. How to print only blank line of file?

  10. How add a first record and last record to the current file in linux?

  11. Write a command to print zero byte size files?

  12. How to run awk command specified in a file?

  13. Write a command remove all empty lines?

  14. Write a command to print the line number before each line?

  15. What is the use of ERRNO?

  16. What is the use of FIELDWIDTHS?

  17. Write a command delete all line except first line?

  18. What is the use of SUBSEP?

  19. What is the use of CONVFMT?

  20. What is the use of RSTART, RLENGTH and match ?

  21. What is the use of ARGV ?

  22. What is the use of ARGIND?

  23. What is the use of FNR?

  24. What is the use of OFMT?

  25. What are System functions?

  26. What is the use of systime function?

  27. What is the use of Strftime function?

  28. What are AWK patterns?

  29. What is the use of string function strtonum(string)?

  30. What is the use of string function asort(string,[d])?

Companies that ask Awk questions