Unix - Interview Questions and Answers for 'Unix' - 31 question(s) found - Order By Newest Q1. 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 Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  unix   unix commands   classpath Q2. What is the use of !! command ? Can I use it with conjunction to some other string to complete a command ? Unix
Ans. Its used to execute last command. Yes this can be used with other string to execute new command. For eg - if ls was the last command, We can execute !! -l for having the long listing. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  unix   unix commands   !! unix command   build management   release management Q3. How to Change Default Boot Kernel in Linux ? Unix
Ans. https://www.redhat.com/archives/rhl-list/2005-April/msg04167.html Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  unix  change default kernel Asked in 1 Companies Q4. What will be the crontab to run a job every last day of month ? Unix
Ans. 59 23 28-31 * * [ "$(date +%d -d tomorrow)" = "01" ] && job_name Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  unix  crontab Asked in 1 Companies Q5. Write a unix command to find top 10 files by size ? Unix
Ans. du -a /var | sort -n -r | head -n 10 Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  unix command Asked in 1 Companies Q6. What are fields that gets displayed when you execute "Top" command and briefly explain each field ? Unix
Ans. PID - process identification number is an identification number that is automatically assigned to each process when it is created
USER - User Name
PR - PR is the process actual priority
NI is the nice value, which is a user-space concept.
VIRT -Virtual Image (kb). The total amount of virtual memory used by the task.
RES - Resident size (kb). The non-swapped physical memory a task has used.
SHR - Shared Mem size (kb). The amount of shared memory used by a task.
S - Process Status. The status of the task which can be one of:
D = uninterruptible sleep
R = running
S = sleeping
T = traced or stopped
Z = zombie
%CPU - % CPU usage
%MEM - % MEM Usage
TIME - Total CPU time the task has used since it started.
COMMAND - Command which was used to execute the process Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  top command  unix command Asked in 1 Companies Q7. How do you monitor the server resources if inadvertently high traffic is reported ? Support
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. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  production support  unix  SAR Q8. How do you monitor your logs while investigating a high severity problem ? Support
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. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  production support  unix  application logs Q9. Do you use command aliases while doing your work ? General
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. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  unix  command aliasis Q10. How to use Find command in Unix ? Unix
Ans. http://javasearch.buggybread.com/UnixCommand/searchUnixCommandsScripts.php?keyword=find Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  find command Asked in 1 Companies Q11. As root, if you have to assign the owner for the file and set only read permission for the owner, Write a unix command to do it. Unix
Ans. chmod 477 Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  unix commands  setting file permissions  chown  chmod Q12. What is the difference between grep, zgrep and egrep ? Unix
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  grep  zgrep  egrep Q13. How can we see running logs ? Unix
Ans. tail -f <LOG_FILE_NAME> Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q14. What is the command to change file / folder permissions ? What command should we use if we would like to give most liberal position on the file ? Unix
Ans. chmod is used to change permissions on file or folder.
chmod 777 <FILE/FOLDER NAME> Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  chmod Q15. How to see last 500 lines of a log or text file Unix
Ans. tail -500 <FILE_NAME> Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  unix  log file Q16. Can we run grep on zipped file ? Unix
Ans. We can zgrep for that Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  grep  zgrep Q17. How to find something within a folder and all it's sub folder Unix
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  find  unix Q18. How to find lines in a file containing a particular text and get those lines in a new file Unix
Ans. grep "Some Text" EXISTING_FILE > NEW FILE Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  grep Q19. Have you ever used awk and sed ? What's the difference between the two ? Unix
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q20. How to count lines in a file having a particular text Unix
Ans. grep "Some Text" FILE | wc -l Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q21. How can we create directories recursively Unix
Ans. mkdir -p /home/newParentDir/newDir Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q22. Find all files from a directory (including sub directories ) that could contain dates in a specific format. Unix
This question was recently asked at 'Hitachi'.This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q23. Difference between su <username> vs sudo su <username> Unix
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q24. What happens if we do su without user name ? Unix
Ans. it will start shell for user root and will ask for the password for root user Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q25. Can you tell me any 10 unix command you have worked with ? Unix
Ans. grep, ls, kill, vi , scp , wget,telnet, zip, unzip,mv,cp Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  unix commands Asked in 1 Companies basic Q26. Difference between kill -9 and kill -15 ? Unix
This question is still unanswered. Can you please provide an answer. Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Q27. How do you ftp files to a different server ? Do you use scp or mput etc. Unix
Ans. I use both mput as well as scp. mput usually with sftp Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  unix commands  ftp Q28. Can we change permissions recursively for all folders and files within a single folder ? Unix
Ans. chmod 777 -R /directory Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve  Unix Commands Q29. Explain unix commands - cat and pwd. Unix
Ans. by using Cat command we can open and see the file content and as well as redirect the file content to another files
pwd command shows us current working path of the server
cat filename | tail -100
cat file name > filname1 Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies Q30. How do you use cut command in unix ? Unix
Ans. cut command is used to extract the given number of characters and columns from a file Help us improve. Please let us know the company, where you were asked this question : Like Discuss Correct / Improve   Asked in 1 Companies