Top Most Linux General Interview Questions
Q – 1 How is FAT32 file system mounted in Linux file system?
Ans- 1: mkdir /kaka
2: open vim /etc/fstab and mount it permently.
3: mount -t vfat /dev/hda1 /kaka
4: /dev/hda1…… drive name.
Q – 2 Is it possible to install Linux RHEL5 os along with fedora14 Linux os in one system?
Ans- yes we can but why to do that fedora is made up of red hat so there is no such difference between them
Q – 3 What is the detail boot process in Linux? Start form Pc on?
Ans- Once system powered on, first thing will be POST check i.e power on self test.
Then BIOS loads the MBR from the disk into RAM. Then, the BIOS executes the MBR code. now boot loader list the number of OS installed in to the system. select the OS wants to be boot once OS selected initial RAM disk (temporary root file
system) are loaded into memory. When the images are loaded, the boot loader passes control to the kernel image and the kernel is decompressed and initialized.
At this stage, the boot loader checks the system hardware, enumerates the attached hardware devices, mounts the root device, and then loads the necessary kernel modules.
When complete, the first user-space program (init /sbin/init) starts, which will looks file /etc/inittab to find the which runlevel kernel will be boot then it will be check /etc/rc?.d (? means runlevel got from inittab file)and check every script which starts with name S will start in to that level once completed, initrd(temporary root file system) will be
unmounted and mount the physical filesystem and loads the main kernel then login prompt will be available.
Q – 4 How to install Linux OS along with fedora 14 OS in one System?
Ans- We can make free space in hard disk and install new OS in that free space. Another way can be by installing Vm Manager an then
installing new OS on it.
Q – 5 Explain Linux file types?
Ans- 7 types of files
– regular
d directory
l symbolic link
c character special file (hardware files)
b block special file (files to communicate with hardware )
p named pipe (to pass data between process )
s socket ( mechanism for inter-process communication
Q – 6 What is the main difference between Yum & rpm?
Ans- rpm is packagemanager while yum is a frontend,rpm can be installed with the help of yum RPM Package Manager” (formerly “Red Hat Package Manager”), and YUM, “Yellow dog Updater, Package Management System Installer
Typically part of the operating system.
Each product comes bundled with its own installer. Uses a single installation database. Performs its own installation, sometimes recording information about that installation in a registry.
Can verify and manage all packages on the system. Only works with its bundled product. Single package management system vendor. Multiple installer vendors. Single package format. Multiple installation formats.
Q – 7 What are the main diff between NFS and Samba Servers?
Ans- The difference between Samba and NFS is primarily that Samba uses the SMB (aka Lanmanager) protocol which is considered “standard” for PCs (Windows and OS/2 both have built in support for it, a free client is also available for DOS, I’m not sure about MacOS), whereas NFS uses its own protocol (usually just called “NFS”) which is not commonly available for PCs (NFS clients do exist for operating systems other than UNIX/Linux, but they’re usually neither free or easy to setup).
Samba’s SMB protocol allows the server machine to handle authentication, so it can decide what files the client has access to based on the particular machine and user connecting. NFS by default trusts all client machines completely (it’s really not intended to share files to unsecured workstations) and lets the client machines handle authentication all on their own (once an NFS server has been told to accept connections from a client machine the client does not require any further server-side authentication, and
can do anything it wants with the filesystem NFS gives it access to).
SMB does not (directly) support UNIX style file permissions, so it is probably a bad idea to routinely use it to map filesystems between machines which expect this information to be present and mutable, NFS of course supports all
standard UNIX file information (this also means that SMB is fine for accessing a UNIX filesystem from a Windows machine,
but not so hot the other way around).
Network File System (also known as NFS) is a protocol developed by Sun Microsystems. It allows a user on a computer to access files that are sent across a network – similar to the way one accesses local storage.
It is most common in systems with a similar composition to the UNIX system Samba is a re-implementation of SMB/CIFS networking protocol (meaning a re-imaging of Server Message Block – or Common Internet File System). As with the NFS, Samba runs most
naturally on a system with qualities not unlike those of the UNIX systems.
It comes standard with almost every distribution of Linux, and is used as a basic system service on all other UNIX-based systems.
a. NFS is a protocol that allows a user to access files over a network; Samba is essentially a re-imaging of the Common Internet File System.
b. NFS has four versions, the newest of which includes a stateful protocol; Samba has multiple versions, the latest of which allows file and print sharing between multiple computers.
Q – 8 A system has four NI cards , how do you find out that a particular NI card is faulty without going to the sever?
Ans- ifconfig -a|grep
Q – 9 How to open Microsoft word document,power point etc. on Linux suse version and vise versa?
Ans- try openoffice
Q – 10 Can we open pdf files in suse?
Ans- We can open .pdf file with the help of CUPS-PDF package.
Install CUPS-PDF package and use pdf file.
Q – 11 What is difference between ext3 and ext4 file-system?
Ans- ext2 : It was only the default file sysyem upto 7.1 redhat
version
->less speed,secure and doesnt supports journaling
ext3 : this was from the 7.2 redhat version
->more speed,secure n supports journaling compared to ext2
Journaling : This is one of the default feature of ext3 which provides multipls functions like data avaliability across improper shut downs,esay transmission between the file systems and speed etc…
Q – 12 Is it possible to break the grub password in Linux?
Ans- Yes surely we can remove the grub password by booting the linux server in rescue mode edit the grub.conf file
Method 1
I)chmod /mnt/sysImage
ii)Edit the grub.conf file and remove the passwd line from
the file. Save the file and exit change the password md5 in
the grub line and set your own password.
iii)Once your machine reboots, you will be able to start
Q – 13 What is the differences between scp and rsync in Linux?
Ans- scp- copying files using ssh(secure copy) of the selected files from the source host to destination host and when finished closes the scp application rsync- you need to setup the key authentication between the servers that do the synchronization (to destinatio system to have the source public key in destination host’s authorized_keys) and copies the files from source to destination whenever there is a change(addition/deletion) in the sounce directory .. can be pull/push/both
Q – 14 What is the command to see on which port which service is running? and What is the difference between /etc/services file and net stat command?
Ans- i)which port which service is running netstat -tulpn lists all the processes running,the service name with the upd or tcp port, and the socket information
ii)/etc/services is the general port numbers and the serices that are associated with the ports where are netstat shows the running serviced,ports,the application name associated and the socket info too.
Q – 15 In /etc/fstab, wat is the meaning of defaults word and 0 0 indicates which options?
Ans- it indicate that the partion is being used by system.
Q – 16 Is it possible to reduce the size of a already created partition?
Ans- yah it is possible to reduce the size of already created partition ……by LVM reduce ok
Q – 17 What is the use of nis server in Linux?
Ans- The main purpose of NIS is centralizing the authentication database.
For ex:
Usually when a user try to login to the machine it will contact the passwd, shadow and group files for user’s authentication, in case of user requires to access his/her account across the network we need to update users information all these files in each machine in the network.
It is bit tricky to organize multiple users’ info in all the machines in the network.
NIS server will act as central server for user authentication and all other machines will contact the NIS server for the user’s authentication info.
Make sure all the machines in your network should be in the same domain. NIS will work only in single domain.
Q – 18 Why kerberos………….what its need?
Ans- kerberos is one of the scheme of digital signature.it is used as an authentication scheme.it is needed for the
security of messages.
Q – 19 What is the difference between samba and ftp server in Linux?
Ans- SAMBA SERVER :-samba is an application is used to integrate Linux system into windows it mostly commonly used in file
server for windows machines.
ex:- we can share a directory or file from Linux machine to windows machine or you can share same directory from Linux
machine to Linux machine.
FTP SERVER :-ftp server is used to share a directory in a network of Linux machine only.
Q – 20 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 SERVER:
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 (ipaddress of nfs server):/muj /opt
cd /opt
ls -> it will display all the content of the directory
Q – 21 How many types of user accounts are available in Linux OS?
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.
Q – 22 What is block device and character device?
Ans- $ ls -altr /dev/
brw-rw—- 1 root disk 8, 6 2010-07-26 14:20
sda6 –> block device
crw-rw—- 1 root root 10, 59 2010-07-26 14:21 device-
mapper –> character device
Answer :
Character devices deal with IO on a character by character basis. The most obvious example is a keyboard, where every key generates a character on the device. The mouse is another. Every motion or button click sends a character to the /dev/input/mouse0 device. To test it out do $cat /dev/input/mouse0 , then move your mouse (see what happens)
Block devices read data in larger chunks or blocks. Data storage devices, such as IDE hard drives (/dev/hd), SCSI hard drives (/dev/sd), and CD-ROMs (/dev/cdrom or /dev/sr0) are block devices. IO interactions with block devices transact with chunks of data (blocks), which allows large quantities of data to be moved back and forth more efficiently(unlike character device). eg: $df -h
Generically, block devices can be mounted and are cached, and char devices are for communication devices, aren’t cached nor block aligned, and can’t be mounted.
Specifically, /dev/scd* (block) are for cdroms, providing the block access and commands for ejecting, closing, playing, etc.
The corresponding character device for the cdrom is /dev/sg1
Q – 23 What is kernel parameters? where its located and how would you find it?
Ans- Linux is a parameter driven system. Kernel parameters used for system configuration are found in /proc/sys/kernel, where
you will find an individual file for each configuration parameter.
Because these parameters have a direct effect on system performance and viability, you must have root access in order to
modify them.
Occasionally, a prerequisite to a package installation requires the modification of kernel parameters. Since each parameter file contains a single line of data consisting of either a text string or numeric values, it is often easy to modify a parameter by simply using the echo command:
echo 2048 > /proc/sys/kernel/msgmax
The aforementioned command will set the value of the msgmax parameter to 2048.
Linux also provides the sysctl command to modify kernel parameters at runtime. Sysctl uses parameter information stored in a file called /etc/sysctl.conf. If, for example, we wanted to change the value of the msgmax parameter as we did above, but this time using sysctl, the command would look like this:
Q – 24 How to find out shared file&dir of FTP?
Ans- we need to use the command #ftp server name in he client machine then it asks user name and password ,for user name use anonymous and password is empty .then it takes it to FTP> mode in that type ls . it shows what are the files shared via FTP in that particular server.if we want to see
which are the files shared via FTP in the client use FTP>!ls.
Q – 25 Which type of application can be run on Linux? and explain what it the use of that?
Ans- Every type of applications can be run on Linux, which are run on other OS like Microsoft, Apple & so on. all applications of desktop or server related are run according to flavor of that Linux.