You are on page 1of 18

c What is the booting process of linux systen and explain it,is the first process comes under

the installation process.

Answer: Booting Process:

1) BIOS: BIOS is the lowest level interface between computer and peripherals.

The BIOS performs integrity checks on memory and

Seek instructions on the Master Boot Record (MBR) on the floppy/HDD.

2) The MBR points to the boot loader (GRUB or LILO: Linux Boot Loader)

3) Boot loader (GRUB or LILO) will then ask for the OS label

Which will identify which kernel to run and where it is? located (Hard drive and partitioned)

4) The first thing the kernel does is to execute init

Program. init is the root/parent process to all processes in the Linux.

5) The first processes that init starts is a script

/etc/rc.d/rc.sysinit

6) Based on the appropriate run-level, scripts are executed

to start the various processes to run the system and make it functional.

or

As it turns out, there isn¶t much to the boot process:

1. A boot loader finds the kernel image on the disk, loads

it into memory, and starts it.

2. The kernel initializes the devices and its drivers.

3. The kernel mounts the root filesystem.

4. The kernel starts a program called init.

5. init sets the rest of the processes in motion.

6. The last processes that init starts as part of the boot sequence allow you to log in.

 How to shuffle the GRUB booting from one Disk to other?

Answer: grub> map (hd0) (hd1)

grub> map (hd1) (hd0), grub> boot

c

u How to hide the partition in GRUB booting? (This technique is required when you have more
that one Windows system on different partitions of the same disk, let us say the first and second
partitions of the first hard drive, to boot from the first partition you must hide the second one)

Answer: grub> unhide (hd0,0)

grub> hide (hd0,1)

grub> rootnovery (hd0, 0)

grub> chainloader +1

grub> makeactive

 how can i make an user to nologin without locking the account for the user?

Ans: Simply edit a line in /etc/passwd and chage user's shell to /bin/false(in case of ubuntu) or

/bin/nologin (incase of redhat or fedora)

 How to create secured appeche web server?

Ans: You need to install an SSL certificate in apache to secure

the transactions. Please follow the below link.

https://support.comodo.com/index.php?

_m=knowledgebase&_a=viewarticle&kbarticleid=264&nav=0, 96,1,88

 Linux system monitoring Tools?

Ans: 1 top - Process Activity Command , 2 ps - Displays The Processes

3 iostat - Average CPU Load, Disk Activity

4 vmstat - System Activity, Hardware and System Information

These are main monitoring tools,"Nagios" is also we can use

this is third party open source application software

 What is work of dns?

Ans: 1) Short for Domain Name System (or Service or Server), an

Internet service that translates domain names into IP addresses.

Because domain namesare alphabetic, they're

easier to remember. The Internet however, is really based on IP addresses.



†very time you use a domain name, therefore, a DNS service must translate the name into the
corresponding IP address. For example, the domain name www.example.com

might translate to198.105.232.4.

The DNS system is, in fact, its own network. If one DNS server doesn't know how to translate a
particular domain name, it asks another one, and so on, until the correct IP address is returned.

(2) Short for digital nervous system, a term coined by Bill Gates to describe a network of
personal computers that make it easier to obtain and understand information.

 †xplain about kernel file in linux?

Answer: Kernel is the core of the operating system .it interacts hardware of the computer

 What command would you use to find the hostname of the server if you only have the ip
address?

Answer: hostname -s this for hostname

c Difference b/w patches and packegs? and how to upgrade patches

Answer: Patches are software modules which are used to fix some existing bugs in the source
code. Mostly used in kernel, bootloader and other sources. Patches contain the difference
between the original source file and the modified source file. The command used to apply a
patch is

"patch -p1" in LINUX/UNIX. On entering this command you will be prompted to enter the path
for the file name in which the patch is to be applied. So enter the absolute path for the file name.

cc †xplain about kernel file in linux?

Ans: kernel is the core of the operating system .it interacts hardware of the computer

c What are the files to be used in the network installation of linux os?

Ans: /etc/sysconfig/network,/etc/resolv.conf,/etc/hosts

cu What is the command to see the installed rpm's in the linux system.

Ans: you can view the installed rpm in your linux box by :

rpm -qa | grep rpm name

c Please explain the file structure of linux?

