Interview Questions: - (UNIX - 1)
UNIX: -
Q) Which command will show the output in screen and also saves the output in a file?
Ans – tee command
Example –
$ ls –lrt | tee f1<Enter – Key>
This Command will show the output of ls –lrt in the screen and saves the output in a file f1.
Q) What is zombie process?
Ans - When we send any request to shell, the shell calls a fork system call to create a child shell and assign that request to him. It is the responsibility of the child shell to complete the request and sends response back to parent shell. While sending back the response, if parent shell is not available to receive it, then it will keep the response in the result queue and die. Once the parent shell is available, it will search the result queue, take the response or result and display it. The time taken the child dies and parent shell gets the response, then the process will be in zombie state.
Q) What is orphan process?
Ans – If parent dies before child finishes it tasks, then the process is called as orphan process.
Here init is the parent process whose PID = 1.
Q) How much time unix system is up and running?
Ans - $ uptime
Q) What is 9 in kill command?
Ans - 9 is signal number in which kill command sends a signal with signal number 9 to kill the process.
Q) How to kill a process?
Ans –
$ ps –ef | grep <command_related_to_process>
Here you will get the process id i.e. 2nd column value.
$ kill -9 <PID_receive_from_1st_command>
Q) How you will see how much memory you directory and its sub directory are taking?
Ans - $ du –ch
Q) What are commands you are using in your project?
Ans –
ls –lrt
cat
touch
mv
cp
ps –ef
vi
sed
kill
sort
zip
gunzip
Q) How to create zero byte file in Unix?
Ans - $ touch <file_name>
No comments:
Post a Comment