Unix / Linux Production Support Interview Questions

Q1. How do you monitor the server resources if inadvertently high traffic is reported ?

Ans. We use SAR command for that purpose. We also have GUI system monitoring tool to keep real time check of requests, load and memory usage.

Q2. How do you monitor your logs while investigating a high severity problem ?

Ans. We try to look for errors in the last n minutes when the issue occurred. If the issue is still occurring intermittently, We tail the logs for different application server instances to see the error snippets coming in the live logs.   

Q3. Have you done any sort of automation in your system monitoring tasks ?

Ans. Yes we have created System as well as Log monitoring scripts to keep track of exceptions. We are also using a tool that will inform the stake holders if an exceptional event occurs with the system.

Q4. Do you use command aliases while doing your work ?

Ans. Yes , I have created many aliases and saved them within my .profile file so that the system loads them, the each time i logs onto the server.

Q5.  How to display and set the Class path in Unix ?

Ans. To display the current CLASSPATH variable, use these commands in UNIX (Bourne shell):

% echo $CLASSPATH

To delete the current contents of the CLASSPATH variable, 

In UNIX:      % unset CLASSPATH; export CLASSPATH

To set the CLASSPATH variable, 

In UNIX:      % CLASSPATH=/home/george/java/classes; export CLASSPATH

Q6. What is the use of Redirection and Pipe ?

Ans. Redirection is used for directing the output to another device or file

or getting the input from another device or file other than console. 

Pipe is used to direct the output of one command as the input of another.

Q7. How to find count of a particular exceptions in a particular log file ?

Ans. grep -c "exceptionName" logFileName.txt

Q8. Will this command be case sensitive ? How to ignore the case ?

Ans. grep -ic "exceptionName" logFileName.txt

Q9. How to search for the exception count if the log file is zipped ?

Ans. zgrep -ic "exceptionName" logFileName.txt

Q10. What is the use of egrep ?

Ans. egrep is used if we have find multiple strings in the file.

Q11. What command to be used if I need to find something in the rolling logs ?

Ans. tail -f logFileName | grep "searchString"

Q12. Which command can we use if I am not sure of the logFileName and just want an exception to be looked upon in the group of files in a directory ?

Ans. We can use "find" to find the files and then pipe the output to grep.

Q13. How to change the file permissions ?

Ans. chmod 754 fileName

Q14. What does 754 means ?

Ans. 7 is for rwx , 5 is for rx and 4 is for r only permission for owner,group and others respectively.

Q15. How to check all processes running on the system ?

Ans. ps -A

Q16. What is the use of df command ?

Ans. df is used to display the amount of available disk space.

Q17. What is the use of Sar command ?

Ans. System Activity Report is the unix command to monitor various system loads , CPU activity , memory , device load etc.