<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:georss='http://www.georss.org/georss' xmlns:gd='http://schemas.google.com/g/2005' xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-372761662587957859</id><updated>2011-11-27T16:17:57.380-08:00</updated><category term='Unix'/><title type='text'>Unix Interview Questions - An interviewhelper.org blog</title><subtitle type='html'>This blog contains common Unix interview questions asked by different organizations.&lt;br&gt;&lt;br&gt;
For more such interview questions, please visit our website &lt;a href="http://interviewhelper.org"&gt;Interview Helper&lt;/a&gt;........&lt;a href="http://interviewhelper.org"&gt;&lt;img src="http://interviewhelper.org/images/interviewhelper.jpg" width="200" height="73" border="0"&gt;&lt;/a&gt;</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>28</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-7236831837794246336</id><published>2009-03-02T22:37:00.000-08:00</published><updated>2009-03-02T22:38:06.323-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>What is IPC  What are the various schemes available</title><content type='html'>&lt;strong&gt;Question :What is IPC? What are the various schemes available?&lt;/strong&gt;&lt;br /&gt;Answer :The term IPC (Inter-Process Communication) describes various ways by which different process running on some operating system communicate between each other. Various schemes available are as follows: Pipes: One-way communication scheme through which different process can communicate. The problem is that the two processes should have a common ancestor (parent-child relationship). However this problem was fixed with the introduction of named-pipes (FIFO). Message Queues : Message queues can be used between related and unrelated processes running on a machine. Shared Memory: This is the fastest of all IPC schemes. The memory to be shared is mapped into the address space of the processes (that are sharing). The speed achieved is attributed to the fact that there is no kernel involvement. But this scheme needs synchronization. Various forms of synchronisation are mutexes, condition-variables, read-write locks, record-locks, and semaphores&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-7236831837794246336?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/7236831837794246336/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-is-ipc-what-are-various-schemes.html#comment-form' title='2 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/7236831837794246336'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/7236831837794246336'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-is-ipc-what-are-various-schemes.html' title='What is IPC  What are the various schemes available'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>2</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-2049501843772284434</id><published>2009-03-02T22:36:00.000-08:00</published><updated>2009-03-02T22:37:13.228-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>How do you execute one program from within another</title><content type='html'>&lt;strong&gt;Question :How do you execute one program from within another?&lt;/strong&gt;&lt;br /&gt;Answer :The system calls used for low-level process creation are execlp() and execvp(). The execlp call overlays the existing program with the new one , runs that and exits. The original program gets back control only when an error occurs. execlp(path,file_name,arguments..); //last argument must be NULL A variant of execlp called execvp is used when the number of arguments is not known in advance. execvp(path,argument_array); //argument array should be terminated by NULL&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-2049501843772284434?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/2049501843772284434/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/how-do-you-execute-one-program-from.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/2049501843772284434'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/2049501843772284434'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/how-do-you-execute-one-program-from.html' title='How do you execute one program from within another'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-5197577158982083060</id><published>2009-03-02T22:35:00.000-08:00</published><updated>2009-03-02T22:36:18.511-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>What is an advantage of executing a process in background</title><content type='html'>&lt;strong&gt;Question :What is an advantage of executing a process in background?&lt;/strong&gt;&lt;br /&gt;Answer :The most common reason to put a process in the background is to allow you to do something else interactively without waiting for the process to complete. At the end of the command you add the special background symbol, &amp;amp;. This symbol tells your shell to execute the given command in the background. Example: cp *.* ../backup&amp;amp; (cp is for copy)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-5197577158982083060?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/5197577158982083060/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-is-advantage-of-executing-process.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/5197577158982083060'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/5197577158982083060'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-is-advantage-of-executing-process.html' title='What is an advantage of executing a process in background'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-7078001443364164878</id><published>2009-03-02T22:34:00.000-08:00</published><updated>2009-03-02T22:35:26.018-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>How would you kill a process</title><content type='html'>&lt;strong&gt;Question :How would you kill a process?&lt;/strong&gt;&lt;br /&gt;Answer :The kill command takes the PID as one argument; this identifies which process to terminate. The PID of a process can be got using 'ps' command.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-7078001443364164878?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/7078001443364164878/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/how-would-you-kill-process.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/7078001443364164878'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/7078001443364164878'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/how-would-you-kill-process.html' title='How would you kill a process'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-5561103307910545342</id><published>2009-03-02T22:33:00.000-08:00</published><updated>2009-03-02T22:34:34.630-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>What is 'ps' command for</title><content type='html'>&lt;strong&gt;Question :What is 'ps' command for?&lt;/strong&gt;&lt;br /&gt;Answer :The ps command prints the process status for some or all of the running processes. The information given are the process identification number (PID),the amount of time that the process has taken to execute so far etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-5561103307910545342?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/5561103307910545342/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-is-ps-command-for.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/5561103307910545342'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/5561103307910545342'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-is-ps-command-for.html' title='What is &apos;ps&apos; command for'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-7502951973935269473</id><published>2009-03-02T22:32:00.000-08:00</published><updated>2009-03-02T22:33:30.027-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>What is a Daemon</title><content type='html'>&lt;strong&gt;Question :What is a Daemon?&lt;/strong&gt;&lt;br /&gt;Answer :A daemon is a process that detaches itself from the terminal and runs, disconnected, in the background, waiting for requests and responding to them. It can also be defined as the background process that does not belong to a terminal session. Many system functions are commonly performed by daemons, including the sendmail daemon, which handles mail, and the NNTP daemon, which handles USENET news. Many other daemons may exist. Some of the most common daemons are: • init: Takes over the basic running of the system when the kernel has finished the boot process. • inetd: Responsible for starting network services that do not have their own stand-alone daemons. For example, inetd usually takes care of incoming rlogin, telnet, and ftp connections. • cron: Responsible for running repetitive tasks on a regular schedule.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-7502951973935269473?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/7502951973935269473/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-is-daemon.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/7502951973935269473'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/7502951973935269473'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-is-daemon.html' title='What is a Daemon'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-6981508648779747259</id><published>2009-03-02T22:31:00.000-08:00</published><updated>2009-03-02T22:32:01.226-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>What Happens when you execute a command</title><content type='html'>&lt;strong&gt;Question :What Happens when you execute a command?&lt;/strong&gt;&lt;br /&gt;Answer :When you enter 'ls' command to look at the contents of your current working directory, UNIX does a series of things to create an environment for ls and the run it: The shell has UNIX perform a fork. This creates a new process that the shell will use to run the ls program. The shell has UNIX perform an exec of the ls program. This replaces the shell program and data with the program and data for ls and then starts running that new program. The ls program is loaded into the new process context, replacing the text and data of the shell. The ls program performs its task, listing the contents of the current directory.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-6981508648779747259?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/6981508648779747259/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-happens-when-you-execute-command.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/6981508648779747259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/6981508648779747259'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-happens-when-you-execute-command.html' title='What Happens when you execute a command'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-4437377619250155288</id><published>2009-03-02T22:29:00.000-08:00</published><updated>2009-03-02T22:30:57.576-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>What Happens when you execute a program</title><content type='html'>&lt;strong&gt;Question :What Happens when you execute a program?&lt;/strong&gt;&lt;br /&gt;Answer :When you execute a program on your &lt;a href="http://interviewhelper.org/Art/530/59/Process-Model-and-IPC-Unix-Questions.html" target="_top"&gt;UNIX system&lt;/a&gt;, the system creates a special environment for that program. This environment contains everything needed for the system to run the program as if no other program were running on the system. Each process has process context, which is everything that is unique about the state of the program you are currently running. Every time you execute a program the UNIX system does a fork, which performs a series of operations to create a process context and then execute your program in that context. The steps include the following: • Allocate a slot in the process table, a list of currently running programs kept by UNIX. • Assign a unique process identifier (PID) to the process. • iCopy the context of the parent, the process that requested the spawning of the new process. • Return the new PID to the parent process. This enables the parent process to examine or control the process directly. After the fork is complete, UNIX runs your program.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-4437377619250155288?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/4437377619250155288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-happens-when-you-execute-program.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/4437377619250155288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/4437377619250155288'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-happens-when-you-execute-program.html' title='What Happens when you execute a program'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-4547998978049681116</id><published>2009-03-02T22:28:00.000-08:00</published><updated>2009-03-02T22:29:31.230-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>What are the process states in Unix</title><content type='html'>&lt;strong&gt;Question :What are the process states in Unix?&lt;/strong&gt;&lt;br /&gt;Answer :As a process executes it changes state according to its circumstances. Unix processes have the following states: Running : The process is either running or it is ready to run . Waiting : The process is waiting for an event or for a resource. Stopped : The process has been stopped, usually by receiving a signal. Zombie : The process is dead but have not been removed from the process table.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-4547998978049681116?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/4547998978049681116/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-are-process-states-in-unix.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/4547998978049681116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/4547998978049681116'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-are-process-states-in-unix.html' title='What are the process states in Unix'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-4246714341944295308</id><published>2009-03-02T22:27:00.000-08:00</published><updated>2009-03-02T22:28:40.571-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>What is a zombie</title><content type='html'>&lt;strong&gt;Question :What is a zombie?&lt;/strong&gt;&lt;br /&gt;Answer :When a program forks and the child finishes before the parent, the kernel still keeps some of its information about the child in case the parent might need it - for example, the parent may need to check the child's exit status. To be able to get this information, the parent calls `wait()'; In the interval between the child terminating and the parent calling `wait()', the child is said to be a `zombie' (If you do `ps', the child will have a `Z' in its status field to indicate this.)&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-4246714341944295308?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/4246714341944295308/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-is-zombie.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/4246714341944295308'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/4246714341944295308'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-is-zombie.html' title='What is a zombie'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-6486277145894739914</id><published>2009-03-02T22:26:00.002-08:00</published><updated>2009-03-02T22:27:44.423-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>How can a parent and child process communicate</title><content type='html'>&lt;strong&gt;Question :How can a parent and child process communicate?&lt;/strong&gt;&lt;br /&gt;Answer :A parent and child can communicate through any of the normal inter-process communication schemes (pipes, sockets, message queues, shared memory), but also have some special ways to communicate that take advantage of their relationship as a parent and child. One of the most obvious is that the parent can get the exit status of the child.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-6486277145894739914?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/6486277145894739914/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/how-can-parent-and-child-process.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/6486277145894739914'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/6486277145894739914'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/how-can-parent-and-child-process.html' title='How can a parent and child process communicate'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-1202394819638008262</id><published>2009-03-02T22:26:00.001-08:00</published><updated>2009-03-02T22:26:53.465-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>How can you get/set an environment variable from a program</title><content type='html'>&lt;strong&gt;Question :How can you get/set an environment variable from a program?&lt;/strong&gt;&lt;br /&gt;Answer :Getting the value of an environment variable is done by using `getenv()'. Setting the value of an environment variable is done by using `putenv()'.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-1202394819638008262?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/1202394819638008262/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/how-can-you-getset-environment-variable.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/1202394819638008262'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/1202394819638008262'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/how-can-you-getset-environment-variable.html' title='How can you get/set an environment variable from a program'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-5507957395524196350</id><published>2009-03-02T22:24:00.000-08:00</published><updated>2009-03-02T22:25:58.692-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>List the system calls used for process management</title><content type='html'>&lt;strong&gt;Question :List the system calls used for process management?&lt;/strong&gt;&lt;br /&gt;Answer :System calls Description fork() To create a new process exec() To execute a new program in a process wait() To wait until a created process completes its execution exit() To exit from a process execution getpid() To get a process identifier of the current process getppid() To get parent process identifier nice() To bias the existing priority of a process brk() To increase/decrease the data segment size of a process&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-5507957395524196350?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/5507957395524196350/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/list-system-calls-used-for-process.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/5507957395524196350'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/5507957395524196350'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/list-system-calls-used-for-process.html' title='List the system calls used for process management'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-7569316139827957629</id><published>2009-03-02T22:23:00.000-08:00</published><updated>2009-03-02T22:24:40.747-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>Predict the output of the following program code</title><content type='html'>&lt;strong&gt;Question :Predict the output of the following program code main() { fork(); fork(); fork(); printf("Hello World!"); }&lt;/strong&gt;&lt;br /&gt;Answer :"Hello World" will be printed 8 times. Explanation: 2^n times where n is the number of calls to fork()&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-7569316139827957629?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/7569316139827957629/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/predict-output-of-following-program_02.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/7569316139827957629'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/7569316139827957629'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/predict-output-of-following-program_02.html' title='Predict the output of the following program code'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-8239863020157608767</id><published>2009-03-02T22:19:00.000-08:00</published><updated>2009-03-02T22:20:25.166-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>Explain fork() system call</title><content type='html'>&lt;strong&gt;Question :Explain fork() system call?&lt;/strong&gt;&lt;br /&gt;Answer :The `fork()' used to create a new process from an existing process. The new process is called the child process, and the existing process is called the parent. We can tell which is which by checking the return value from `fork()'. The parent gets the child's pid returned to him, but the child gets 0 returned to him.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-8239863020157608767?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/8239863020157608767/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/explain-fork-system-call.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/8239863020157608767'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/8239863020157608767'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/explain-fork-system-call.html' title='Explain fork() system call'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-5657562607818256477</id><published>2009-03-02T22:18:00.000-08:00</published><updated>2009-03-02T22:19:28.687-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>What are various IDs associated with a process</title><content type='html'>&lt;strong&gt;Question :What are various IDs associated with a process?&lt;/strong&gt;&lt;br /&gt;Answer :Unix identifies each process with a unique integer called ProcessID. The process that executes the request for creation of a process is called the 'parent process' whose PID is 'Parent Process ID'. Every process is associated with a particular user called the 'owner' who has privileges over the process. The identification for the user is 'UserID'. Owner is the user who executes the process. Process also has 'Effective User ID' which determines the access privileges for accessing resources like files. getpid() -process id getppid() -parent process id getuid() -user id geteuid() -effective user id&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-5657562607818256477?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/5657562607818256477/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-are-various-ids-associated-with.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/5657562607818256477'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/5657562607818256477'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-are-various-ids-associated-with.html' title='What are various IDs associated with a process'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-5532441665582663116</id><published>2009-03-02T22:17:00.000-08:00</published><updated>2009-03-02T22:18:16.737-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>Brief about the initial process sequence while the system boots up.</title><content type='html'>&lt;strong&gt;Question :Brief about the initial process sequence while the system boots up.?&lt;/strong&gt;&lt;br /&gt;Answer :While booting, special process called the 'swapper' or 'scheduler' is created with Process-ID 0. The swapper manages memory allocation for processes and influences CPU allocation. The swapper inturn creates 3 children: • the process dispatcher, • vhand and • dbflush with IDs 1,2 and 3 respectively. This is done by executing the file /etc/init. Process dispatcher gives birth to the shell. Unix keeps track of all the processes in an internal data structure called the Process Table (listing command is ps -el).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-5532441665582663116?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/5532441665582663116/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/brief-about-initial-process-sequence.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/5532441665582663116'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/5532441665582663116'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/brief-about-initial-process-sequence.html' title='Brief about the initial process sequence while the system boots up.'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-4047457132014828133</id><published>2009-03-02T22:16:00.000-08:00</published><updated>2009-03-02T22:17:12.410-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>What is a shell</title><content type='html'>&lt;strong&gt;Question :What is a shell?&lt;/strong&gt;&lt;br /&gt;Answer :A shell is an interactive user interface to an operating system services that allows an user to enter commands as character strings or through a graphical user interface. The shell converts them to system calls to the OS or forks off a process to execute the command. System call results and other information from the OS are presented to the user through an interactive interface. Commonly used shells are sh,csh,ks etc.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-4047457132014828133?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/4047457132014828133/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-is-shell.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/4047457132014828133'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/4047457132014828133'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-is-shell.html' title='What is a shell'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-8329032703862016227</id><published>2009-03-02T22:15:00.000-08:00</published><updated>2009-03-02T22:16:13.297-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>How does the inode map to data block of a file</title><content type='html'>&lt;strong&gt;Question :How does the inode map to data block of a file?&lt;/strong&gt;&lt;br /&gt;Answer :Inode has 13 block addresses. The first 10 are direct block addresses of the first 10 data blocks in the file. The 11th address points to a one-level index block. The 12th address points to a two-level (double in-direction) index block. The 13th address points to a three-level(triple in-direction)index block. This provides a very large maximum file size with efficient access to large files, but also small files are accessed directly in one disk read.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-8329032703862016227?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/8329032703862016227/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/how-does-inode-map-to-data-block-of.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/8329032703862016227'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/8329032703862016227'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/how-does-inode-map-to-data-block-of.html' title='How does the inode map to data block of a file'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-7887449548870386244</id><published>2009-03-02T22:08:00.000-08:00</published><updated>2009-03-02T22:14:49.900-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>Discuss the mount and unmount system calls</title><content type='html'>&lt;strong&gt;Question :Discuss the mount and unmount system calls ?&lt;/strong&gt;&lt;br /&gt;Answer :The privileged mount system call is used to attach a file system to a directory of another file system; the unmount system call detaches a file system. When you mount another file system on to your directory, you are essentially splicing one directory tree onto a branch in another directory tree. The first argument to mount call is the mount point, that is , a directory in the current file naming system. The second argument is the file system to mount to that point. When you insert a cdrom to your unix system's drive, the file system in the cdrom automatically mounts to /dev/cdrom in your system.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-7887449548870386244?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/7887449548870386244/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/discuss-mount-and-unmount-system-calls.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/7887449548870386244'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/7887449548870386244'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/discuss-mount-and-unmount-system-calls.html' title='Discuss the mount and unmount system calls'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-563623174974406589</id><published>2009-03-02T22:07:00.002-08:00</published><updated>2009-03-02T22:08:37.802-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>How do you create special files like named pipes and device files</title><content type='html'>&lt;strong&gt;Question :How do you create special files like named pipes and device files?&lt;/strong&gt;&lt;br /&gt;Answer :The system call mknod creates special files in the following sequence. kernel assigns new inode, sets the file type to indicate that the file is a pipe, directory or special file, If it is a device file, it makes the other entries like major, minor device numbers. For example: If the device is a disk, major device number refers to the disk controller and minor device number is the disk.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-563623174974406589?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/563623174974406589/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/how-do-you-create-special-files-like.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/563623174974406589'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/563623174974406589'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/how-do-you-create-special-files-like.html' title='How do you create special files like named pipes and device files'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-6280134857459342031</id><published>2009-03-02T22:07:00.001-08:00</published><updated>2009-03-02T22:07:47.958-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>What is a FIFO</title><content type='html'>&lt;strong&gt;Question :What is a FIFO?&lt;/strong&gt;&lt;br /&gt;Answer :FIFO are otherwise called as 'named pipes'. FIFO (first-in-first-out) is a special file which is said to be data transient. Once data is read from named pipe, it cannot be read again. Also, data can be read only in the order written. It is used in interprocess communication where a process writes to one end of the pipe (producer) and the other reads from the other end (consumer).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-6280134857459342031?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/6280134857459342031/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-is-fifo.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/6280134857459342031'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/6280134857459342031'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-is-fifo.html' title='What is a FIFO'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-5006689858096345701</id><published>2009-03-02T22:06:00.000-08:00</published><updated>2009-03-02T22:07:08.049-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>What are links and symbolic links in UNIX file system</title><content type='html'>&lt;strong&gt;Question :What are links and symbolic links in UNIX file system?&lt;/strong&gt;&lt;br /&gt;Answer :A link is a second name (not a file) for a file. Links can be used to assign more than one name to a file, but cannot be used to assign a directory more than one name or link filenames on different &lt;a href="http://interviewhelper.org/Art/529/59/File-Management-Questions-In-UNIX.html" target="_top"&gt;computers&lt;/a&gt;. Symbolic link 'is' a file that only contains the name of another file.Operation on the symbolic link is directed to the file pointed by the it.Both the limitations of links are eliminated in symbolic links. Commands for linking files are: Link ln filename1 filename2 Symbolic link ln -s filename1 filename2&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-5006689858096345701?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/5006689858096345701/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-are-links-and-symbolic-links-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/5006689858096345701'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/5006689858096345701'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-are-links-and-symbolic-links-in.html' title='What are links and symbolic links in UNIX file system'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-7888970728628148630</id><published>2009-03-02T22:05:00.000-08:00</published><updated>2009-03-02T22:06:14.111-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>How do you change File Access Permissions</title><content type='html'>&lt;strong&gt;Question :How do you change File Access Permissions?&lt;/strong&gt;&lt;br /&gt;Answer :Every file has following attributes: • owner's user ID ( 16 bit integer ) • owner's group ID ( 16 bit integer ) • File access mode word 'r w x -r w x- r w x' (user permission-group permission-others permission) r-read, w-write, x-execute To change the access mode, we use chmod(filename,mode). Example 1: To change mode of myfile to 'rw-rw-r--' (ie. read, write permission for user - read,write permission for group - only read permission for others) we give the args as: chmod(myfile,0664) . Each operation is represented by discrete values 'r' is 4 'w' is 2 'x' is 1 Therefore, for 'rw' the value is 6(4+2). Example 2: To change mode of myfile to 'rwxr--r--' we give the args as: chmod(myfile,0744).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-7888970728628148630?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/7888970728628148630/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/how-do-you-change-file-access.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/7888970728628148630'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/7888970728628148630'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/how-do-you-change-file-access.html' title='How do you change File Access Permissions'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-4443556648442421438</id><published>2009-03-02T21:40:00.000-08:00</published><updated>2009-03-02T21:41:35.163-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>What are the Unix system calls for I/O</title><content type='html'>&lt;strong&gt;Question :What are the Unix system calls for I/O?&lt;/strong&gt;&lt;br /&gt;Answer :• open(pathname,flag,mode) - open file • creat(pathname,mode) - create file • close(filedes) - close an open file • read(filedes,buffer,bytes) - read data from an open file • write(filedes,buffer,bytes) - write data to an open file • lseek(filedes,offset,from) - position an open file • dup(filedes) - duplicate an existing file descriptor • dup2(oldfd,newfd) - duplicate to a desired file descriptor • fcntl(filedes,cmd,arg) - change properties of an open file • ioctl(filedes,request,arg) - change the behaviour of an open file The difference between fcntl anf ioctl is that the former is intended for any open file, while the latter is for device-specific operations.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-4443556648442421438?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/4443556648442421438/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-are-unix-system-calls-for-io.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/4443556648442421438'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/4443556648442421438'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-are-unix-system-calls-for-io.html' title='What are the Unix system calls for I/O'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-5574243801198550028</id><published>2009-03-02T21:39:00.000-08:00</published><updated>2009-03-02T21:40:23.088-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>Brief about the directory representation in UNIX</title><content type='html'>&lt;strong&gt;Question :Brief about the directory representation in UNIX ?&lt;/strong&gt;&lt;br /&gt;Answer :A Unix directory is a file containing a correspondence between filenames and inodes. A directory is a special file that the kernel maintains. Only kernel modifies directories, but processes can read directories. The contents of a directory are a list of filename and inode number pairs. When new directories are created, kernel makes two entries named '.' (refers to the directory itself) and '..' (refers to parent directory). System call for creating directory is mkdir (pathname, mode).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-5574243801198550028?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/5574243801198550028/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/brief-about-directory-representation-in.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/5574243801198550028'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/5574243801198550028'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/brief-about-directory-representation-in.html' title='Brief about the directory representation in UNIX'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-5828539009248704224</id><published>2009-03-02T21:38:00.000-08:00</published><updated>2009-03-02T21:39:12.858-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>What is 'inode'</title><content type='html'>&lt;strong&gt;Question :What is 'inode'?&lt;/strong&gt;&lt;br /&gt;Answer :All UNIX files have its description stored in a structure called 'inode'. The inode contains info about the file-size, its location, time of last access, time of last modification, permission and so on. Directories are also represented as files and have an associated inode. In addition to descriptions about the file, the inode contains pointers to the data blocks of the file. If the file is large, inode has indirect pointer to a block of pointers to additional data blocks (this further aggregates for larger files). A block is typically 8k. Inode consists of the following fields: • File owner identifier • File type • File access permissions • File access times • Number of links • File size • Location of the file data&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-5828539009248704224?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/5828539009248704224/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-is-inode.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/5828539009248704224'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/5828539009248704224'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/what-is-inode.html' title='What is &apos;inode&apos;'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-372761662587957859.post-1159301553392932383</id><published>2009-03-02T21:34:00.000-08:00</published><updated>2009-03-02T21:37:57.564-08:00</updated><category scheme='http://www.blogger.com/atom/ns#' term='Unix'/><title type='text'>How are devices represented in UNIX</title><content type='html'>&lt;strong&gt;Question :How are devices represented in UNIX?&lt;/strong&gt;&lt;br /&gt;Answer :All devices are represented by files called special files that are located in/dev directory. Thus, device files and other files are named and accessed in the same way. A 'regular file' is just an ordinary data file in the disk. A 'block special file' represents a device with characteristics similar to a disk (data transfer in terms of blocks). A 'character special file' represents a device with characteristics similar to a keyboard (data transfer is by stream of bits in sequential order).&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/372761662587957859-1159301553392932383?l=unix-interview-questions-answers.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://unix-interview-questions-answers.blogspot.com/feeds/1159301553392932383/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/how-are-devices-represented-in-unix.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/1159301553392932383'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/372761662587957859/posts/default/1159301553392932383'/><link rel='alternate' type='text/html' href='http://unix-interview-questions-answers.blogspot.com/2009/03/how-are-devices-represented-in-unix.html' title='How are devices represented in UNIX'/><author><name>Interview Helper</name><uri>http://www.blogger.com/profile/00019571984377897004</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='33' height='12' src='http://1.bp.blogspot.com/_AdNUW2U2OOs/SYHHT9_iGqI/AAAAAAAAAAM/PzlYVvYWMac/s1600-R/interviewhelper.jpg'/></author><thr:total>0</thr:total></entry></feed>
