General UNIX Interview Questions »

1. What are the main differences between Apache 1.x and 2.x?

2. What does the “route” command do?

Typical usage of route:

/sbin/route -n:

DISPLAY KERNEL ROUTING TABLES.

Or

To manipulate the routing table.

3. What are the read/write/execute bits on a directory mean?

Access rights (read/write/execute) on a directory means:
->read indicates that it is possible to list files in the directory.
->write indicates that it is possible to delete or move files in the directory.
->execute indicates that it is possible to read files in the directory provided we must have read permission on individual files of that directory.

or

Access rights (read/write/execute) on a directory means:

execute permission allows a user to enter the directory and perform read/write/execute files according to the permissions of the file. But you cannot ‘ls’ the directory until you have a read permission.
It means you should know the filename.
eg:

[amar@darkstar ~]$ ls -l grep Book
d–x—— 6 amar amar 4096 Sep 5 11:27 BookScripting # directory only has
execute permission

[amar@darkstar ~]$ ls -l BookScripting/ # no read permission
ls: BookScripting/: Permission denied # so ‘ls -l’ denied

[amar@darkstar ~]$ ls -l BookScripting/test.sh
-r-x—— 1 amar amar 37 Sep 5 11:27 BookScripting/test.sh

[amar@darkstar ~]$ BookScripting/test.sh
you can execute

[amar@darkstar ~]$

4. What does iostat do?

iostat Will show the status of INPUT & OUTPUT.

5. what does vmstat do?

vmstat–To know the memory related status

6. What does netstat do?

netstat–To know the network status.

7. What is the most graceful way to bring a system into single user mode?

The most graceful way is to use the command init s.
If you want to shut everything down before going to single user mode then do init 0 first and from the ok prompt do a boot -s.

8. How do you determine disk usage?

The disk usage can be determined by using the command, du.This command outputs the number of kilobytes used by each sub-directory.

9. What is AWK?

AWK is a complete pattern scanning and processing language, it is most commonly used as a Unix command-line filter to reformat the output of other commands.

For example, to print only the second and sixth fields of the date command (the month and year) with a space separating them, at the Unix prompt, you would enter:
date awk ‘{print $2 ” ” $6}’

10. What is SED?

SED (which stands for Stream EDitor) is a simple but powerful computer program used to apply various pre-specified textual transformations to a sequential stream of text data.

It reads input files line by line, edits each line according to rules specified in its simple language (the sed script), and then outputs the line.

11. What is the difference between binaries in /bin, and /usr/bin?

/bin - would contains the binaries frequently used by the normal user (as well as system administrator)
/usr/bin - would contains the binaries rarely used by the normal user (as wel as system administrator)

Or

Under Solaris, there is no difference. /bin is a symbolic link pointing to /usr/bin. Under Linux (RHAS3) /bin is seemingly for standard unix programs like vi, cp, mv, rm which you’d need in a single user environment where as /usr/bin contains programs you’d want for a multiuser environment. Keep in mind that sometimes /usr is a different disk partition and when you start up in single user mode you only have / mounted.

The /sbin directories are *supposed to* contain statically linked programs. This mas morphed into the idea of bin for user programs, sbin for admin programs.

12. What is a dynamically linked file?

A dynamically linked program is one that, when executed, loads shared libraries from /lib or /usr/lib in order to execute. The idea is that most programs use many of the same functions, so include a copy of a common function in *every* program on the file system. Instead, the function is placed in a shared library and when the program starts executing, the library is loaded which provides the program access to the function.

13. What is a statically linked file?

A statically linked program is one that contains all the information (libraries) it needs to run. It does not need to load additional libaries in order to execute.

14. What is MUTEX?

Short for mutual exclusion object. In computer programming, a mutex is a program object that allows multiple program threads to share the same resource, such as file access, but not simultaneously. When a program is started, a mutex is created with a unique name. After this stage, any thread that needs the resource must lock the mutex from other threads while it is using the resource. The mutex is set to unlock when the data is no longer needed or the routine is finished.

15. What is INODE?

A unique number associated with each filename. This number is used to look up an entry in the inode table which gives information on the type, size, and location of the file and the userid of the owner of the file.

16. Where INODE will be stored?

Inode is stored in File Management system ie in the Secondary Memory where os is stored

0 Response to "General UNIX Interview Questions »"

Post a Comment

Powered by Blogger