Online Learning Academy -

... Sharing Knowledge

  • Increase font size
  • Default font size
  • Decrease font size

3. Unix Interview Questions

E-mail Print PDF

Unix Interview Questions:

1. whats $# in a shell script
2. whats a $* in shell script
3. Explain nohup with an example
4. If $1 is the first parameter, whats $0
5. How do you see the return code of the last executed command
6. Explain Cron with an example
7. what is rsync
8. Whats the advantage of using ssh over telnet?
9. Have you used vi? provide example of searching an expression across multiple files (say *.sh) from within vi
10. How can i find all /tmp/*.zip and move them to, say, /home/to_examine (assuming the target already exists?)
11. Whats the kill command used for? Whats the difference between kill and kill -9
12. Whats the "nice" command used for
13. Provide a regular expression for searching email addresses within a script file

UNIX Commands Interview Questions with Answers

E-mail Print PDF

1. Construct pipes to execute the following jobs.

  • Output of who should be displayed on the screen with value of total number of users who have logged in displayed at the bottom of the list.
  • Output of ls should be displayed on the screen and from this output the lines containing the word ‘poem’ should be counted and the count should be stored in a file.
  • Contents of file1 and file2 should be displayed on the screen and this output should be appended in a file. From output of ls the lines containing ‘poem’ should be displayed on the screen along with the count.
  • Name of cities should be accepted from the keyboard . This list should be combined with the list present in a file. This combined list should be sorted and the sorted list should be stored in a file ‘newcity’.
  • All files present in a directory dir1 should be deleted any error while deleting should be stored in a file ‘errorlog’.

2. Explain the following commands.

$ ls > file1


1. UNIX - LINUX Interview Questions and Answers

E-mail Print PDF

UNIX - LINUX Interview Questions and Answers :

1. How are devices represented in UNIX?

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).

2. What is 'inode'?

All UNIX files have its description stored in a structure called 'inode'.

Last Updated on Tuesday, 10 May 2011 18:01

What about the directory representation in UNIX?

E-mail Print PDF

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).



What is 'inode'?

E-mail Print PDF

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
  • «
  •  Start 
  •  Prev 
  •  1 
  •  2 
  •  Next 
  •  End 
  • »

Page 1 of 2
Follow us on Twitter

Main Menu




Interview Questions






Graduate Courses


Feed Burner

Subscribe to Welcome to Online Learning Academy by Email

Enter your email address:

Delivered by FeedBurner

Google Groups
Subscribe to LearnAcad
Visit this group

Login Form