Linux General

  Home  Operating System Linux  Linux General


“Linux General frequently Asked Questions in various Linux General job Interviews by interviewer. The set of Linux General interview questions here ensures that you offer a perfect answer to the interview questions posed to you. Get preparation of Linux General job interview”



25 Linux General Questions And Answers

2⟩ What is kernel parameters? where its located and how would you find it?

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:

 143 views

3⟩ How to find out shared file&dir of FTP?

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.

 140 views

4⟩ What is block device and character device?

$ 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

 135 views

5⟩ How many types of user accounts are available in Linux OS?

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.

 165 views

6⟩ How nfs server works in Linux.........please mention the nfs server working process?

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

 146 views

7⟩ What is the difference between samba and ftp server in Linux?

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.

 131 views

9⟩ What is the use of nis server in Linux?

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.

 145 views

12⟩ What is the command to see on which port whichservice is running? and What is the difference between /etc/services file and net stat command?

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.

 155 views

13⟩ What is the differences between scp and rsync in Linux?

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

 150 views

14⟩ Is it possible to break the grub password in Linux?

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

your Linux OS in the usual manner

 152 views

15⟩ What is difference between ext3 and ext4 file-system?

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...

 144 views

19⟩ What are the main diff between NFS and Samba Servers?

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.

 142 views

20⟩ What is the main difference between Yum & rpm?

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.

 129 views