1) What Can You Type At A Command Line To Determine Which Shell You Are Using?

Ans:      echo $SHELL.

2) What Command Is Used To Remove The Password Assigned To A Group?

Ans:      gpasswd -r.

3) What Are Lvm1 And Lvm2?

Ans:      LVM1 and LVM2 are the versions of LVM.

LVM2 uses device mapper driver contained in 2.6 kernel version.

LVM 1 was included in the 2.4 series kernels.

4) What Command Should You Use To Check The Number Of Files And Disk Space Used And Each User’s Defined Quotas?

Ans : repquota

5) What Is Lvm?

Ans: LVM stands for Logical Volume Manager. LVM, is a storage management solution that allows administrators to divide hard drive space into physical volumes (PV), which can then be combined into logical volume groups (VG), which are then divided into logical volumes (LV) on which the filesystem and mount point are created.

6) What Is The Standard Directory Used To Store User Html Website Files? 

Ans: The standard directory is /var/www/html.

7) What Type Of Remote Software Can You Use To Encrypt Communication But Control Your Server?

Ans: SSH is a remote desktop software that lets you remotely control the Red Hat server using a command line but also encrypts the information across the Internet. SSH uses port 22, so you must open this port when you set up Red Hat.

 8) When You Install Apache, What Is The Default Web Port Used To Serve Web Pages To Public Viewers?

Ans: Most web servers run on port 80, and Apache defaults to port 80 when you install the software. You can use an alternative port, but this forces the user to type a port into the browser when they access the website. The other popular port for web applications is port 8080.

9) What Is The Total Number Of Primary Partitions You Can Have On One Drive In Linux Red Hat?

Ans: you can have four primary partitions in Linux.

 10) What Is Red Hat Network?

Ans: A systems management platform providing lifecycle management of the operating system and applications.

    1. Installing and provisioning new systems.
    2. Updating systems.
    3. Managing configuration files.
    4. Monitoring performance.

11) Which daemon tracks events on your system?

Ans: The syslogd daemon tracks the system information and saves it to specified log files.

 12) You are logged on as a regular user. Without logging off and logging on as root, you are required to create a new user account immediately. How would you do it?

Ans:     

This can be achieved by issuing the su command.
– This will prompt you for the password of the root account.
– Providing the password, logs you in as root. Now, you can perform any administrative duties

13) What is the name and path of the main system log?

              Ans: The main system log is ‘/var/log/message

14) What is BASH?.

Ans : BASH is a short form of Bourne Again SHell. It was a replacement to the original Bourne shell

15) What is Swap Space?.

Ans: Swap space is used to specify a space which is used by Linux to hold some concurrent running program temporarily. It is used when RAM does not have enough space to hold all programs that are executing.

16) What is the maximum length for a file name in Linux

Ans: 255 characters

17) What are the default ports used for SMTP,DNS,FTP,DHCP,SSH and squid ?

Ans:

SMTP          25
DNS            53
FTP             20 (data transfer) , 21 ( Connection established)
DHCP         67/UDP(dhcp server) , 68/UDP(dhcp client)
SSH            22
Squid         3128

18) How to check default route and routing table ?

Ans: Using the Commands ‘netstat -nr’ and ‘route -n’ we can see the default route and routing tables.

 19) How to check which ports are listening in my Linux Server ?

Ans: Use the Command ‘netstat –listen’ and ‘lsof -i’

20) How to upgrade Kernel in Linux ?

Ans: We should never upgrade Linux Kernel , always install the new New kernel using rpm command because upgrading a kenel can make your linux box in a unbootable state.

rpm -ivh Kernel

or

yum install kernel

21) How to add & change the Kernel parameters ?

Ans: To Set the kernel parameters in linux , first edit the file ‘/etc/sysctl.conf’ after making the changes save the file and run the command ‘sysctl -p’ , this command will make the changes permanently without rebooting the machine

22) What is load average in Linux ?

Ans: Load  Average is defined as the average sum of the number of process waiting in the run queue and number of process currently executing over the period of 1,5 and 15  minutes. Using the ‘top’ and ‘uptime’ command we find the load average of a Linux sever.

23) What does Sar provides and at which location Sar logs are stored ?

Ans: Sar Collect, report, or save system activity information. The default version of the sar command (CPU utilization report) might be one of the first facilities the  user  runs  to  begin system  activity investigation, because it monitors major system resources

By  default log files of Sar command  is located at  /var/log/sa/sadd file, where the dd parameter indicates the current day.

24) What are filenames that are preceded by a dot?

Ans: In general, filenames that are preceded by a dot are hidden files. These files can be configuration files that hold important data or setup info. Setting these files as hidden makes it less likely to be accidentally deleted.

25) What are environmental variables?

