Linux Frequently Asked Interview question From Google IBM HCL Infosys

what is Partition Tool in all the Linux Distribution
fdisk, using fdisk command we can make the partition table.

How to view the boot message
/var/log/messages File
#dmesg using these these command we can see the boot messages
/var/log/lastlog file contain Information about the used defined passwd in the last logged.
/var/log/httpd/error_log httpd log file
/var/log/httpd/access_log >>Httpd Access Log

How to set the DHCP range 192.168.1.2 to 192.168.1.20
not include 192.168.1.4,  192.168.1.7,   192.168.1.10
subnet 192.168.1.0 netmask 255.255.255.0
{
range 192.168.1.2 192.168.1.3;
range 192.168.1.5 192.168.1.6;
range 192.168.1.8 192.168.1.9;
}
How to delete the user Home Directory
#userdel -r username
It will delte the user and there user home directory

How to create the user with Home Directory
#adduser -m username
it will create the user with home directory

How to change the username
#usermod -l newusername oldusername

Several user want to schedule the at job at peak time , How can we prevent user schedule the job.
In server Load is too high, How can we avoid the user to schedule job at these time
Remove /etc/at.deny file
Then only superuser they can schedule the job.

What are the two utilities can be used to schedule the job
at and crontab

we are haveing the two IDE drive we plan to make the Two partition For each device
what will be the name of the device
hda1,hda2, First IDE device Two partition
hdb1,hdb2 Second IDE device Two partition

what is xinetd service
xinetd it is exted Internet Daemon.
it will maintain the Internet based connectivity.
xinetd it is only responsible daemon to listen the port number which are service listed under /etc/xinetd.conf or /etc/services.
It will maintain the Internet related service.
ftp,telnet,nagios,


How to use awk Command
[root@unix ~]#ls -l
total 8440
-rw-r--r-- 1 root root 19 Oct 12 16:31 1
-rw-r--r-- 1 root root 19 Oct 12 16:31 default.php
-rw-r--r-- 1 root root 20 Oct 12 16:16 file
-rw-r--r-- 1 root root 14 Oct 12 16:26 index.hp
[root@unix ~]#ls -l | awk '{ print $3 } ' >> It will display only the thrid parameter
root
root
root
root
nagios

Difference Between du and df Command
df - display free disk space
#df bin/
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 10321208 1732180 8064740 18% /
#df tmp/
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 10321208 1732188 8064732 18% /
df command It will display the free disk space for the particular directory and it shows where it is mounted
#df -h bin/ >> -h refres to the Human Readable form
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 9.9G 1.7G 7.7G 18% /

How To Check The Maximum File size For current directory - Disk Management
du - display free disk usage
du -h >> List out the all the directory of File System
#du -sh >> Total size of the current directory
1.6G .
#du -sh * >> list only the current directory & separate files
5.6M bin
156K boot
40K dev
13M etc
40K home
du -sh /home/* >> list only from the /home directory
How to Check the Maximum File Size under Current Directory
du -h
du -sh >> Total l size of the current rectory
du -sh * >> list only the current directory
du -sh /home/* >> list only from the /home directory
-h Human Readable Form
-s Summary

#du -sm * | sort -nr | head -1
29 nagios-3.2.1

What are the shutdown command Different Option
shutdown -r is used to restart the system,
shutdown -f restart the sytem fast skiping fsck, -F Force to fsck on reboot
shutdown -h halt the system after shutdown.
shutdown -h now "message"
shutdown -h hh:mm "message"
To restart the system
shutdown -r now "message"
shutdown -r +10 "message"
reboot,shutdown -r, init 6 using the command we can restart the system.

Which daemon is responsible for tracking the log files
syslogd daemon is responsible for tracking system information and saving to specified log files

what command has been used to check the no of files and disk space used in the each user quota
repquota using repquota command we can check the no of the files and dispace space

what command is used to find in which shell we are working
[root@nagm ~]#echo $SHELL
/bin/bash

How To create The RAID level 5
#madam -c /dev/md0 yes -l 5 -n 3 /dev/{hda1,2} >> create
#madam -D /dev/md0 >> Display infromation
create the file system
mkfs.ext3 /dev/md0
mkdir /tags
mount /dev/md0 /tags

What is Linux
Linux it is only kernal.
Combine with Gui mode it will form OS.
Linux is developed by the source code of unix kernel

What is NIS
NIS in windows called Active Directory.
we can create the user in NIS server and we can use the user in anywhere in the domain
nis it is provide the centralization of user it refers to the configure the nis server and add the user and these user can login in anywhere
kerberos it is digital Signature,
it is used for authentication scheme.
it is used to send the data form the one system to another system in encrypted data.

what is ldd
linux digital driver

what is zombie process?
zombie is inactive process:The Process ids dead but it have not been removed from the process table.Zombie process in the other words it is complete the process execution but still entry in the process table.zombie process it is already dead, but it is waiting for parent process to reap them.zombie it is derives form the definition zombie - undead person.
to kill these process kill.
zombie process can be identified by z form the output of ps command.
it can be killed by kill -9 and kill -15.


How To Identify Zombie Process
#ps -el | grep 'z'

How to kill zombie Process
If the process can not be kill directly by the kill -9 or 15 [what is reason - child process is created by parent process but the parent process will leave it,] So we need to send the signal to the process
#kill -s SIGCHLD [process id]
-s send the signal to the process.

what is CUPS
Common UNIX Printer System
it is provide the printer service to the Linux system.


Copy File using Scp From One Remote Machine to Another
Using SCP We Can Transfer File
Remote system >> Local Systemscp
#root@67.228.6.3:/script/script.tar /home/centos
Local System >> Remote System
#scp /home/centos/script.tar root@67.228.6.3:~
Remote System >> Local System

How To Compress File
#tar -cvf destion.tar /sourcefile

How to uncompress file
tar -xvf <filename>
bunzip2 <filename>
gunzip <filename>
unzip <filename>

Related post