Ans: root - The home directory for the root user

home - Contains the user's home directories along with directories for services

u

ftp, HTTP, samba, george

bin - Commands needed during bootup that might be needed by normal users

sbin - Like bin but commands are not intended for normal users. Commands run by LINUX.

proc - This filesystem is not on a disk. It is a virtual

filesystem that exists in the kernels imagination which is memory.

1 - A directory with info about process number 1.†ach process has a directory below proc.

usr - Contains all commands, libraries, man pages, games and static files for normal operation.

bin - Almost all user commands. some commands are in /bin or /usr/local/bin.

sbin - System admin commands not needed on the root

filesystem. e.g., most server programs.

include - Header files for the C programming language.

Should be below /user/lib for consistency.

lib - Unchanging data files for programs and subsystems

local - The place for locally installed software and other files.

man - Manual pages

info - Info documents

doc - Documentation

tmp

X11R6 - The X windows system files. There is a directory

similar to usr below this directory.

X386 - Like X11R6 but for X11 release 5

boot - Files used by the bootstrap loader, LILO. Kernel

images are often kept here.

lib - Shared libraries needed by the programs on the root filesystem

modules - Loadable kernel modules, especially those needed to boot the system after disasters.

dev - Device files

£

etc - Configuration files specific to the machine.

skel - When a home directory is created it is initialized

with files from this directory

sysconfig - Files that configure the linux system for devices.

var - Contains files that change for mail, news, printers

log files, man pages, temp files

file

lib - Files that change while the system is running

normally

local - Variable data for programs installed in /usr/local.

lock - Lock files. Used by a program to indicate it is

using a particular device or file

log - Log files from programs such as login and syslog

which logs all logins and logouts

run - Files that contain information about the system that

is valid until the system is next booted

spool - Directories for mail, printer spools, news and

other spooled work.

tmp - Temporary files that are large or need to exist for

longer than they should in /tmp.

catman - A cache for man pages that are formatted on demand

mnt - Mount points for temporary mounts by the system

administrator.

tmp - Temporary files. Programs running after bootup should

use /var/tmp.

º

15) How can i recover the linux system after it was crashed by step by step process..

Ans: All Machines crashed either due to hardware or software problem. We can trace out the
h/w failure as the BIOS or kernel will report that a device had failed or is missing. Knowing at
which stage of the boot process a failure occured is very important. If we get Kernel Panic †rror
it means (a) an incorrect root argument to the kernel (b) missing modules from the initial RAM
DISK. If problem occurs during file system mounting that means something wrong happen
during execution of /etc/rc.d/rc.sysinit (this script does a lot) Once system services began to
start the failure is most likely in /etc/rc.d/rc.sysinit

Check the log files /var/log/message and dmesg bcoz information gathering is very important to
trace the bottle neck of the issue.

16) What is the command for displaying, in which shell we are working.

Ans: finger -l.

17) how do display only hidden files in unix?

Ans: ls ±a | grep "^\."

18) how to find multiple string?

Ans: Use extended grep command

egrep 'searchstr1 | searchchstr2' file.txt

18) difference between nfs soft and hard mouniting points?

Ans: hard mount option: - If the client fails to access the servers, then connection hang it,
after the system up then it access the server.

Soft: - If the client failed to connect the server it immediately gives the error report, and close the
connection.

19) Without Using $date ±d yesterday. How I get the yesterday's date?

Ans: $date --date='yesterday'

$date --date='1 day ago'

20) what is the command for finding the highest memory occupied file in linux?

Ans: Top command will show the memory occupied by a file. When top is showing the output
press shift+m to show the file or process which is using larger memory.

21) What is the difference between NTFS & FAT File Systems?

Ans: Difference between NTFS and FAT32

Ñ

NTFS

1) allows access local to w2k w2k3 XP win NT4 with SP4 & later may get access for some file.

2) Maximum size of partition is 2 Terabytes & more.

3) Maximum File size is upto 16TB.

4) File & folder †ncryption is possible only in NTFS.

FAT 32

1) Fat 32 Allows access to win 95 98 win millenium win2k xp on local partition.

2) Maximum size of partition is upto 2 TB.

3) Maximum File size is upto 4 GB.

4) File & folder †ncryption is not possible.

22) How to set path and class path for java in linux

