Friday, September 11, 2015

Unix Shell Scripting interview questions


  1. How do you archive 10 days old logs?
  2. What is tee command used for?
  3. How will you divide a huge file with millions of records into smaller files of small sizes?
  4. How can you get the specific lines from a file using awk command?
  5. What do you mean by sed command?
  6. count the number of occurrence of a particular word in a file?
  7. How will you list all the links present in a directory?
  8. rename all the text files present in a directory into ksh file?
  9. Write a regular expression to retrieve “Apple” from the file. And print only the name “Apple”. (complete line should not be printed)
  10. In a log file you have date in yyyy mm dd hh:mi:ss format. Retrieve those dates where time is between 19:10:00 to 19:20:00
  11. Write a shell script to reverse a string without using inbuilt function?
  12. How to find a process and kill in Unix?
  13. Unix command which will display content of file which has more than 45 characters?
  14. list all zombie process?
  15. list all the files having size greater than 10k in a directory?
  16. print all the fields in a file in reverse order?
  17. give the total sum of all sizes and average of sizes of files in a directory.
  18. Print the contents of file from a specified position(Pattern) to the specified end position(pattern).
  19. print all rows of files which are not equal to their previous rows.
  20. show the content of a file in a page format and starting with number 5 as the first line.

No comments:

Post a Comment