General UNIX interview questions

  1. What are the main differences between Apache 1.x and 2.x?
  2. What does the “route” command do?
  3. What are the read/write/execute bits on a directory mean?
  4. What does iostat do?
  5. what does vmstat do?
  6. What does netstat do?
  7. What is the most graceful way to bring a system into single user mode?
  8. How do you determine disk usage?
  9. What is AWK?
  10. What is SED?
  11. What is the difference between binaries in /bin, and /usr/bin?
  12. What is a dynamically linked file?
  13. What is a statically linked file?
This entry was posted in Unix/Linux. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

20 Comments on General UNIX interview questions

  1. Jaffar
    Posted 8/31/2005 at 6:08 am | Permalink

    QNo: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.

  2. Jaffar
    Posted 8/31/2005 at 6:10 am | Permalink

    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}’

  3. lavanya
    Posted 9/6/2005 at 3:55 pm | Permalink

    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.

  4. lavanya
    Posted 9/6/2005 at 4:17 pm | Permalink

    QNO:8 How do u 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.

  5. lavanya
    Posted 9/6/2005 at 4:20 pm | Permalink

    QNO 2:
    Browse the following URL to get information about ‘route’ command

  6. lavanya
    Posted 9/6/2005 at 4:45 pm | Permalink

    Q NO:4) To know about iostat command,browse the following url:

  7. lavanya
    Posted 9/6/2005 at 4:47 pm | Permalink TO know about vmstat command,browse the following url:

  8. lavanya
    Posted 9/6/2005 at 4:48 pm | Permalink TO know about netstat command,browse the following url:

  9. Dave Waddell
    Posted 9/18/2005 at 3:31 pm | Permalink

    comment 3 on directory execute permissions is incorrect;

    Execute permission on a directory means you can list the files in that directory.

  10. Musthafa
    Posted 10/21/2005 at 2:45 am | Permalink

    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)

    12. What is a dynamically linked file?

    soft link (created with ln -s). Source and destination files will have the different inode. If dest removed source will be available. If source removed dest also will available but no where to go.

    13. What is a statically linked file?

    hard link (created with ln). Source and dest will have the same inode. Making two different copies causes more disk space due to redundancy.

  11. Chris Sheldon
    Posted 10/28/2005 at 3:56 pm | Permalink

    Comment #10 is in error with all answers

    11. What is the difference between binaries in /bin, and /usr/bin?
    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?
    This is confusing because of the use of the word ‘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?
    As above, confusing due to the use of the word ‘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.

  12. Posted 12/8/2005 at 11:34 pm | Permalink

    What is MUTEX? I need answer for this question
    What is INODE?I need answer for this question

  13. Adhik
    Posted 2/25/2006 at 4:56 pm | Permalink

    Ans 7: kill -TERM 1

  14. Posted 3/23/2006 at 3:10 am | Permalink

    for comment no: 12

    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.

    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.



  15. Amar
    Posted 9/4/2006 at 8:22 pm | Permalink

    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.

    [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/
    -r-x—— 1 amar amar 37 Sep 5 11:27 BookScripting/

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

    [amar@darkstar ~]$

  16. Divya
    Posted 10/20/2006 at 1:23 pm | Permalink

    quota -v

    Shows current disk usage and limits

  17. snark
    Posted 2/28/2007 at 2:04 am | Permalink

    Typical usage of route:

    /sbin/route -n:


  18. Smi
    Posted 3/28/2007 at 5:16 pm | Permalink

    whats the diff between mutex and semaphores ?

  19. ganesh
    Posted 3/17/2008 at 11:49 pm | Permalink

    where INODE will be stored?

  20. Posted 7/5/2008 at 11:57 am | Permalink

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

Post a Comment

Your email is never published nor shared. Required fields are marked *