Ans: You can set as in windows, But this has to mention in some file which loads profile.

like /etc/bashrc (global)

~/.bashrc (private)

23) what is the command to uninstall processes in linux?

Ans: first find which package you want uninstall

than rpm -e send mail* (this is the package name)

or

yum e sends mail* (than package name)

or

Uninstall processes means to kill the processes. I think u have confused.

# kill -9 <pid>

pid: process id

#pkill <command name>

24) why LINUX is fast processing software and why it does not get viruses.

Ans: It does not get viruses because unlike windows, in linux each and every services,

o

files have different contexts. So for each one we have to write pgm to attack.

ex:

.for samba, samba_share_t

.for html, httpd_sys_t

*To know the contexts, run ll-Z

or

Reason for Fast:

†ach restart linux running defragmentation & scheduled FSCK

this is one of the reasons for fast & due to modular kernal

we no need to restart the system for while adding new

service/device/modules.

Reason for does not get virus:

In linux all are consider as file and files are not executing automatically. so not able to spread.

But if we fails to secure our system [physical/nw] hackers can schedule the script in cron.

26) what r the different command to check ram, process and hdd of linux machine

Ans:

RAM: We will check RAM, Process as well as HDD by the root user...

RAM: #free

#cat /proc/meminfo

Process: ps -a -> It will show running process within all terminals..

Hard Disk: #fdisk -l

25) If we transfer 100 files by ftp to remote server, how to know the files are successfully
transfer or some file are not transferred?

Ans: Wait up-to ftp transfer complete. Once completed, go to the

downloaded location in your system and use below command

³ls | wc -l "

Then compare with how many files originally needs to be transferred from ftp server.



if 100 = 100 then all transferred fine.

27) I know ssh, telnet, dns, apache all are worked on TCP/UDP but i want to know any one
service which are working on UDP only?

Ans: BOOTPS (67port number)

BOOTPC (68 port number)

belongs to DHCP

27) I want to see how many interfaces(†thernet cards) are working using single command?

Ans: ifconfig OR ifconfig -a

28) How to monitor ports in a linux machine, with single command?

Ans: #netstat -ant

29) Difference between swap partition and swap file?

Ans: Swap partition maintained separate partition. same swap partition can be used in two OS
within single machine. If system crashes their is a chance to recover itor may not

be corrupt the partition.

Less fragmented.

whereas swap file takes very less space. we can increase the space very easily, compared to
swap partition. Swap file system fragmented. If system crashes their is a huge chance to lost
the swap file system.

30) How can I know my linux os is 32 bit or 64 bit? and How can i know my CPU is 32 bit or 64
bit in linux machine environment?

Ans: To get a clear idea about you OS (32bit or 64bit)

you can use following command,

root@ganesh ~# file /usr/bin/file

/usr/bin/file: †LF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses
shared libs), for GNU/Linux 2.6.18, stripped

[root@ganesh ~]#

31) In my linux machine, i lost /etc/passwd file and /etc/shadow file, then how can i recover it?

Ans: # In that case you need to recover /etc/passwd file first.

For this you have to following steps,

ü

-Start GRUB on boot (press †SC while booting)

-Press e over (recovery mode)

-Press e over the line beginning with kernel

-Press Space bar and enter "init=/bin/bash"

-Press enter

-Press b

-At command prompt type: "cp /etc/passwd- /etc/passwd"

-reboot to GRUB again

-Press e over (recovery mode)

-Press e over the line beginning with kernel

-Press Space bar and enter "init=/bin/bash"

-Press enter

-Press b

-At command prompt type "mount -o remount,rw /"

-Type "passwd YOURUS†RNAM†H†R†" (IF you don't know your user

name type "ls /home" (that is a Lower case L and lower case

S) for a list of users)

-†nter new password at prompt

-reboot to normal boot.

Hope that helps others like it did me!

### Then to recover /etc/shadow file, Use following command pwconf

This command will generate /etc/shadow file from /etc/passwd

32) lost a root password and i need to give it, I treid to change it through single user mode

even though i am not get a password, then what is the other procedure to give a root password?

Ans: you need to check /etc/security file and u have check the permission this file

c 

33) A file which is not deleted by normal user and also root (using rm), for that type of file how
we delete it?

