Tanti Technology

My photo
Bangalore, karnataka, India
Multi-platform UNIX systems consultant and administrator in mutualized and virtualized environments I have 4.5+ years experience in AIX system Administration field. This site will be helpful for system administrator in their day to day activities.Your comments on posts are welcome.This blog is all about IBM AIX Unix flavour. This blog will be used by System admins who will be using AIX in their work life. It can also be used for those newbies who want to get certifications in AIX Administration. This blog will be updated frequently to help the system admins and other new learners. DISCLAIMER: Please note that blog owner takes no responsibility of any kind for any type of data loss or damage by trying any of the command/method mentioned in this blog. You may use the commands/method/scripts on your own responsibility. If you find something useful, a comment would be appreciated to let other viewers also know that the solution/method work(ed) for you.

Monday, 25 September 2017

Linux Interview Question & Answer part-1


1)  What is GRUB

Ans GNU GRUB is a Multiboot boot loader. It was derived from GRUB, the GRand Unified Bootloader, 
which was originally designed and implemented by Erich Stefan Boleyn.

Briefly, a boot loader is the first software program that runs when a computer starts. It is 
responsible for loading and transferring control to the operating system kernel software 
(such as the Hurd or Linux). The kernel, in turn, initializes the rest of the operating 
system (e.g. GNU)

2) Explain Linux Boot Process

Ans. Plz read our next blog to read boot process.

3) Which files are called for user profile by default when a user gets login

Ans $HOME/.bash_profile, $HOME/.bash_bashrc

4) Which file needs to update if srequired to change default runlevel 5 to 3

Ans File is /etc/inittab and required to change below lines:

id:5:initdefault: to id:3:initdefault:

5) What command used for showing user info like Login Name, Canonical Name, Home Directory,Shell etc..

Ans FINGER command can be used i.g; finger username


6) What is inode number

Ans An inode is a data structure on a traditional Unix-style file system such as UFS or ext3. An 
inode stores basic information about a regular file, directory, or other file system object

iNode number also called as index number, it consists following attributes:

File type (executable, block special etc)
Permissions (read, write etc)
Owner
Group
File Size
File access, change and modification time (remember UNIX or Linux never stores file creation
time, this is favorite question asked in UNIX/Linux sys admin job interview)
File deletion time
Number of links (soft/hard)
Extended attribute such as append only or no one can delete file including root user
(immutability)
Access Control List (ACLs)

Following command will be used to show inodes of file and folders:

ls -i

Following command will show complete info about any file or folders with inode number

stat file/folder

Files/Folders can also be deleted using inode numbers with following command:

find out the inode number using 'ls -il' command then run below command

find . -inum inode_number -exec rm -i {} \;

7) How can we increase disk read performance in single command

Ans blockdev command

This is sample output - yours may be different.
# Before test
$ blockdev --getra /dev/sdb
256
$ time dd if=/tmp/disk.iso of=/dev/null bs=256k
2549+1 records in
2549+1 records out
668360704 bytes (668 MB) copied, 6,84256 seconds, 97,7 MB/s

real 0m6.845s
user 0m0.004s
sys 0m0.865s

# After test
$ blockdev --setra 1024 /dev/sdb

$ time dd if=/tmp/disk.iso of=/dev/null bs=256k
2435+1 records in
2435+1 records out
638390272 bytes (638 MB) copied, 0,364251 seconds, 1,8 GB/s

real 0m0.370s
user 0m0.001s
sys 0m0.370s

8) .... command to change user password expiration time

Ans CHAGE

9) Command used to lock user password

Ans usermod -L username

10) How many default number of Shells available and what are their names?

Ans SH, BASH, CSH, TCSH, NOLOGIN, KSH

11) Which file defines the attributes like UID, PASSWORD expiry, HOME Dir create or not while 
adding user

Ans /etc/login.defs

12) ...... command used for changing authentication of linux system to LDAP/NIS/SMB/KERBOS

Ans authconfig

13) ...... command used for changing the attributes of any file

Ans chattr

14) What is the path of network (ethX) configuration files

Ans /etc/sysconfig/network-scripts/ethX

15) How can we change speed and make full duplex settings for eth0

Ans We can do this with below given 2 methods:

ethtool -s eth0 speed 100 duplex full
ethtool -s eth0 speed 10 duplex half

OR

mii-tool -F 100baseTx-HD
mii-tool -F 10baseT-HD

16) File which stores the DNS configuration

Ans /etc/resolve.conf

17) Main configuration file and command used for NFS enabling exported directories and deamons

Ans /etc/exports and exportfs -av , deamons are quotad, portmapper, mountd, nfsd and nlockmgr/status

18) What is command to check ports running/used over local machine

Ans netstat -antp

19) What is the command to check open ports at remote machine

Ans nmap

20) What is the difference between soft and hard links

Ans Soft Links => 1) Soft link files will have different inode numbers then source file
2) If original file deleted then soft link file be of no use
3) Soft links are not updated
4) Can create links between directories
5) Can cross file system boundaries

Hard Links => 1) Hard links will have the same inode number as source file
2) Hard links can not link directories
3) Can not cross file system boundaries
4) Hard links always refers to the source, even if moved or removed

No comments:

Post a Comment