0% found this document useful (0 votes)
50 views36 pages

Most Importa NT Interview Question Linux

The document discusses various Linux server administration concepts like DHCP, DNS, RAID, LVM, monitoring tools, troubleshooting slow servers, and ACL permissions. It provides explanations and configuration steps for setting up DHCP and DNS servers, and describes common Linux server administration tasks and challenges.

Uploaded by

brutalxrop
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
50 views36 pages

Most Importa NT Interview Question Linux

The document discusses various Linux server administration concepts like DHCP, DNS, RAID, LVM, monitoring tools, troubleshooting slow servers, and ACL permissions. It provides explanations and configuration steps for setting up DHCP and DNS servers, and describes common Linux server administration tasks and challenges.

Uploaded by

brutalxrop
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 36

MOST IMPORTANT INTERVIEW QUESTION

LINUX
INTERVIEW PREPARATION QUESTIONS
1. Do you configure DHCP. And why?
ANS. Yes , DHCP stands for Dynamic Host Configuration Protocol . DHCP is a network
protocol that enables the server to assign an IP addresses to the clients in the network
automatically from a defined range of IP addresses.
2. How to configure the DHCP server?
ANS. # yum install dhcp* -y
# vim /etc/dhcp/dhcpd.conf
Go to line number 47 Go to line number 47 and edit that line as below. subnet
netmask { range ; default-lease-time 600; (the minimum lease time to the client in
seconds) max-lease-time 7200; (he maximum lease time to the client in seconds) }
Example : subnet 172.25.0.0 netmask 255.255.255.0 { range 172.25.9.50 172.25.9.100;
default-lease-time 600; max-lease-time 7200.:
* Go to line number 51 and edit that as below. option routes ; option broadcast-
address
Example : option routes 172.25.9.11; option broadcast-address 172.25.9.255
Wq!
systemctl restart dhcpd
3. What is DORA Process?

The DHCP works in four phases: Discovery, Offer, Request,


Acknowledgement, also called the DORA process. DHCP uses this
process to provide IP addresses to clients.

4. What is the profile of DHCP?


Package : dhcp
Script file : /etc/init.d/dhcpd
Configuration file : /etc/dhcp/dhcpd.conf
Deamon : dhcpd
Port numbers : 67 (dhcp server) and 68 (dhcp client)
Log messages : /var/log/messages
5. How to configure the DNS Server?
# yum install bind* -y
#vim /etc/named.conf
Line no.13 write IP
Line no.21 ANY
Wq!
SYSTEMCTL RESTART NAMED –NOW
SYSTEMCTL STOP FIREWALLD
SETENFORCE 0
# VIM /ETC/NAMED.CONF RFC1912.ZONES
Line 13 domain name change
Line 15 f.zone
Line 31 reverse I.p (1.8.168.192)
Line 33 = r.zone
Cd /var/named
Ls
Cp-pr named.localhost f-zone
Then # vimfzone {ENTRY}
INSOA shan.example.com root shan.example.com
Then
Cp-pr named loopback r.zone
[ENTRY]
IN soa shan.example.com root.shan.example.com
NS example.com
A IP
PTR localhost
PTR shan.example.com
Wq!
Named-checkzone shan.example.com /var/named/f.zone or r.zone
# vim /etc/resolve.conf
Server name IP
Wq!
# systemctl restart named
# nslookup IP
# nslookup Shan.example.com
6. What is the profile of DNS?
Package : bind and caching-name
Script : /etc/init.d/named
Configuration file : /etc/named.conf and /etc/named.rfc1912.zones
Client's configuration file : /etc/resolve.conf
Document root : /var/named/
Log file : /var/log/messages
Deamon : named
Port number : 53
7. What are the DNS record and explain them?
(i) SOA Record : (Start of Authority) SOA contains the general administration and
control information about the domain.
(ii) Host A Record : (a) It is nothing but aForward Lookup Zone. (b) It maps
Hostname to IP address.
(iii) PTR : (Pointer Record(a) It is nothing but a Reverse Lookup Zone. (b) It maps
IP address to Hostname.
(iv) NS Record : (Name Server Record) It stores the DNS server IP addresses.
(v) MX Record : (Mail Exchange Record) It stores the records of the Mail Server IP
address.
(vi) CNME Record : It is nothing but Host's Canonical name allows additional
names or aliases to be used
8. What is DNS Server?
DNS stands for Domain Naming System. The DNStranslates Internet domain and host
names to IP addresses.
9. What is the use of sticky bit?
If we plan to allow all the users of one group to get the group ownership permissions
then we go for set gid .
# chmod g+s (to set the sgid on that directory)
# chmod g-s (to remove the sgid from that directory)
10. what is the use of SUID?
If we plan to allow all the users to execute the root users command then we go for set
suid (suid)
11. How to manage and monitor your Servers?
Monitoring tool:- Nagios, Prometheus, or Zabbix

Monitor key metrics such as CPU usage, memory usage, disk space, network
activity, and application-specific metrics.
12.How many virtual servers and Physical server?
There are 600 virtual server and 120 physical server .
12. what is the benefit of LVM?
Ans. Dynamic volume resizing
Volume resizing and mirroring
Flexible allowcation of storage space
Snapshot
Online volume migration
Ease of volume management
Extensibilty
Improved backup and recovery.
Better space utilization
13. Do you trouble shoot any network related problem?
14. Do you face any network related problem of any Server?
15. Have you done Server hardening?
I have full theoretical knowledge about server hardening . like .
Server hardening is the process of securing a server by reducing its surface of
vulnerability. It involves configuring the server and its software to enhance security
and minimize potential risks
16. How many team members in your team?
77
17. what is RAID?
RAID stands for Redundant Array of Independent Disks. It provides fault tolerance,
load balancing using stripping, mirroring and parity concepts.
TWO TYPES OF RAID:-
(i) Hardware RAID (Depends on vendors and also more expensive)
(ii) Software RAID (Does not depends on vendors and less expensive when
compared to Hardware RAID and also it is maintained by system administrator
only

18. What is the difference between RAID 1 & 5?


 To configure RAID - 1, minimum 2 disks are required  To configure RAID - 5, minimum 3 disks are required
and the partition id is "fd". and the partition id is "fd".
 In this the same data will be written on 2 disks ie., exact  In every disk approximately 25 - 30% of space is
copy on both the disks. reserved for parity.
 if one disk is failed we can recover the data from  Reading and writing is very fast. So, it produces high
another disk. performance.
 So, there is a high availability, redundancy and fault  This is used Stripping with parity concept.
tolerance in RAID - 1.
 if one disk is failed we can recover the data using
 In this writing speed is slow compared to RAID - 0 remaining two disks and parity.
 If two disks are failed, then we cannot recover the
data.
 So, there is no redundancy and fault tolerance in RAID
- 5.

19. what is the use of Rsync?


rsync is a very good program for backing up or mirroring a directory tree of files from
one machine to another machine and for keeping the two machines " in sync "
20. What is the difference between Rsync & SCP?

RSYNC SCP
PORT NO. 873 PORT NO. 22
Data transferred in Encrypted form Data transferred in Plain text
Don’t overcome data when backup Take overcome data
Show transferring data Don’t show transferring data

21. If your server running slow then how to trouble shoot?


Check by top command

1 .Disk Space:
2.Review System Logs:
3.Network Issues:
4.Check for Rogue Processes
5.Evaluate Memory Usage
6.Check CPU Usage:
7.Check for Malware or Security Threats
8.Review Running Services:
9.Check Kernel Parameters:
10.Update Software:
11.Consider Resource Upgrades
12.Optimize Configuration Files:
22. How to Monitor Servers if your server is slow?
23. Explain the output of Top command.
 PID: Process ID.
 USER: User who owns the process.
 PR: Priority of the process.
 NI: Nice value.
 VIRT: Virtual memory used by the process.
 RES: Resident set size (non-swapped physical memory used).
 SHR: Shared memory size.
 S: Process status (running, sleeping, stopped, etc.).
 %CPU: Percentage of CPU usage by the process.
 %MEM: Percentage of memory usage by the process.
 TIME+: Total CPU time consumed by the process.

24. What are ACL Permissions & why we use them?


25. If your DNS is not working then how to Trouble shoot this problem?

1. Check DNS Configuration: 2. Test DNS Resolution: 3. Check NetworkConnectivity:

4. Firewall Configuration: 5.Verify DNS Resolver Service: 6.Restart DNS Services:

6.Check for DNS Caching: 7. Check DNS Configuration Files: 8. Check System Logs:

9.Capture DNS Traffic: 10.Update DNS Configuration:


26. How to check connectivity of DNS by using another Server?
BY USING PING , TELNET ,NSLOOKUP , DIG , NC
27. What is web Server?
A Web server is a system that delivers content or services to end users over the
Internet.
28. What is the profile of web server?
Package : httpd
script : /etc/init.d/httpd
Deamon : httpd
Configuration file : /etc/httpd/conf/httpd.conf (for http) /etc/httpd/conf.d/ssl.conf
(for https)
Document Root : /var/www/html
Log files : /var/log/httpd/access_log /var/log/httpd/error_log
Port Number : 80/http and 443/https
29. How to configure web Server?
30. How to recover the Root Password?
31. How to create static IP by using NMCLI command & File?
sudo nmcli connection modify enp0s3 ipv4.method manual ipv4.addresses 192.168.1.100/24
ipv4.gateway 192.168.1.1 ipv4.dns 8.8.8.8
by configurationfile :-
cd /etc/sysconfig/network-scripts/
sudo nano ifcfg-<interface_name>

Add/Edit Configuration Parameters


systemctl restart NetworkManager
systemctl restart network
nmcli connection show
32. Why we use bonding?
NIC bonding, is a technique used in Linux to combine multiple network interfaces
into a single, logical interface called a bond or bond interface. This process provides several
benefits
33. What is SeLinux?
It is a one type of security that enhances the security that allows users and
administrators It is mainly used to protect internal data (not from external data) from system
services. In real time SELinux is disabled and instead of this IP tables are used. It protects all the
services, files and directories by default if SELinux is enabled.
34. What are IP tables or firewalls?
iptables is a command-line tool in Linux that manages the firewall rules for packet
filtering in the Linux kernel. It allows you to define rules to control how network traffic is allowed
or blocked on a Linux system. iptables is used to secure a system by controlling incoming and
outgoing network connections, protecting against unauthorized access.

A firewall is a security barrier between a computer network and the outside world. It can be
implemented in hardware, software, or a combination of both. It monitors and controls
incoming and outgoing network traffic based on predetermined security rules. It acts as a
gatekeeper, allowing or blocking traffic based on these rules. Firewalls are used to protect
computer systems and networks from unauthorized access, cyberattacks, and other security
threats by controlling the flow of traffic.
35. In how many ways we can protect the network?
1.FIRWALL
2.SELINUX
3.TCP WRAPPERS
4.NETWORK INTRUSION DETECTION SYSTEM {NIDS}
5.SSH SECURITY
6.VPN
ETC.
36. What are TCP wrappers?
TCP Wrappers allow you to control access to network services based on hostnames,
IP addresses, or network patterns. It is often used with services that support it, like sshd.
37. What is the difference between RHEL 6 & 7?
1.OS TIME RHEL6-40 SECOND RHEL7-20 SEC
2.MAXIMUM XIZE OF SINGLE PARTITION RHEL6- 50TB(EXT4) RHEL7-500TB(XFS)
3,BOOT LOADER RHEL6-/boot/grub/grub.conf RHEL7- /boot/grub2/grub.conf
4.PROCESSOR ARCHITECTURE RHEL6- IT support 32bit & 64 bit both RHEL7- it support only
64 bit
5. FORMAT & ASSIGN A FILE SYSTEM – RHEL6-#mkfs.ext4/dev/hda4
RHEL7-mkfs.xfs/dev/hda3
6. REPAIR FILESYSTEM – RHEL6 - #fsck –y/dev/hda3 RHEL7- #xfs_repair /dev/hda3

38. How to solve the issue if the CPU utilization is 99%?

(i) First check which process and who executed that process is consuming more
CPU utilization or memory utilization by executing # top command.
(ii) Then inform to those users who executed that process though mail, message or
raising the ticket.
(iii) If those users are not available or not responding to our mail then we have to
change the priority of that process using # renice command.
(iv) Before changing the process priority level , we have to get or take approval from
our team lead or project manager
39. How to kill any process?
Kill-9 pid
40. How to repair the corrupted boot loader?
(i) Insert the RHEL - 6 DVD and make sure that system should boot from CD/DVD.
(ii) Boot the system in Rescue Installed System mode.
(iii) Select the language with which we want to continue and click on OK.
(iv) Select the Keyboard type as US and click OK.
(v) Select Local CD/DVD and click OK.
(vi) Move the cursor to NO to ignore the Networking.
(vii) Move the cursor to Continue tab to mount the root ( / ) from CD/DVD and press
Enter key.
(viii) Now the root ( / ) file system is mounted on /mnt/sysimage, here click on OK
and Press Enter to continue.
(ix) Select the "shell Start shell" option and click on OK, then shell will be displayed
on screen.
(x) At shell prompt type as # chroot /mnt/sysimage command, press Enter.
(xi) Check the /boot partition by # fdisk -l command
(xii) Install the new grub on the boot device ie., may be /dev/sda2 by # grub-install
command (For example # grub-install /dev/sda2).
(xiii) If it show no error reported that means we have successfully recovered the
grub.
(xiv) Then type # exit command and again type # exit or # reboot command to reboot
the system
41. How to change the run level temporarily?
Init (runlevel)
42. What is SWAP?
43. How to make any server password less?
SSH KEY GENERATION
44. What is the Linux file system?
a file system in Linux is like an organized way of storing and managing files on your
computer. TYPES- EXT4,EXT2,EXT3,XFS,B-TREE,ZFS,FALSH-FRIENDLY ,Virtual file allocation
table {VFAT} , new technology file system {ntfs}
TYPES OF FILE :- Regular file, Directory file, Link file, Character special file, Block special file,
Socket file, and Named pipe file
45. What is inode?
Identification of file , directory
46. what is the difference between ext2 and ext3 file system?

Ext2 Ext3
Stands for Second Extended file system Stands for Third Extended file system.
Does not having Journaling feature Supports Journaling feature
Max. file size can be from 16 GB to 2 TB. Max. file size can be from 16 GB to 2 TB.
Max. file system size can be from 2 TB to 32 TB Max. file system size can be from 2 TB to 32 TB
Cannot convert ext file system to ext2 We can directly convert ext2 to ext3 file system.

47. How you will uncompress the file?


Gunzip filename or Gzip filename
48. What is SSH?
SSH is stands for Secure Shell. It was designed and created to provide the best security
when accessing another computer remotely. Not only does it encrypt the session, it also provides
better authentication facilities .
49. What is the difference between SSH and telnet?

50. How to create a user?


51. How to set runlevel permanently?
# vim /etc/inittab
52. What is the use of /bin directory?
/bin directory is a crucial system directory that contains essential executable binaries
(command binaries) required for basic system functioning and maintenance
53. what is the difference between extend partition & LVM Partition?

Feature Extended Partition LVM Partition


Serves as a container for logical Provides a flexible and dynamic way to
Basic partitions within the traditional MBR manage logical volumes within a volume
Functionality partitioning scheme. group.
Feature Extended Partition LVM Partition
Enables efficient management of storage,
Allows you to overcome the limitation including resizing volumes on-the-fly
of having only four primary partitions and adding/removing volumes without
Purpose on an MBR disk. reformatting.
Can contain multiple logical partitions, Allows the creation of numerous logical
Maximum extending beyond the four-primary- volumes within a volume group, offering
Partitions partition limit. more flexibility than traditional partitions.
Each logical partition within an Logical volumes can have their own file
extended partition can have its own file systems, and the file system can be
File System system. resized dynamically.
Logical partitions within an extended
partition have fixed sizes. Adjustments Logical volumes within a volume group
Size require resizing the entire extended can be resized dynamically without
Adjustments partition. affecting other volumes in the group.
Limited flexibility in resizing and
managing partitions. Resizing may Highly flexible. Logical volumes can be
Ease of require adjusting the size of the resized, added, or removed without
Management extended partition. affecting other parts of the storage.
Each logical partition is typically treated Backup and restoration can be managed
Backup and independently, and backup/restoration at the volume group level, simplifying
Restore is done on a per-partition basis. the process.
Commonly used in modern systems
employing LVM for advanced storage
Used in Traditional MBR partitioning scheme. management.
fdisk, parted, or similar partitioning pvcreate, vgcreate, lvcreate, and other
Common Tools tools. LVM commands.

54. What is subnetmask?


a subnet mask in Linux is a numerical code that helps computers understand which
part of an IP address represents the network and which part represents the device (computer,
server, etc.) within that network. It is used to divide and organize IP addresses into subnetworks,
making it easier for devices to communicate within their designated groups.
55. In how many files I need to give my IP address to configure DNS?
5 files
56. Your any service is not restart it’s show an error “address is already in use” then how to solve?
Ans. 1.ANY BACKGROUND PROCESS RUN IN BACKEND,
2.check firewall setting
3.check configuration file.
4.check port no. listening
5. ZOMBIE PROCESS - process that has completed its execution but still has
an entry in the process table
57. How many Classes of IP Address?
58. What is kernel in Linux?
Main component of linux which communicate between hardware and software { heart & core of
linux}
59. How to change file permissions?
Chmod
 u (user/owner)
 g (group)
 o (others)
 a (all)
 + (add permission)
 - (remove permission)
 = (set exact permission)
 Read: 4
 Write: 2
 Execute: 1

60. How to know how many UDP & TCP ports are open?

Netstat or ss command / grep – t / grep –u


61. What is initramfs function?
initramfs (initial ramdisk filesystem) is a temporary filesystem that's loaded into
memory during the Linux kernel's boot process. Its primary purpose is to contain essential files
and drivers needed to mount the root filesystem and initialize the system enough to hand over
control to the real root filesystem.
62. What is DHCP shopping?
the term "shopping" is often associated with online shopping, and security in this
context involves protecting user data, payment information, and ensuring secure transactions.
63. What is the functions of grub?
GRUB just loads and executes kernel and initrd images.
64. Any 5 commands to install Packages?
# yum install package name.
# rpm –ivh package name

65. How to take LVM snapshot?


66. What is the difference b/w Raid 0 & 5
RAID 0 RAID 5
 To configure RAID - 0, minimum 2 disks are required and the  To configure RAID - 5, minimum 3 disks are required
partition id is "fd". and the partition id is "fd".
 Reading and writing is very fast. So, it produces high  In every disk approximately 25 - 30% of space is
performance. reserved for parity.
 if one disk is failed we cannot recover the data.  Reading and writing is very fast. So, it produces high
performance.
 So, there is no redundancy and fault tolerance in RAID - 0.
 This is used Stripping with parity concept.
 if one disk is failed we can recover the data using
remaining two disks and parity.
 If two disks are failed, then we cannot recover the data.
 So, there is no redundancy and fault tolerance in RAID -
5.

67. How to check how many packages are installed.


#RPM –QA | WC -L
68. What is RED HAT satellite server?
it is a systems management platform by Red Hat that helps with the provisioning,
monitoring, and management of Red Hat Enterprise Linux (RHEL) deployments
69. How to check Inode of any file & directory?
# LS –I FILE OR DIRCETORYNAME
70. What is log file by default?
Log file is file that contains messages about that system, including the kernel, services
and applications running on it, ....etc., There are different log files for different information. These
files are very useful when trying to troubleshoot a problem with systems.
Common log file - /var/log
71. what kind of information stored in Inode?
(a) Inode first part contains information about the file, owner, its size and its
permissions.
(b) Inode second part contains pointer to data blocks associated with the file content
72. What is the benefits of LVM?
73. What are the main function of Kernel?
Communicate between hardware & kernel
74. Mysql is down how to troubleshoot?

Check MySQL Service Stat , Review MySQL Error Log , Check Disk Space ,
Verify MySQL Configuration , Verify MySQL Port Availability , Restart MySQL , Examine
System Logs , Firewall Configuration , etc.
75. How to check security packages?
rpm -qa | grep -i security
76. How to check running port?
Netstat tunlp
77. How to take backup a mysql data base?
# MYSQL DUMP –U ROOT -P OIT.SHAN>OIT.SHANDUMP
78. What is Mysql port number?
3306
79. What is differential backup?
Taking a backup from last full backup or last cumulative or differential backup
80. What is incremental backup?
Taking a backup from the last full backup or last incremental backup
81. How many ways to take backup?
(i) Full backup (Entire file system backup)
(ii) Incremental backup (backup from the last full backup or incremental backup)
(iii) Cumulative or differential backup (backup from last full backup or cumulative
backup.
82. SSl Port number?
443
83. Pop port number?
110
84. What is smtp port number?
587 OR 25
85. What is Passive mode in ftp Server?
In Passive FTP connection, both command and data connections are established by
the client. In this the server acts as entirely passive, that's why it is called the Passive FTP. Here the
server listens for incoming requested connections from client through port 21 and the client also
initiates the data connection at port 20.
86. What is the partition I’d Swap & Lvm?
Lvm – 8e , swap – 82 , linux normal partition -83
87. How to check software raid or hardware raid configure?
Lsblk , blkid , mdadm , cat /proc/mdstat , cat/etc/fstab.
88. what is the difference between Pop & imap?
IMAP (Internet Message Access
Feature POP3 (Post Office Protocol) Protocol)
Protocol Type Retrieval Protocol Access Protocol
Downloads emails from the server to the Keeps emails on the server and allows
Usage client manipulation on server
Typically downloads emails to the client,
removing them from the server (by Keeps emails on the server (unless
Email Retention default) configured otherwise)
Offline mode: Messages are stored Online mode: Messages are stored on
Storage locally on the client the server
May lead to synchronization issues Well-suited for multiple devices,
Multiple Devices when accessing from multiple devices maintains synchronization
Stateless - Each session is independent Stateful - Maintains the state of
Connection of others emails and folders between sessions
IMAP (Internet Message Access
Feature POP3 (Post Office Protocol) Protocol)
Supports flags, read/unread status,
Message Flags Limited support for message flags and other metadata
Typically lower bandwidth usage as Higher bandwidth usage, especially
Bandwidth Usage emails are downloaded once for attachments and large emails
Requires more sophisticated server
Server Basic server functionality (send and capabilities for storage and
Requirements receive) management
Typically less secure, as messages are More secure, especially if using
Security downloaded and stored locally encrypted connections
Common Port
Numbers 110 (non-secure) or 995 (secure) 143 (non-secure) or 993 (secure)

89. How to check software raid or hardware raid configure?


90. How to recover fstab file?
1. Using a BACKUP by CP
2. Recover by rescue mode.

91. what is LVM mirroring?


Create mirrored logical volumes, providing data redundancy and fault tolerance.
Mirroring is a method of duplicating data across multiple physical volumes (PVs) to ensure data
availability even if one of the PVs fails.
lvcreate --type mirror --mirrors 1 --name mylv -l 100%FREE myvg

92. What is telnet?


Telnet is a mechanism to connect and to administrate the remote system from local
system. This is the oldest program which is available on most network capable operating systems.
93. How to check memory usages in by top command.
Top –e
94. How to check Disk space?
Df –ht , df –h , lsblk ,
95. How Many classes in networking?
1. Physical network interfaces
2. Virtual network interfaces
3. Loopback interfaces
4. Bridge interfaces
5. Tunnel interfaces
6. VIRTUAL lan interfaces
96. What is the uses of netstat?
1. Display network inetrfaces
2. Display listening ports
3. Display all sockets
4. Display routing tables
5. Display network statistic
6. Dispay network connection in continuous mode.
97. Scp command use?
securely copy files and directories between hosts over an SSH (Secure Shell)
connection
98. Traceroute command use?
the traceroute command is used to trace the route that packets take from your
computer to a destination host or IP address
101. How to check open ports?
NETSTAT TUNLP
102. NFS port number?
PORT – 2049 CLIENT SIDE - 1024
103. When you login you get “$” prompt, what is the prompt for
root? #
104. Explain the difference between grep and egrep?

Feature grep (Basic Regular Expression) egrep (Extended Regular Expression)


Uses basic regular expressions (BRE) Uses extended regular expressions (ERE)
Pattern Matching for pattern matching. for pattern matching.
Recognizes an extended set of
Recognizes a limited set of metacharacters for more complex
Metacharacters metacharacters. pattern matching.
Alternation is represented by the |
Alternation symbol. Alternation is represented by the `
Parentheses are treated as special
Parentheses for Parentheses must be escaped to be characters for grouping without
Grouping treated as special characters. escaping.
Quantifiers like +, ?, {}, etc., must
be escaped or used in a specific Quantifiers can be used directly without
Quantifiers way. escaping.
Character classes like [a-z] are Extended character classes like [a-z]
Character Classes used to match ranges. can be used for ranges.
Example ```bash ```bash
grep 'pattern' file.txt egrep 'pattern' file.txt
More advanced pattern matching using
Usage Basic pattern matching. extended regular expressions.

105. What is the port # for DNS, NTP and NFS?


53,123 and 111/2049

106. What is the configuration file name of DNS and where is itlocated?
/etc/named.conf
107. How many new directories will be created after running thefollowing command
mkdir {a..c}{1..3}
9

108. Your PC is configured with a DNS server address but not thedefault gateway. Can
the PC access internet?
No

109. What is the difference between IP and Gateway?

Aspect IP (Internet Protocol) Gateway


A unique numerical label assigned to A network device that connects
each device in a network for different networks, forwarding data
Definition identification and communication. between them.
Identifies a specific device on a
network, allowing communication Enables communication between
between devices within the same devices in different networks by
Purpose network. directing traffic between them.
Assigned to each network interface of Configured as the default route on a
a device to enable communication device, pointing to the gateway's IP
Configuration within a local network. address for reaching external networks.
Can be unique within a network,
Must be unique within the same typically assigned to a router
Uniqueness network segment to avoid conflicts. connecting to external networks.
Examples 192.168.1.1, 10.0.0.2 192.168.1.254, 10.0.0.1
Used to route traffic between different
Role in Used to address and route traffic networks, facilitating communication
Communication within a local network. beyond the local network.
Set in the device's network
Configuration Set on each device's network interface configuration file as the default
Location configuration. gateway.
Also operates at the network layer,
Works at the network layer (Layer 3) of facilitating communication between
Operation Layer the OSI model. different subnets.
IP addresses within the same subnet Gateway is often associated with
Subnet can communicate directly without subnet boundaries, handling traffic
Consideration involving the gateway. between different subnets.
Facilitates communication between
Communication Primarily used for communication devices in different networks, including
Range within a local network or subnet. the Internet.
110. Can you assign one static IP to 2 computers, if not then why?
No because it will create IP conflict

111. How to change IPs address to static?


ifconfig x.x.x.x

112. You are trying to ping a server by hostname and you get an errormessage, “ping:
unknown host …”. What could be the reason and how to solve the problem so you can ping it
by hostname?
Check for /etc/hosts or DNS to see if it has hostname to IP entry

112. Explain the difference between relative and absolute path? Absolute path starts from /
where relative path is your currentdirectory

114. List 3 different methods of adding user?


Useradd , adduser , by scripting , by desktop <home>page , userwith full syntax.
115. What is the command to change file/directory ownership and group?
chown and chgrp

116. List any 3 type of filesystem?


ext4,NTFS and FAT
117.When you login you get a message on the screen. What is the nameof that file and where is it
located?
/etc/motd

118. What is /bin directory used for?


essential for the system's operation and contains executable binary files that are
fundamental to the system's functionality, especially during the boot process and when the
system is in a single-user mode.
119. What are the different types of DNS Server
Master and secondary

120. How to change a user password?


passwd username

121. What is the version of Redhat Linux you have experience with?
7.4

122. List any 4 linux distributions?


Redhat, CentOS, Ubuntu and SUSE

123. How to logoff from the system?


exit

124. Give any 3 examples of operating systems?


Windows, Linux and MAC

125. How to create a directory?


mkdir

126. Where are the zone files located for DNS service?
/var/named/zonefiles

127. How to check kernel version?


uname –a

128. Which directory has all the configuration files?


/etc

129. How to become root user from a regular user?


su –

130. How many mega bytes in 1 giga bytes?


1024 mb
131. What is the purpose of having different network ports?
So the communication of each application goes through a dedicatedport

132. How to display first column of a file?


cat filename | awk ‘{print $1}’

133. What is the name of DNS rpm package?


bind

134. What is the difference between nslookup and dig commands?


Aspect nslookup Command dig Command
DNS query tool for querying domain
information and resolving DNS-related Powerful DNS query tool with more
Purpose issues. features and flexibility.
Present in many Unix-like operating May need to be installed separately on
Availability systems, including RHEL. some systems.
Interactive Provides an interactive mode for Does not have a dedicated interactive
Mode querying multiple DNS records. mode.
Supports basic query types like A, PTR, Supports a wide range of query types,
Query Types MX, NS, etc. including additional DNS record types.
Provides a more user-friendly output Produces a more detailed and machine-
Output Format format. readable output.
Used for forward DNS lookups (domain Supports forward lookups using the
Forward Lookup to IP address). +short option.
Supports reverse DNS lookups (IP Supports reverse lookups by specifying
Reverse Lookup address to domain). the -x option.
Can be used for DNS zone transfers, but
typically requires proper access
Zone Transfer Does not support DNS zone transfers. permissions.
Additional Limited options for displaying Allows detailed control over output
Information additional information. format and query options.
Examples nslookup example.com dig example.com

135. How to check your user id and group id?


id

136. How to check a file’s permission?


ls –l

137. What is the difference between “kill” and “kill -9” command?
Aspect kill Command kill -9 Command
Sends a default signal (SIGTERM, Sends a forceful termination signal (SIGKILL, 9)
15) to the process, requesting it to to the process, forcing it to terminate
Signal Sent terminate gracefully. immediately.
Aspect kill Command kill -9 Command
Graceful Allows the process to perform Does not allow the process to perform any
Termination cleanup tasks before exiting. cleanup tasks; terminates abruptly.
Used for standard termination Used when a process is unresponsive or
Common requests, giving the process a refuses to terminate with a standard signal.
Usage chance to shut down gracefully. Provides a more aggressive termination.
Allows the process to catch and
handle the signal, providing an Does not allow the process to catch or handle
Effect on opportunity for cleanup or custom the signal; terminates the process forcefully
Process shutdown procedures. without any chance for cleanup.
Signal Signal number 15 (SIGTERM) is sent Signal number 9 (SIGKILL) is explicitly
Number by default. specified.
Example kill PID kill -9 PID
You can specify other signals with
Alternative the -s option, e.g., kill -s HUP Typically used when other signals do not work,
Signals PID for SIGHUP. and a forceful termination is required.
Used as a last resort when a process is
Suitable for normal termination unresponsive, stuck, or not terminating with
Usage scenarios where a process can other signals. Can lead to data loss or
Scenarios respond to the termination signal. corruption if used indiscriminately.

138. What is subnet?


A subnet mask allows the users to identify which part of an IP address is reserved for the
network and which part is available for host use.

139. You are troubleshooting an issue with Redhat support and they have asked you to
send the contents of /etc directory. How andwhich method you will use to transfer the
contents?
tar (compress) the entire /etc directory and ftp

140. What is root home directory?


/root

141 What is rsyslogd deamon and its purpose?


DAEMON - rsyslog
The primary purpose of rsyslogd is to ensure efficient and flexible logging, allowing administrators to
monitor system events, troubleshoot issues, and maintain security.
142. Your company has terminated a server administrator. What is firstthing as an
administrator you should do to enhance the security?
Change root password

143. How to check the computer name or host name in Linux?


hostname

144. Which permission allows a user to run an executable with thepermissions of


the owner of that file?
First 3 bits should have x

145. What is the command to untar a tarred file?


untar
146. What is /proc directory used for?
The /proc directory is an essential part of the Linux procfs (process file system)
and contains a variety of files and directories that expose kernel and process-
related information.
147. What is the purpose of nsswitch.conf file
It tells the system where to go to resolve hostnames

148. List 3 basic commands to navigate the filesystem?


cd, pwd and ls

149. Which service/daemon should be running on the server that allowsyou to connect
remotely?
sshd

150. What is the purpose of firewall?


it as a virtual security guard that decides what data is allowed in and out of your
computer, helping to prevent unauthorized access and potential security threats.
151. List any 3 IT components?
Hardware, OS and Applications

152. Which directory has all the commands we use, e.g. ls, cd etc.?
/usr/bin or /bin

153. What is the difference between memory, virtual memory and cache?
Aspect Memory Virtual Memory Cache
Logical extension of RAM Small-sized, high-speed
used when physical RAM is memory located close to the
Type Physical RAM insufficient. CPU.
Stores data and code Extends available memory Temporarily stores frequently
that is actively used by by using disk space as used data to speed up CPU
Purpose the CPU. temporary storage. access.
Slower access speed
compared to physical RAM Extremely fast access speed,
Access Speed Very fast access speed. due to disk involvement. faster than RAM.
Volatile (loses data May be persistent across
when power is turned reboots but slower due to Volatile (loses data when
Persistence off). disk access. power is turned off).
Limited by physical Larger capacity, limited by Smaller capacity compared to
Capacity RAM size. available disk space. RAM.
Managed by the Managed by the operating Managed by the CPU and
operating system's system, involves paging in hardware, transparent to the
Management memory manager. and out from disk. operating system.
Physically located on Partly resides on disk (swap Embedded on the CPU or
Location RAM modules. space) and partly in RAM. located very close to the CPU.
Active storage for Acts as a backup when Provides quick access to
running applications physical RAM is exhausted, frequently used instructions
Usage and the operating allowing more applications and data to enhance CPU
Scenario system. to run. performance.
RAM modules installed Swap space on the hard L1, L2, and L3 caches on the
Examples in the computer. drive or SSD. CPU.

154. Which of the following is correct?


Hardware Operating System Users
Operating System Users Hardware
Database Hardware Users

155. Which of the following is a communication


command? o grep
mail
touch
cd

156. How to rename a file or directory?


mv

157. How to change a hostname in Linux?


#Hostname & permanent by config file # vim /etc/sysconfig/network
158. How to check network interfaces in Linux?
ifconfig

159. Why is “tail –f logfilename” command used most often and whatdoes it do?
It will output all incoming logs in real time

160. What type of hardware have you worked on?


You should get yourself familiar with Dell, HP and UCS hardwareby going online
and check the vendor websites

161. How to sort a file in reverse order?


cat filename | sort –r

162. What is the name of operating system that runs Unix?


Solaris, HP-UX etc.

163. List all byte sizes from smallest to largest?


Size Abbreviation Equivalent
Bit b 1 bit
Nibble 4 bits
Byte B 8 bits
Kilobyte KB 1,024 bytes (2^10)
Megabyte MB 1,024 kilobytes (2^20)
Gigabyte GB 1,024 megabytes (2^30)
Terabyte TB 1,024 gigabytes (2^40)
Petabyte PB 1,024 terabytes (2^50)
Exabyte EB 1,024 petabytes (2^60)
Zettabyte ZB 1,024 exabytes (2^70)
Yottabyte YB 1,024 zettabytes (2^80)

164. How to check the total number of partition in Linux?


fdisk -l

165. How to access a linux system from a linux system?


ssh

166. Explain the procedure of bonding 2 NICs or interfaces together?

167. What is the exact command syntax to list the 5th column of a fileand cut the first 3 letters?
cat filename | awk ‘{print $5}’ | cut –c1-3

168. What is /etc/hosts file used for?


To resolve hostnames with IP address

169. List any 3 options of ‘df’ command and what they are used for?
Search online

170. What is the command to change file/directory permissions?


chmod

171. What is the purpose of pipe (|)?


To combine multiple commands

172. What is /etc directory used for?


For configuration files

173. Which command is used to list files in a directory?


ls –l

174.There is a command which gives you information about other commands, please
explain that command and what is it used for?man

175. How to delete a file and a directory?


rm filename and rmdir dirname

176. What is the difference between “tail” and “tail -10”?


None

177. List 4 commands to display or read a file contents?


cat, more, less, vi

178. Which command is used to read the top 5 lines of a file?


head -5 filename

179. What are the different commands or methods to write to a file?


echo > filename and vi filename

180. What is swap space and how to check swap space?

Free –m
181. What is inode and how to find an inode of a file?
Search online

182. Which file to edit for kernel tuning?


Search online

183. What is the latest version of Redhat?


Search online

184. Name the command to find specific word from a file?


grep word filename

185. You have scheduled a job using crontab but it does not run at thetime you specified,
what could be the reason and how would you troubleshoot?
Check your system time
Check your crontab entry
Check /var/log/messages

186. How to check system hardware information?


dmidecode

187. How to check network interface MAC address?


ifconfig

188. If I don’t want others to read my file1, how to do


that?
Remove r from the last 3 bits of file permission

189. What is the purpose of “uniq” and “sed” command?


Search online

190. Which command is used to list the contents of a directory in themost recent time and
in reverse order, meaning the most updated file should be listed on the bottom?
ls –ltr

191. What is the difference between tar, gzip and gunzip?


Search online

192. What are the different ways to install and OS?


DVD, DVD iso and network boot

193. How to view difference between two files?


diff file1 and file2

194. You noticed that one of the Linux servers has no disk space left,how would you
troubleshoot that issue?
If running LVM then add more disk and extend LVM
If not running LVM then add more disk, create a new partition andlink the new
partition to an existing filesystem

195. How to check Redhat version


release?
uname –a or /etc/redhat-release

196. What is the difference between TCP and UDP?


Search online
197. What is a zombie process?
Search online
198. How do you search for a pattern/word in a file and then replaceit in an entire file?
sed command

199. Explain the purpose of “touch” command?


To create an empty file

200. If a command hangs, how to stop it and get the prompt back?
Ctrl C

201. Which command is used to count words or lines?


wc

202. How to check the number of users logged in?


who

203. What is the command to view the calendar of 2011?

cal 2011

204. Which command is used to view disk space?


df –h

205. How to create a new group in Linux?


groupadd

206. What is the command to send a message to everyone who is loggedinto the system?
wall

207. Which command is used to check total number of disks?


fdisk –l

208. What is an mail server record in DNS?


MX

209. What does the following command line do?ps -ef |


awk '{print $1}' | sort | uniq
List the first column of all running processes, sort them andremove duplicates

210. You get a call that when a user goes to www.yourwebsite.com itfails and gets an
error, how do you troubleshoot?
Check for user internet
Check to see if user computer has DNS for hostname lookup Check to see if the
server is up that is running that websiteCheck to see if the server’s web
service is running
Check for DNS availability which is resolving that website

211. List 4 different directories in /?


/etc, /bin, /tmp, /home

212. What is the output of the following command:


$tail -10 filename | head -1
It will show the first line from the last 10 lines of a file

213. What are the different fields in /etc/passwd file?


Search online
214. Which command is used to list the processes?
ps –ef

215.What is the difference between “hostname” and “uname” commands?Hostname


will give you system name and uname will give you OS information

216. How to check system load?


top and uptime command

217. How to schedule jobs?


crontab and at

218. What is the 3rd field when setting up crontab?


Day of the month

219. What is the command to create a new user?


useradd

220. What is the “init #” for system reboot?


6
221. How to restart a service?
systemctl restart servicename

222. How to shutdown a system?


shutdown or init 0

223. What is “ftp” command used for?


To transfer files from one computer to another

224. Explain cron job syntax? First is minute, second is..?


Min, house, day of the month, month, day of the week and command

225. How to delete a package in Linux?


rpm –e packagename

226. What is the file name where user password information is saved?
/etc/shadow

227. Which command you would use to find the location of chmodcommand?
which chmod

228. Which command is used to check if the other computer is online?


ping othercomputer

229. Please explain about LAN, MAN and WAN?


Search online

230. How to list hidden files in a directory?


ls –la

231. What is the difference between telnet and ssh?


ssh is secure where telnet is not

232. How to run a calculator on Linux and exit out of it?


bc and quit
233. List any 4 commands to monitor system?
top, df –h, iostat, dmesg

234. You are notified that your server is down, list the steps youwill take to troubleshoot?
Check the system physically Login
through system consolePing the
system
Reboot or boot if possible

235. What is difference between static and DHCP IP?


Search online

236. How to write in vi editor mode?


i = insert, a = insert in next space, o = insert in new line

237. What is the difference between “crontab” and “at” jobs?


crontab is for repetitive jobs where at is for one time job

238. What is vCenter server in VMWare?


Search online

239. What is “dmidecode” command used for?


To get system information

240. What is the difference between SAN and NAS?


Search online

241. What is the location of system logs? E.g. messages


/var/log directory

242. How to setup an alias and what is it used for?


alias aliasname=”command”
It is used to created short-cuts for long commands

243. What is the purpose of “netstat” command?


Search online

244. What are terminal control keys, list any 3?


Crtl C, D and Z

245. Which command(s) you would run if you need to find out how manyprocesses
are running on your system?
ps –ef | wc –l

246. What are the different types of shells?


sh, bash, ksh, csh etc.

243. How to delete a line when in vi editor mode?


dd

244. Which is the core of the operating


system? Shell
Kernel
Commands
Script
245. Which among the following interacts directly with
systemhardware? Shell
Commands
Kernel
Applications

246. How to save and quit from vi editor?


Shift ZZ or :wq!

247. What is the difference between a process and daemon?


Search online

248. What is the process or daemon name for NTP?


ntpd

249. What are a few commands you would run if your system is runningslow?
top, iostat, df –h, netstat etc.

250. How to install a package in Redhat Linux?


yum install packagename

251. What is the difference between “ifconfig” and “ipconfig”commands?


ifconfig for Linux and ipconfig for Windows

252. What is the first line written in a shell script?


Define shell
e.g. #!/bin/bash

253. Where is the network (Ethernet) file located, please provideexact directory location
and file name?
/etc/sysconfig/network-scripts/ifcfg-nic

254. Why do we use “last” command?


To see who has logged in the system whether active or logged off

255. What is RHEL Linux stands for?


Search online

256. To view your command history, which command is used and how torun a specific
command?
history and history #

257. What is NTP and briefly explain how does it work and where is theconfig files and
related commands of NTP?
Search online

258. How to disable firewall in Linux?


Search online

259. How to configure mail server relay for sendmail service?


Edit /etc/mail/sendmail.mc file and add SMART_HOST entry

260. Where is samba log file located?


/var/log/samba

261. What is mkfs command used


for?
To create a new filesystem
262. If you create a new group, which file does it get created in?
/etc/group

263. Which file has DNS server information (e.g. DNS resolution)?
/etc/resolv.conf

264. What are the commands you would run if you need to find out theversion and build date
of a package (e.g. http)?
rpm –qi http

265. On the file permissions? What are the first 3 bits for and who isit for?
Read, write and execute. They are used for the owner of the file

266. How to create a soft link?


ln –s
267. How to write a script to delete messages in a log file older
than 30 days automatically?
Search online

268. How to quit out of “man” command?


q

269. Which command is used to partition disk in Linux?


fdisk

270. What is the difference between “shutdown” and “halt” command?


Search online

271. What is the exact syntax of mounting NFS share on a client andalso how to un-mount?
Search online

272. What experience do you have with scripting, explain?


if-the, do-while, case, for loop scripts

273. How to get information on all the packages installed on thesystem?


rpm –qa

274. Explain VMWare?


Search online

275. You are tasked to examine a log file in order to find out why aparticular application
keep crashing. Log file is very lengthy,which command can you use to simplify the log search
using a search string?
grep for error, warning, failure etc. in /var/log/messages file

276. What is /etc/fstab file and explain each column of this file?
Search online

277. What the latest version of Windows server?


Search online

278. What is the exact command to list only the first 2 lines ofhistory output?
history | head -2

279. How to upgrade Linux from 7.3 to 7.4?


yum install update
281. You have tried to “cd” into a directory but you have been denied.You are not the owner of
that directory, what permissions do you need and where?

------r–x
282. What is CNAME record in DNS?
Entry for hostname to hostname

283. What is the name of VMWare operating system?


ESXi

284. What is the client name used to connect to ESXi or v Centerserver?


vSphere client

285. You get a call from a user saying that I cannot write to a file because it says,
permission denied. The file is owned by that user, how do you troubleshoot?
Give write permission on the first 3 bits

286. What is the latest version of VMWare?


Search online

287. What is the name of firewall daemon in Linux?


firewalld

288. Which command syntax you can use to list only the 20th line of afile?
Search online

289. What is the difference between run level 3 and 5?


3 = Boot system with networking, 5 = boot system with networkingand GUI

290. List a few commands that are used in troubleshooting networkrelated issue?
netstat, tcpdump etc.

291. What is the difference between domain and nameserver?


Search online

292. You open up a file and it has 3000 lines and it scrolled up really fast, which command
you will use to view it one page at atime?
more or less

293. How to start a new shell. E.g. start a new ksh shell?
Simply type ksh, or bash

294. How to kill a process?


kill processID

295. How to check scheduled jobs?


crontab –l
296. How to check system memory and CPU usage?
free and top

297. Which utility could you use to repair the corrupted file system?
fsck

298. What is the command to make a service start at boot?


systemctl enable servicename

299. How to combine 2 files into 1? E.g. you 3 lines in file “A” and 5lines in file “B”, which
command syntax to use that will combine into one file of 3+5 = 8 lines
cat fileA >> fileB

300. What is echo command used for?


To output to a screen

301.What does the following command do?echo This year the summer will be great >
file1 It will create a new file “file1” with the content as “This yearthe summer
will be great”

302. Which file to modify to allow users to run root commands


/etc/sudoers

303. You need to modify httpd.conf file but you cannot find it, Whichcommand line tool you can
use to find file?
find / -name “httpd.conf”

304. Your system crashed and being restarted, but a message appears, indicating that
the operating system cannot be found. What is themost likely cause of the problem?
The /boot file is most likely corrupted

305. Where SSH server logs generated?

306. What is connection oriented protocol?

307. What is handshake?

308. What is three-way hanshake?

309. What is journalling Factor?

310. What is init ram and init rd?

311. What is OSI model?

312. What is the 7 layer OSI model?

313. What is buffer in linux?

314. Client unable to login in server. What can you follow steps.

315. Difference between teaming & bonding?

316. What is the difference between fly & Pts?

317. What is the use of traceroute command?

318. How to install SSL


319. How to Install php?

320. What is PHP?

321. What is lamp stack?

322. How to install lamp stack?

323. How to assign crontab to user?

324. What is the difference between firewall & IP Table.

325. Troubleshooting Apache.

326. Kickstar

327. What is postifix

328. Top Command 1). Threshold value for load average. 2). Formula for calculating more
load avg. Througb nagios.

329. How to know whether the machine is physical or virtual.

330. How to exclude a particular package while patching.

331. Hoe to upgrade a machine from RHEL 7 to 8.

332. Difference between RHEL 6 and RHEL 7.

333. How to extend a vg and filesystem.

334. Steps for patching.

335. How to change the default home directly from an user.

336. STICKYBIT.

337. If Error no. 404,502 in apache then what we have to do.

338. If system doesn’t comup after patching how to troubleshoot.

339. What are the challenges you have faced and resolved on your own.

340. How to mount NFS file system.

341. Which is the default file system that is used in RHEL 8?

342. # Which feature is supported in Ext4 but not in XFS?

343. # When installing a server that uses LVM logical volumes, you’ll get at least

344. three storage volumes (partitions or LVM). Which of the following is not

345. part of them?

346. # Which of the directories would typically not be mounted on its own

347. dedicated device?

348. # Which tar option enables you to add one single file to a tar archive?
349. # Which directory would you go to if you were looking for configuration files?

350. # Which command enables you to rename the file myfile to yourfile?

351. # Which command enables you to wipe an entire directory structure, including

352. all of its contents?

353. # How do you create a link to the directory /tmp in your home directory?

354. # What is the console ?

355. # Which command(s) show(s) all users that currently have a terminal session

356. open to a Linux server?

357. # What is the name of the configuration file that needs to be edited to modify

358. SSH client settings?

359. # How do you copy the /etc/hosts file to the directory /tmp on server2 using the
username lisa?

360. # What is the name of the file in which public keys are stored for remote users

361. who want to log in to this machine using key-based authentication?

362. # Which command enables you to generate an SSH public/private key pair?

363. #what is the role of ansible?

364. #what is ansible module?

365. how to install php8.2?

366. how to install mysql80?

367. what is reverse dns?

368. how to configure virtual hosting?

369. what is the meaning of mask in acl?

370. how to mask any service?

371. how to download any rpm without internet?

372. how to make only read file system?

373. What is DNS records and how to use it?

374. What is booting process?

375. What is LVM?

You might also like