Ans: Using chattr command we need to change the attributes. and then normally remove
using rm command.

ex: chattr -iIu example

then rm -rf example

34) if i run ls command it will show me the junk output what is problem and how to resolve it

Ans: set your terminal setting by stty and before that export ls command to PATH variable

35) how nfs server works in linux.........please mention the nfs server working process

Ans: NFS is used to share a directory in a network of Linux machines.

configuration of NFS:

NFS S†RV†R:

yum install nfs*

vim /etc/exports -> press enter then type

/directory name *(rw, sync)

save -> wq

service portmap restart

service nfs restart

chkconfig portmap on

chkconfig nfs on

Another Linux PC:-

mount -t nfs (ip address of nfs server):/muj /opt

cd /opt

ls -> it will display all the content of the directory

36) what are the various backup tools available in linux

Ans: 1 AFBackup-Manager 2 afio 3 amanda 4 Arkeia 5 backupd 6 Bacula 7 BAR

8 BRU 9 BRU-Pro 10 Burt 11 cdbackup 12 cddump 13 CDTARchive or CDTAR

cc

or

backup tools

tar:

tar -cvf <filename.tar> files, directies

cpio:

find <pattern> | cpio -o -H tar -F <filename>

receiving: cpio -i -F <filename>

Dump:

dump -ouf /dev/sda1 /home

37) how many types of user accounts are available in linux os? if i assign a

uid below 500 to a normal user..wat wil be happened?

Ans: There are 3 types of user accounts in linux.They are:

1> System Users

2> Root User(Administrator)

3> Other Users(Normal User)

In linux, Uid from 1 to 500 has been reserved for system users, these are the default users of
linux, so if anyone try to assign Uid 500 to normal user then it wil give the error.

38) there are many IPC mechanisms available in Linux? Which one is best to use and when?

Ans: Amonog all the available IPCs, Shared Memory is the best and fastest one. We need to
use Shared memory when more than one proceses wish to communicate each other on a

common read-only memory. It is fast because it does not involve physical moment of data as
the data is shared among them.

Mutex/Semaphore is the best when a resource (including memory) is non-shared.

39) what is the use of nis server in linux? what is the purpose.........?

Ans: NIS stand for "network information system" the use of nis server centeralized
authentication of users.

c

40) why kerberos.............what its need

Ans: kerberos is one of the schemes of digital signature.it is used as an authentication scheme.
it is needed for the security of messages.

41) wat is the differences between scp and rsync in linux?

Ans: scp means source copying files

rsync means synchronization of directories to all over the network (give permissions like read,
write, execute)

42) what are acl permissions..? what is automation of jobs..?

Ans: acl- giving a file or permission explicitly regardless of the file owner and file group.

automation of jobs- daily or recurrent jobs can be scheduled to run at a particular time

at the intervals mentioned using crontab.

->list all jobs running crontab -l

->edit the crontab crontab -e

43) what is the difference between NIS and DNS...?

Ans: difference between NIS and DNS

NIS-

NIS stands for Network information services

NIS work is same as AD (active directory in windows)

NIS provide centralization of user it means when you

configure NIS server it's user can login anywhere in domain.

DNS-

DNS stand for Domain Name Server

DNS user for name resolution (ip to name and name to ip)

IN DNS name ip to name resolution happen in reverse

lookup zone and name to ip resolution happen in forward

lookup zone.

cu

44) cups stands for..?

Ans:

It is printer daemon

C - common

U - Unix

P - printing

S - system

45) what are the default permissions for files and folders..?

Ans:

By default it is 644 = file and 755 = dir, but when u create and file / dir that time the permission
of these decides by the value called Umask in your system

46) In how many ways linux can be installed n explain the steps involved in installation in any of
the method..?

Ans:

1) Text Based using CD or DVD ROM

2) GUI Based CD or DVD ROM

3) kick start method using (NFS, HTTP, FTP) via network

4) PX† boot method via network

47) commands regarding the adding of users into groups n different options with user add...?

Ans: usermod -G groupname username

48) what is NIS Server...?

Ans: stands for Network Information System, which provides any user on that network with

the same working environment irrespective of the system on that network which has been

used for the login purpose.

49) what are the different types of Backups..?