Ans: Environmental variables are global settings that control the shell’s function as well as that of other Linux programs. Another common term for environmental variables is global shell variables.

26) How can you append one file to another in  Linux?

Ans: To append one file to another in Linux you can use command cat file2 >> file 1.  The operator >> appends the output of the named file or creates the file if it is not created.  While another command cat file 1 file 2 > file 3 appends two or more files to one.

27) How you can run an Linux program in the background simultaneously when you start your Linux Server?

Ans: By using nohup. It will stop the process receiving the NOHUP signal and thus terminating it you log out of the program which was invoked with. & runs the process in the background.

 28) What is Initrd ?

Ans: Initrd stands for initial ram disk , which contains the temporary root filesystem and necessary modules which helps in mounting the real root filesystem in read mode only.

29) What is Bootloader ?

Ans: Bootloader is a program that boots the operating system and decides from which kernel OS will boot.

30) How to check all the installed Kernel modules ?

Ans: Using the Command ‘lsmod’ we can see the installed kernel modules.

31) What is name of first process in linux ?

Ans: ‘init’ is the first process in linux which is started by kernel and whose pid is 1.

32) When you try to boot a linux system, you receive a message that it cannot mount /home partition because of errors, while debugging, you found it occur due to data error. What can you do to fix the problem?

Ans : You can run e2fsck to recover from errors.

Eg : e2fsck /home

33)  Which log file keeps track of all user logins and logouts?

Ans : /var/log/wtmp or /var/log/utmp file keeps track of all user logins and logouts.

Reading wtmp file : utmpdump /var/log/wtmp

34) Why should you periodically update the kernel and package versions?.

Ans : To enhance the security of system .

35) If a system shutdown abnormally, will fsck run on mount points?.

Ans: yes as the partitions are not unmounted properly, so the fsck check will run.

36)  Which necessary steps should be taken to enhance the security of server just after the initial installations?.

Ans :      1)           Kernel package should be upgraded to the latest version.

2)           Unnecessary services abd daemons should be disabled.

3)           Set complex password policy.

5)           unnecessary ports should be disabled.

37) What are the basic components of Linux?

Ans:      Linux has these components: kernel, shells and GUIs, system utilities and application program. What makes Linux productive over other operating system is that every perspective goes with additional features and all codes for these are downloadable for free.

38) What is the maximum length for a filename under Linux?

Ans:      Any filename can have a maximum of 255 characters. This limit does not include the path name, so therefore the entire pathname and filename could well exceed 255 characters

39) How many primary partitions is possible on one drive?

Ans:    There are a maximum of 4 primary partition possible on a drive.

40) How do you terminate an ongoing process?

Ans: Explain how every process in the system is identified by a unique process id or pid.Using the ‘kill’ command followed by pid terminates that process.

 Kill9 pid

41) What is NFS ?

Ans:  NFS is Network File System (NFS) allows remote machine to mount file systems over a network and interact with those file systems as though they are mounted locally.

NFS uses 2049 TCP port by default.

42)What are configuration files of NFS server ?.

Ans:     /etc/exports’ is the main configuration file.

43) How to list available nfs share on local machine & remote machine ?

Ans:     ‘showmount -e localhost’ : Shows the available shares on your local machine
‘showmount -e <Remote-server-ip or hostname>‘: Lists the available shares at the remote server.

44) What is pNFS ?

Ans:     Parallel NFS (pNFS) as part of the NFS v4.1 standard is available as of Red Hat Enterprise Linux 6.4. The pNFS architecture improves the scalability of NFS, with possible improvements to performance. That is, when a server implements pNFS as well, a client is able to access data through multiple servers concurrently. It supports three storage protocols or layouts: files, objects, and blocks.

45) What is the difference between Hard mount & Soft mount in nfs ? (imp Question must prep).

Ans:    Soft Mount – When a program or application requests a file from the NFS filesystem, NFS client daemons will try to retrieve the data from the NFS server. But, if it doesn’t get any response from the NFS server (due to any crash or failure of NFS server), the NFS client will report an error to the process on the client machine requesting the file access. The advantage of this mechanism is “fast responsiveness” as it doesn’t wait for the NFS server to respond. But, the main disadvantage of this method is data corruption or loss of data. So, this is not a recommended option to use.

            Hard Mount – NFS share using hard mount, it will repeatedly retry to contact the server. Once the server is back online the program will continue to execute undisturbed from the state where it was during server crash. We can use the mount option “intr” which allows NFS requests to be interrupted if the server goes down or cannot be reached. Hence the recommended settings are hard and intr options.

46) How to check nfs server version ?

Ans:    ‘nfsstat -o all’ , “rpcinfo -p localhost” command shows all information about active versions of NFS.

 

Linux Interview Questions

Leave a Reply

Your email address will not be published. Required fields are marked *