Linux Tricks and Techniques

For Linux Experts

Use the website for easy leaning of Linux

Saturday, 6 August 2016

UNIX/Linux – Basics Interview Questions

UNIX/Linux – Basics Interview Questions 

Image result for interview

1. What is an Inode?

It is a data structure in a File system, which has all information about a file, except its name and the actual data.

2. The difference between hard links and soft links?

Hard link is an entry in the directory that contains a pointer to the inode bearing the file’s metadata. It can not span across FS.

Soft link creates a pointer to a file name (path). Symbolic link can span file systems. Symbolic links can point to directories as well.

3. How to create Hard links and Soft links?

a. H/L - lnsource_filedestination_file

b. S/L - ln –s source_filedestination_file

4. What is device files?

Is the files which allows programs to access the hardware.

5. What is major and minor numbers of a device file?

Major number is associated with the kernel driver for the device.

Minor number uniquely identifies the device based on the device connectivity.

6. What you mean by character and block devices? Give examples for each.

Block devices are used for accessing blocks of data together.

Character devices are used to access data character by character.

Eg : Hard disks,

: Mouse

7. Why do you need backup of data? What are the commands or tools you used for backup?

8. How do you take a backup using tar command? How to append data to the same media? How to perform restore of a single file from the tar backup? How do you verify whether the backup has been successful?

Tar –cvf (what does v anf f stands for?)

Tar –rvf

Tar –xvftar_archivefile_name_tobe_restored.

Tar –tvftar_archive.

9. What is rc scripts. How do you impart a custom rc script?

Hardware Awareness

1. Which all hard wares you worked with?

2. Have you worked on any Blade servers? Which models?


1. Which are the files to be modifiedto change the hostname without rebooting the system.

#vi /etc/hosts

#vi /etc/nodename

#vi /etc/hostname.hme

#vi /etc/net/ticlts/hosts

#vi /etc/net/ticosts/hosts

#vi /etc/net/ticotsord/hosts

2. Is there any difference between init1 and init s. What is the difference?

If you switch from multiuser mode to init s and switch it back to multiuser mode.then remote useres automatically reconnects to the system.where as in the case of init 1. they have to reconnect manually means they have to relogin

3. Explain RAID0, RAID1, RAID5,

RAID 0 Concatenation/Striping

RAID 1 Mirroring

RAID 5-Striped array with rotating parity.

4. If one of the root disk under mirrored SVM fails and you have to reboot the system, would the system reboot without any error ?

This is one of the most common question asked on SVM. Now in case of losing any state database replica (metadb) SVM determines the valid state database replica by using majority consensus algorithm. According to the algorithm it is required to have atleast (half + 1) to be available at boot time to be able to consider any of them to be valid. So in our case we if we had 6 metadb in total (3 on each disk), then we would need atleast 4 metadbs to be able to boot the system successfully, which we do not have. Hence we can’t boot the system.

To avoid this we need to add one entry in the /etc/system file to bypass the majority consensus algorithm. This enable us to boot from a single disk, which may be the requirement in many cases in production like patching the system etc. The entry is :

setmd:mirrored_root_flag = 15.

5. how to remove a metadevice ?

The metadevice can be removed if they are not open (i.e. not mounted):

# metaclear d3

To delete all the metadevices (use it carefully as it blows away entire SVM configuration):

# metaclear -a -f

6. How to extend a metadevice ?

To grow a metadevice we need to attach a slice to the end and then grow the underlying filesystem:

# metattach d1 c3t1d0s2

If the metadevice is not mounted :

# growfs /dev/md/rdsk/d1

-If the metadevice is mounted :

# growfs -M /export/home /dev/md/rdsk/d1

7. How geo cluster is working?

8. Pre-requisites for Sun cluster

9. How you will assign quorum device on the cluster?

10. Minimum requirements for configuring database backup on oracle secure backup(OSB)?

11. How OSB performing database backup?

12. Difference between Sun cluster and VCS?

13. Difference between STK 6140 and 6180?

14. Features of SPARC T Series and how it differ from VMWare?

15. What is the processor available on T-Series Server?

16. How many threads(minimum) are required to configure LDOM?

17. what are the Modules available on M5000?

18. How many domains are supported on M5000?