Ans: TAR - used for complete files or folders backup, and it uses the utilities gunzip and
bunzip2.

CPIO - used to backup the selected objects and it stands for copy in and out..

c£

DUMP - used to have the device back up. there are multiple backups in this such as

- full back up

- Incremental back up

- Differential back up

SSH - stands for secured Shell n used to connect remotely to corresponding computer n take
the back up...

50) what is the difference between the NFS and FTP?

Ans: FTP IS US†D FOR UPLOAD, DOWNLOAD & TRANSF†R FIL† BUT NFS IS

R†SPONSIBL† FOR SHAR† DATA & FIL† IN N†TWORK

51) What are the IPC techniques? explain each

Ans: IPC Techniques are mainly semaphores, message

queues, pipes, sockets, and shared memory.

1. semaphore is a synchronizing tool between the processes in sharing f resource.


2. it consists either 1 or 0 for allocating or deallocate a resource respectively.

2. message queue is a queue which is used by a process communication.

52) what is the difference between socket & port?

Ans: port: a particular port number on a host & socket: a host and a port

Like

-> http port = 80

-> when you fire up google.com

the socket on the server side is google.com:80 this is the server side socket

on your local system where you are browsing the socket is yourip: port above 1024

53) Why bind system call is required in socket programming? what is it¶s Significance?

Ans:

bind system call assigns a name to the unnamed socket. Binding an address allows a

process to register its address with the system. This makes it possible for other process to

find it.

cº

54) what is stored at /lib/modules?

Ans: It contains all the kernel modules that needed to be loaded into kernel (booting etc).

there will some .map, .dep (dependency files) files present.

When the kernel needs a feature that is not resident in the kernel, the kernel module daemon
kmod [1] execs modprobe to load the module in.

You can see what modules are already loaded into the kernel by running lsmod,

this gets its information by reading the file /proc/modules

55) what is stored in /proc? what is significance of /proc in linux?

Ans: Mainly hardware related information such as CPU information, Memory (RAM)
information stored under /proc directory

example:

# cat /proc/cpuinfo (show the information of CPU of that

particular hardware)

# cat /proc/meminfo (show the information of Memory i.e.

RAM of that particular hardware)

56) what are the different ways the Linux can switch from User Space to Kernel Space & vice-
versa?

Ans: There are 2 situations when Linux can switch from user Space to Kernel Space:-

1) by doing System calls

2) When interrupt comes (to handle interrupt)

Linux can switch from kernel Space to User space:-

1) process in kernel mode is preempted.

2) After completion of Interrupt handler / System call

57) What is difference between ext3 and ext4 file-system ?

Ans:

ext2: It was only the default file system upto 7.1 redhat version

->less speed, secure and doesn¶t supports journaling

ext3: this was from the 7.2 redhat version

cÑ

->more speed, secure n supports journaling compared to ext2

Journaling: This is one of the default features of ext3 which provides multiples functions like
data availability across improper shut downs, easy transmission between the file systems and
speed etc.

58) what kind of information the linux driver modules (.ko ) files has ?

Ans:

kernel 2.6 introduces a new file naming convention: kernel modules now have a .ko extension
(in place of the old .o extension) which easily distinguishes them from conventional

object files. The reason for this is that they contain an additional .modinfo section that where
additional information about the module is kept. Linux program modpost can be used to convert
.o files into

.ko files.

59) how to run the boot loader in the linux.......

Ans: #grubinstall /dev/hda or /dev/sda

60) what is mean by system calls?

Ans: A system call is the mechanism used by an application program to request service from
the operating system.

On Unix-based and POSIX-based systems, popular system calls are open, read, write, close,
wait, exec, fork, exit, and kill. Many of today's operating systems have hundreds of calls.
FreeBSD has about the same (almost 330).

Tools such as strace and truss report the system calls made by a running process.

61) What is the difference between pipe and xargs?

Ans: xargs command

Build and execute command lines from standard input

Find -type f -mtime -1 -print | xargs ls

Pipe is a technique to use for joining two/more commands (one command output as input to
other command .so on

| is a symbol for pipe) ls -al | more

62) A file has 1000 lines and i want to display only 1st line how to do it? pls ..tel me

Ans: cat filename | head -n 1 or sed -n '1p' or head -1

co

c


You might also like