Blog Archives

How will you get the last executed command in Unix?

We can use history command to get the list commands that were executed in Unix. Since we are only interested in the last executed command we have to use tail to get the last entry. Exact command would be as

Posted in Unix, Unix Interview Questions

What is the difference between a Zombie and Orphan process in Unix?

Zombie is a defunct child process in Unix that still has entry in process table. Sometimes a child process is terminated in Unix, but the parent process still waits on it. A Zombie process is different from an Orphan process.

Posted in Unix, Unix Interview Questions

How does alias work in Unix?

We use alias in Unix to give a short name to a long command. We can even use it to combine multiple commands and give a short convenient name. E.g. alias c=’clear’ With this alias we just need to type

Posted in Unix, Unix Interview Questions

How can you redirect I/O in Unix?

In Unix we can redirect the output of command or operation to a file instead of command line interface (CLI). For this we sue redirection pointers. These are symbols > and >>. If we want to write the output of

Posted in Unix, Unix Interview Questions

What are the main steps taken by a Unix Shell for processing a command?

A Unix Shell takes following main steps to process a command: Parse: First step is to parse the command or set of commands given in a Command Line Interface (CLI). In this step multiple consecutive spaces are replaced by single

Posted in Unix, Unix Interview Questions

What is a Sticky bit in Unix?

A Sticky bit is a file/directory permission feature in Unix. Sometimes when we give write permission to another user then that user can delete the file without the owner knowing about it. To prevent such an accidental deletion of file

Posted in Unix, Unix Interview Questions

What are the different outputs from Kill command in Unix?

Kill command in Unix can return following outputs: 0: It means Kill command was successful -1: When we get -1 from Kill command it shows that there was some error. In addition to -1 we get EPERM or ESRCH in

Posted in Unix, Unix Interview Questions

How will you customize your environment in Unix?

In Unix, almost all the popular shells provide options to customize the environment by using environment variables. To make these customizations permanent we can write these to special files that are specific to a user in a shell. Once we

Posted in Unix, Unix Interview Questions

What are the popular commands for user management in Unix?

In Unix we use following commands for User Management: id: This command gives the active user id with login and groups to which user belongs. who: This command gives the user that is currently logged on system. It also gives

Posted in Unix, Unix Interview Questions

How will you debug a shell script in Unix?

A shell script is a program that can be executed in Unix shell. Sometimes a shell script does not work as intended. To debug and find the problem in shell script we can use the options provided by shell to

Posted in Unix, Unix Interview Questions