1. Version of oracle db you worked with?

2. What are the main components of oracle dbms?

3. What is SGA and PGA?

4. How do you enable archivelog mode on a DB?

5. What are the steps involved in configuring RMAN backups?

6. What is a DB instance? – will containg all the resources for running datbases like memory..

7. How do you recover a crashed DB?


1.What command is used to count the total number of lines, words, and characters contained in a file?

Ans. # wc<filename> ------ command will show the no.oflines,words,characters

2.What is network bonding ?

Ans. Network Bonding is creation of a single bonded interface by combining 2 or more Ethernet interfaces. This helps in high availability of your network interface and offers performance improvement.

3.Explain sticky bit ?

Ans. Sticky bit is a permission bit that protects files with in the directory. If a directory has the sticky bit set files inside that directory can be deleted only by the owner or root user, even if other users having write permission.

Sticky bit can be set by the command

#chmod +t <Dir name>


#chmod 1777<Dir name> ---- 1 indicates sticky bit set

4. Tell any command to find out how long the system has been running(up)?

Ans. # uptime

Ans. # w

Ans. # top

5.What is selinux and what are the three modes it operates?

Security-Enhanced Linux is a Linux kernel security module. It provides the mechanism for supporting access control security policies.

The three operating modes of selinux are

Enforcing: SELinux policy is enforced. SELinux denies access based on SELinux policy rules.

Permissive: SELinux policy is not enforced. SELinux does not deny access, but denials are logged for actions that would have been denied if running in enforcing mode.

Disabled: SELinux is disabled.

6.How to schedule a job in linux ? What are the crontab fields?

Ans. cron and at are job schedulers in linux

Crontab fields

1 Minute

2 Hour

3 Day of the month

4 Month of the year

5 Day of the week

6 Command

7.Command to list and Flush all iptables rules

Ans.#iptables –list or iptables -L

Ans.#iptables –flush or iptables -F

8. which is the configuration file of NFS server? What is the command to Show the NFS server’s export list?

Ans. /etc/exports

Ans.Showmount –e <ipaddress of NFS server>

9.what is zombie process ? How do you identify Zombie process in the output of ps command ?

Ans. Zombie process is a process state when the child dies before the parent process.In this case the structural information of the process is still in the process table

Ans. Zombie processes can be identified in the output of ‘ps’ by the presence of ‘Z’ in the STAT column.

10.what is umask ?default umask for root user ?

Ans. UMASK(User Mask or User file creation MASK) is the default permission or base permissions given when a new file is created on a Linux machine.

Ans. 022 is the default umask value for root user

The minimum and maximum UMASK value for a folder is 000 and 777

The minimum and maximum UMASK value for a file is 000 and 666

11. What is the use of sosreport tool?

Ans. The sosreport command is a tool that collects configuration and diagnostic information from a Red Hat Enterprise Linux system.For instance the running kernel version, loaded modules, and system and service configuration files.

To run sosreport the sos package must be installed.

12.How to configure ssh password less login into remote machine ?


Step 1: Create public and private keys using “ssh-key-gen” command on local-host

Step2:Copy the public key to remote-host using “ssh-copy-id” command

#ssh-copy-id -i ~/.ssh/ remote-host

ssh-copy-id appends the keys to the remote-host’s .ssh/authorized_key

Step 3: Login to remote-host without entering the password

13. What command do you run to check file system consistency under UNIX or Linux?

Ans. You need to run fsck [file system consistency check] command to check file system consistency and repair a Linux / UNIX file system

Sequence running fsck command

a.) Goto single user mode:

# init 1

b) Unmount file system (for example /dev/sdb1)

#umount /dev/sdb1

c) Now run fsck command:

# fsck /dev/sdb1

d) Now mount filesystem

#mount –a

e)Go back to the multiuser mode

#init 3

Server Virtualization Questions?

1. What are virtualization products you worked on?

2. Which version of VMWare have you worked on?

3. What are the major differences of 5.5 from previous versions?

4. Could you explain the architecture of ESXisystem.

5. What is vMotion& storage vMotion?

6. What is DRS and how does it work? What are the pre-requisites for configuring DRS.

7. What is the importance of resource shares, how does it work?


No comments:
Write comments