Linux Interview Questions

Last updated on Nov 11, 2023

HKR's Linux Administration interview questions and answers guide is designed to accelerate your career in Linux administration. Linux, an open-source licensed operating system, is based on kernel source and can be customized. This guide not only covers various aspects of Linux administration tools but also prepares you for complex interviews with any company. Start your journey in understanding the role and significance of Linux administration in the business workforce.

Mostly frequently Asked Linux Interview Questions and Answers

1. What is Linux?

Ans: Linux is a widely used operating system developed on the Linux Kernel foundation. Known for its open-source nature, it supports various hardware platforms. Linux is favoured for offering cost-effective, user-friendly operating solutions that are easily adaptable. The ability to customize and adapt its source code is a key advantage.

  Interested in learning Linux Join hkr and Learn more on Linux Training

2. Who first invented Linux and explain briefly about its history?

Ans: Linus Torvalds, a student at the University of Helsinki in Finland in 1991, conceived the Linux operating system. It originated as a personal project by Torvalds to create a free version of UNIX. It evolved into what we now know as the Linux Kernel.

3. What is the difference between Linux and UNIX?

Ans: Linux and UNIX differ in several ways:

  • Linux supports both free and paid distributions, while UNIX has different paid versions for various UNIX levels.
  • Linux features a Graphical User Interface (GUI) and an optional command-line interface, while UNIX primarily uses a command-line interface.
  • Linux is portable and can be executed on various hard drives, whereas UNIX is less flexible.
  • The Linux community is global, while AT&T's developer community developed UNIX.
  • Linux is freely available under GNU licenses, unlike most UNIX systems.
  • Linux caters to a broader range of devices, including personal computers, whereas UNIX is mainly used in servers.

4. What is the Core of the Linux operating system?

Ans: The core of the Linux operating system is its Kernel.

5. Explain permission types in Linux.

Ans: Linux permissions include Read (viewing files), Write (modifying files), and Execute (running files).

6. What is CLI?

Ans: CLI, or Command-Line Interface, is a user interface interacting with computer programs via text commands.

7. What is BASH?

Ans: BASH, developed for GNU projects, is a UNIX shell and command processor created by Brian Fox. It’s free software that can replace the Bourne shell and is interpreted, not compiled.

8. Explain the process management system calls in Linux.

Ans: Linux's process management includes system calls like fork() (creating new processes), exec() (executing new processes), wait() (pausing for process execution), and exit() (exiting a process). It also includes commands for retrieving process IDs.

9. Why is Linux considered more secure than other operating systems?

Ans: Linux's superior security stems from its limited default user privileges, robust auditing system, and use of IPtables for enhanced security measures.

10. What is the Linux kernel?

Ans: The Linux kernel, central to the operating system, facilitates communication between software and hardware.

  Become a UiPath Certified professional by learning this HKR Embedded Hardware Design Development Training !

11. What is LILO?

Ans: LILO, or Linux Loader, is a boot loader for the Linux operating system.

12. What is grep command in Linux?

Ans: The grep command searches for specific patterns in files or outputs.

13. What are the commands used in creating, modifying an existing file and deleting information from vi editor?

Ans: Commands in the vi editor include vi filename (creating/modifying files), view filename (opening files in read-only mode), X (deleting characters), and dd (deleting lines).

14. Explain the Linux directory commands.


Linux directory commands include:

  • Pwd (showing the current directory).
  • Ls (listing files).
  • Cd (changing directories).
  • Mkdir (creating directories).
  • Rmdir (removing directories).

15. Explain the purpose of using the “cd” command and its options.

Ans: The ‘cd’ command, used for navigating directories, has options like cd~, cd-, ., and cd/.

16. What are the features of the Linux Operating System?

Ans: Linux features portability, open-source availability, multi-user capabilities, multi-programming, a 

shell interface, and robust security.

17. What is cat command in Linux?

Ans: The cat command is used for displaying file contents and concatenating files.

18. What is meant by PIPE in Linux?

AnsPIPE in Linux is a redirection method that connects the output of one command as input to another.

19. Explain about chmod command?

Ans: The "chmod" command changes file and directory permissions in Linux.

Linux Certification Training

  • Master Your Craft
  • Lifetime LMS & Faculty Access
  • 24/7 online expert support
  • Real-world & Project Based Learning

20. How to exit from vi editors?

Ans: To exit “vi” editors, use commands like wq (save and exit) or q! (exit without saving).

21. How permissions are granted under Linux?

Ans: Permissions in Linux are managed using the chmod command with symbols like ‘+’ (add), ‘-’ (deny), and single-letter permissions for user, group, others, and all.

22. What are the different modes when using the vi editor?

Ans: The vi editor has modes like Command Mode, Insertion Mode, and Ex Mode.

23. Differentiate between Cron and Anacron?

Ans: Cron is used for scheduling tasks to execute at specific times, ideal for servers, whereas Anacron is used for tasks to run on specific dates, suitable for both desktops and servers.

24. What is env command in Linux?

Ans: The env command in Linux is used to print a list of current environment variables or to run processes in a different environment.

25. How can you append one file to another in Linux?

Ans: In Linux, files can be appended using commands like cat file2 >> file1.

26. Explain Redirection.

Ans: Redirection in Linux refers to directing data from one output to another, categorized as Input, Output, and Error Redirection.

27. What is Shell?

Ans: The Linux Shell is an interface between the Kernel and the user, facilitating command execution and script processing.

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

Ans: Default ports include SMTP (25), DNS (53), FTP (20/21), DHCP (67/68), SSH (22), and Squid (3128).

29. How to check which ports are listening in Linux Server?

Ans: To check listening ports, use commands like netstat --listen or netstat -l.

30. What Is Linux Shell?

Ans: The Linux Shell is an interface for executing commands and supports various categories like Bourne shell compatible, C shell compatible, nontraditional, and historical.

We have the perfect professional Linux Tutorial for you. Enroll now!

31. What Is Shell Script?

Ans: A shell script is a sequence of commands for the shell to control applications or perform tasks.

32. What is the advantage and disadvantage of open source?

Ans: Open-source offers flexibility and security but can present challenges in usability and compatibility.

33. What Are Pipes?

Ans: Pipes in UNIX are processes connected so that the output of one serves as the input to another.

34. How many types of shells are there in Linux?

Ans: Linux includes shells like C shell, Korn shell, Z shell, Bourne again shell, and Friendly interactive shell.

35. What Stateless Linux Server? What Feature It Offers?

Ans: A stateless Linux server does not maintain individual workstation states, storing prototypes, snapshots, and home directories for systems.

36. What are the basic components of Linux architecture?

Ans: Linux architecture includes the Kernel, Shell, GUI, System Utilities, and Application Programs.

37. What Is Bash Shell?

Ans: Bash is a free shell for UNIX, combining features of the C and Korn shells.

Related Article : How To Install Kali Linux

38. What Is A Zombie?

Ans: In Linux, a Zombie refers to a process state where the child process dies before the parent, remaining in the process table.

39. What is Swap space?

Ans: Swap space in Linux is used for managing memory, especially when physical memory runs low.

40. What is the GUI?

Ans: The GUI, or Graphical User Interface, in Linux is a user-friendly interface using windows, icons, and menus.

41. Explain the file permissions types in Linux?

Ans: File permissions in Linux include Read, Write, and Execute.

42. What are the differences between BASH and DOS?

Ans:  Differences between BASH and DOS include case sensitivity, directory separators, and command conventions.

43. What are symbolic links?

Ans: Symbolic links in Linux are like shortcuts pointing to other files or directories.

[ Related Article: Adobe CQ5 System Administrator Training ]

44. Does the CTRL+ALT+DELETE key combination work on Linux?

Ans: Yes, the CTRL+ALT+DELETE key combination works on Linux for system restart.

45. What are hard links?

Ans: Hard links in Linux directly point to the physical file on a disk.

46. What are daemons?

Ans: Daemons in Linux are background services providing various functionalities.

47. What is a Virtual desktop?

Ans: A Virtual desktop in Linux is an alternative workspace to manage multiple running programs.

48. What are I node and process ID?

Ans: An inode in Linux uniquely identifies files or directories, while a process ID uniquely identifies each process.

49. What are the process states in Linux?

Ans: Process states in Linux include New/Ready, Running, Blocked/Waiting, Terminated/Completed, and Zombie.

50. Name the file permission groups in Linux?

Ans: File permission groups in Linux include Owner, Group, and All Users.

51. What is a file system in Linux?

Ans: The Linux file system manages and stores data, defining file boundaries.

52. Why LVM is required?

Ans: LVM, standing for Logical Volume Management, is a critical tool in modern storage management. It offers enhanced flexibility by allowing users to create, resize, and delete disk partitions on-the-fly. LVM elevates storage management by offering increased abstraction and control, integrating various storage devices, and facilitating efficient allocation of logical volumes.

53. What is Umask?

Ans: Unmask, short for user file creation mode mask, sets default file access permissions. When a file is created, Umask determines its initial access rights, adding a layer of security by applying specific restrictions to new files.

54. How to set the mask permanently for a user?

Ans: Setting a Umask permanently can be done through two methods: octal or symbolic representation. This ensures consistent file creation permissions, aligning with security protocols.

55. What are the different modes of network bonding in Linux?

Ans: Linux supports six modes of network bonding: Mode-0 (Balance-rr), Mode-1 (active-backup), Mode-2 (balance-Xor), Mode-3 (broadcast), Mode-4 (802.3ad), and Mode-5 (balance-tlb), each offering unique benefits for network resilience and performance.

56. Where are kernel modules located?

Ans: Kernel modules reside in lib/modules/kernel-version/, storing compiled drivers' crucial information. The lsmod command reveals installed kernel modules.

HKR Trainings Logo

Subscribe to our YouTube channel to get new updates..!

57. What is the difference between Linux Vs Windows?

Ans: Linux is free, open-source, customizable, offers high security, and supports both primary and logical partitioning for booting. In contrast, Windows is purchasable, not open-source, non-customizable, less resilient to viruses, and supports booting only from primary partitions.

58. What do you understand about Linux?

Ans. Linux is an open-source, widely used OS based on the Linux Kernel, supporting diverse hardware and platforms. Renowned for its security and cost-effectiveness, it's a top choice for developers and offers multi-system installation at no cost.

59. Distinguish between Linux and Unix OS.

Ans: Linux is portable, comes in both free and paid editions, primarily uses a GUI with an optional CLI, and is open-source. Unix, in contrast, is mostly paid, used in servers and PCs, is not open-source, and its source code is not publicly available.

60. Define the core of the Linux Operating System?

Ans: The Kernel is the core of Linux OS, comprising various modules and managing all critical system activities.

61. What is the history behind the invention of Linux?

Ans. Developed by Linus Torvalds in 1991 at the University of Helsinki, the Linux OS was named after the Linux Kernel, a software enabling user and application interactions with the system's devices.

62. Explain LILO in Linux?

Ans. LILO, or Linux Loader, is a boot loader in Linux, playing a crucial role in loading the OS into memory for operation initiation.

63. Define Linux Kernel?

Ans. The Linux Kernel is at the heart of the Linux OS, responsible for all system actions and acting as an interface between software processes and hardware. It manages requests from applications to hardware components.

64. What do you mean by BASH in Linux?

Ans. Bash, a Unix shell and command processor, is an advanced version of the Bourne Shell, part of the GNU project, and facilitates command execution from shell scripts.

65. Explain CLI?

Ans. CLI, or Command Line Interface, is a text-based interaction system where users execute commands via text lines, offering efficiency and speed over graphical interfaces.

66. Define the benefits of Open Source OS?

Ans: Open Source OS, like Linux, offers accessibility, modifiability, and enhanced security, providing various user options and fostering innovation.

67. Explain the drawbacks of Open Source OS?

Ans. Challenges of Open Source OS include usability complexity, compatibility issues, limited technical support, potential security risks, and hidden long-term costs.

68. What is called a Shell in Linux?

Ans. A shell in Linux is an interface between the user and the Kernel, allowing program and command execution.

69. Define the different types of Shells in Linux?

Ans. Linux hosts various shells: C Shell (Csh), Z Shell (Zsh), Friendly Interactive Shell (Fish), Korn Shell (Ksh), and Bourne Again Shell (bash), each offering unique features and functionalities.

70. Name the basic Linus components?

Ans. Linux's basic components include the Kernel (system core), Shell (user-kernel interface), GUI (Graphical User Interface), Utilities (system management tools), Application Programs (task-specific software), and Hardware (physical devices).

71. Define how to open a command prompt while issuing a command in Linux?

AnsTo open a terminal in Linux, press CTRL+ALT+T or search for 'terminal' in the menu search bar.

72. Explain Swap Space?

Ans: Swap Space in Linux acts as a backup for RAM, moving inactive pages to swap space when memory is insufficient.

73. Define GUI?

Ans: GUI, or Graphical User Interface, in Linux uses windows, icons, and graphics, operated via mouse or keyboard, enhancing user interaction with the system.

74. What are the different types of File Permissions in Linux?

Ans. Linux file permissions include Read (viewing files), Write (modifying files), and Execute (running programs or files).

75. Explain the Environment Variables in Linux?

Ans. Environment Variables in Linux are dynamic values affecting system processes, customizable for different functionalities.

76. Define Symbolic links in Linux?

Ans. Symbolic links (Symlinks) in Linux point to other files or folders, acting similarly to shortcuts.

77. What is a Hard link in Linux OS?

Ans: A Hard link in Linux is a direct pointer to a file's location on the hard drive, independent of the original file's name or location changes.

78. What is meant by Redirection in Linux?

Ans: Redirection in Linux changes the standard input/output paths, using metacharacters for file or program direction.

79. Explain what are called Daemons?

Ans: Daemons are background processes or programs in Linux, handling requests and system maintenance without direct user interaction.

80. Define the Root account?

Ans. The root account in Linux is a superuser with full system access, capable of performing tasks like software installation and file permission changes.

81. Explain what is meant by Virtual Desktop?

Ans. A Virtual Desktop in Linux is a user interface for managing windows, offering an alternative for desktop management.

82. Define the multiple modes useful while using the vi editor?

Ans. The vi editor in Linux has three modes: Command Mode, Insert or Edit Mode, and Ex-command Mode.

83. What do you mean by Inode and Process id?

Ans. Inode in Linux uniquely identifies files, while Process ID is a unique identifier for each running process.

84. Define the various Process states in Linux OS?

Ans. Linux OS has five process states: Running, Sleeping, Stopped, Uninterruptible, and Zombie, each representing a different stage of a process lifecycle.

85. What do you mean by Process Management System Calls in Linux?

Ans. Process Management System Calls in Linux are interfaces between user programs and the OS, managing processes through various functions like fork(), exec(), getpid(), wait(), exit(), and getppid().

86. What are the different File Permission groups?

Ans. File Permission groups in Linux include Owner (specific user access), All Users (universal access), and Group (restricted group access).

87. Define the File system in Linux?

Ans: The File System in Linux is a crucial component for data management and storage, organizing files within the system.

88. Define various file system types available in Linux?

Ans. Linux supports a variety of file systems including Ext, Ext2, Ext3, Ext4, JFS, ufs, ReiserFS, XFS, btrfs, ntfs, and swap files.

89. Why LVM is required?

Ans. LVM in Linux, essential for managing large storage volumes, provides flexibility in creating, resizing, and deleting partitions, and enhances storage control and abstraction.

90. What is Umask in Linux?

Ans. Unmask in Linux sets default permissions for new files and directories, applying restrictions to enhance security.

91. How can you set the mask for a specific user forever?

AnsTo set a user's Umask permanently, use either octal or symbolic representation, shaping file and directory permissions.

92. Define Network Bonding in Linux?

Ans: Network Bonding in Linux combines multiple network interfaces into one, improving performance and redundancy.

93. Explain the various modes of Network Bonding?

AnsLinux's network bonding modes include Mode-0(balance-rr), Mode-1(active-backup), Mode-2(xor), Mode-3(broadcast), Mode-4(dynamic aggregation), Mode-5(adaptive load-balancing), and Mode-6(adaptive load-sharing).

94. Define the method to check the Default route and Routing table?

Ans. To check the default route and routing table in Linux, use commands like route -n, netstat -rn, and ip.

95. Explain the method of checking ports that are listening in the Linux Server?

Ans. To check listening ports on a Linux Server, use commands like netstat --listen or netstat -l.

96. What is the location of Kernel modules in Linux?

Ans. Kernel modules in Linux are located in lib/modules/kernel-version/, storing information about compiled drivers.

97. Define the method to modify the default Run level in Linux?

Ans. The 'init' command is used to alter the default run level in the Linux Operating System.

98. Explain the method to share a directory using NFS?

Ans: Sharing a directory using NFS involves editing the '/etc/exports' file, making an entry like '/', and restarting the NFS service in Linux OS.

99. Define the way to lock a user account in Linux OS?

Ans: To lock a user account in Linux OS, use the 'passwd' command to lock or remove the account password. The 'usermod' or 'change' command can end the user account. Alternatively, use the 'nologin' command to alter the shell for security purposes.

Linux Certification Training

Weekday / Weekend Batches

100. What is meant by the 'ls' command and how does it perform?

Ans: The 'ls' command in Linux OS lists files and directories. Using it without arguments lists files in the current directory. It can also display files in alphabetical order and list specific directory files using the directory name in the syntax.

101. define the use of the Tail command in Linux?

Ans: In Linux OS, the Tail command displays the last N number of lines from the provided data, defaulting to the last 10 lines. The syntax is 'tail [OPTION]... [FILE]'.

102. Define the ‘grep’ command in Linux?

AnsThe 'grep' command in Linux is a filter used for searching text through regular expressions. The syntax is 'grep [options] pattern [files]'.

103. What is the use of the ‘ps’ command in Linux OS?

Ans: The 'ps' command in Linux OS displays the current process status of the system, including process IDs and other related data. The syntax is 'Ps [options]'.

104. Define the ‘env’ command’s use?

Ans: The 'env' command in Linux is a shell command used to print a list of current environment variables and can run another process in a different environment without changing the current one.

105. Define the use of the ‘top’ Command in Linux?

Ans: The 'top' command in Linux OS, referring to the Table of Processes, displays and updates arranged process data, showing the system process.

106. Explain what is ‘netstat’ command in Linux?

Ans: The 'netstat' command in Linux provides information on network status, routing tables, interface statistics, connections, and more.

107. Define the use of the ‘lsof’ command in Linux OS?

Ans: The 'lsof' command in Linux OS, standing for List of Files, is used to identify files opened by any process.

108. Explain the ‘chmod’ command?

Ans: The 'chmod' command in Linux is used for changing access permissions to scripts, system files, and directories. It represents permissions like read (4), write (2), and execute (1).

109. Define the ‘cp’ command in Linux?

Ans: The 'cp' command in Linux is used for copying files and directories within the system. The syntax is '$ cp filename'.

110. Define the command used to remove a file or directory from the system?

Ans: The 'rm' command in Linux is utilized to delete files or directories. It offers various options for safe and selective removal, such as '-i' for confirmation and '-f' for forceful deletion.

111. Define the command ‘mkdir’ in Linux?

Ans: The 'mkdir' command in Linux allows users to create directories, enabling the creation of multiple directories at once with assigned permissions. The syntax is 'mkdir [options...] [directories ...]'.

112. What is meant by ‘rmdir’ command in Linux?

Ans: The 'rmdir' command in Linux is used to delete each directory specified on the command line. The syntax is 'rmdir [-p] [-v | –verbose] [–ignore-fail-on-non-empty] directories'.

113. What is the process to exit from vi editors in Linux?

Ans: To exit from the vi editor in Linux, use 'Wq' to save and exit, or 'q!' to exit without saving.

114. Explain the process to remove data from a file in vi editors?

Ans: In vi editors, use the command 'x' to remove a character and 'dd' to remove a line for editing files.

115. List the Linux File content commands?

Ans: Linux file content commands include 'head' for showing top lines, 'cat' for concatenating files, 'tail' for displaying ending lines, and 'more' for paginated viewing.

116. List out some Linux Distributors (Distros) and their uses?

Ans: Linux Distributors include Linux Mint for robust use, openSUSE for new users, Ubuntu for desktop and server editions, Manjaro for a satisfying user experience, and Debian for stability and user-friendliness.

117. What is the reason that we use LINUX OS?

Ans. LINUX OS is used for its high stability, ease of operation, hardware compatibility, security, and open-source nature.

118. Define the various features of the Linux OS?

Ans: Linux OS features include portability across hardware, multi-user capabilities, high security, support for multiprogramming, and a shell for command execution.

119. Distinguish between BASH and DOS in Linux?

Ans: Differences between Bash and DOS in Linux include case sensitivity, path separators, and command structures in Bash, while DOS commands are not case-sensitive and follow different naming protocols.

120. Define internal commands and external commands in Linux OS?

Ans. Internal commands in Linux are run directly by the shell without a separate process. External commands have their own process ID and are run by the Kernel.

121. Define the process of communication between a parent and child processes?

Ans: Communication between parent and child processes in Linux involves sockets, pipes, message queues, and other inter-process communication mechanisms.

122. What does Stateless Linux Server mean?

Ans: A Stateless Linux Server does not store states on workstations and may snapshot specific system states for outline requirements.

123. Define the use of the ip tables command in Linux.

Ans: The 'ip tables' command in Linux is used for managing network traffic, functioning like a network firewall to block or allow traffic.

124. What is the use of the pushd command in Linux?

Ans: The 'pushd' command in Linux saves the current working directory in memory or stack for later retrieval.

125. Define the use of the “du” command in Linux.

Ans: The 'du' command in Linux is used for quickly checking disk usage or the number of blocks used by a file.

126. Define “df -i” and “df -h” commands in Linux.

Ans: The 'df -h' command in Linux shows free space in the file system, while 'df -i' displays the number of free inodes.

127. Name the command to check who is logged in.

Ans. The 'W' command in Linux shows who is logged into the system.

128. What is meant by SMTP?

Ans: SMTP stands for Simple Mail Transfer Protocol, an internet standard for email transmission.

129. How can you decompress GZIP files in Linux?

Ans: GZIP files in Linux can be decompressed using the 'gunzip' command.

130. What is the use of the MD5 option in Linux?

Ans: The MD5 option in Linux, a Message-Digest Algorithm, is used for encrypting passwords before storage and for message authentication.

131. List out the basic commands used in Linux for user management.

AnsBasic Linux commands for user management include 'useradd', 'chmod', 'chown', 'usermod', 'change', 'userdel', 'delgroup', 'last', and 'chsh'.

132. What is the length of a filename in Linux?

Ans: The maximum length of a filename in Linux is 255 characters.

133. What is the command to view Kernel Boot messages in Linux?

Ans: The 'dmesg' command is used to view Kernel Boot messages in Linux.

134. Define the use of the Ping command in Linux.

Ans: The Ping command in Linux, known as Packet Internet Groper, checks network connectivity between the host and server.

135. Why do we use the “fstab” command in Linux?

Ans: The 'fstab' command in Linux, referring to the filesystem table, is used for easier mounting and unmounting of file systems.

136. Define the “Nameless” directory in the Linux file system.

Ans. The "Nameless" directory in the Linux file system is an empty directory that functions as an attachment point for other directories, files, drives, etc.

137. Which commands do you use to check the memory status?

Ans: To check memory status in Linux, use 'Free -m' for data in MB and 'Free -g' for data in GB.

138. Which command joins two lines from two organized files within Linux?

Ans: To join two lines from two organized files in Linux, use the "comm file1 file2" command.

139. How can you examine the usage of resources?

Ans: To examine resource usage in Linux, use the '/usr/bin/time -v ls' command.

140. How to enable ACLs for the /home partition?

Ans: Enable ACLs for the /home partition by checking if ACLs are enabled with the mount command, editing the /etc/fstab file to include the acl option for the /home partition, saving the changes, and then remounting the /home partition with sudo mount -o remount /home. Verify ACLs are enabled with the mount command again.

141. Is there any relation between the modprobe.conf file and network devices?

Ans: The modprobe.conf file is related to network devices as it specifies which kernel module to load for each device. For example, an entry like "alias eth0 b44" in modprobe.conf would associate the eth0 network device with the b44 kernel module.

142. If a volume group named VG0 already exists and we need to extend this volume group up to 4 GB, how do we do it?

Ans: To extend an existing VG0 volume group to 4 GB, first check the available space with vgdisplay. If needed, add physical volumes with pvcreate, extend VG0 with vgextend, and then use lvextend to increase the size of the logical volume to 4 GB. Finally, resize the filesystem using either resize2fs or xfs_growfs.

143. What shell does a Linux Administrator assign to a POP3 mail-only account?

Ans: A Linux Administrator typically assigns either the /bin/false or /bin/no login shell to a POP3 mail-only account to prevent login access.

144. In Linux, how would you change the window manager?

Ans: To change the window manager in Linux, modify the /.xinitrc file with the command exec window_manager_name. This sets the specified window manager to launch when the start command is run.

145. Can we convert a Linux computer into a router in order to enable multiple machines to work on the same Internet connection? If yes, how?

Ans: Yes, a Linux computer can be converted into a router. Enable IP forwarding, set up IP addresses, enable NAT with iptables, configure packet forwarding rules, set up DNS forwarding, update routing tables, and enable IP forwarding on boot to allow multiple machines to use the same Internet connection.

146. Which command is used to check the number of files, disk space, and each user's defined quota?

Ans: The "repquota" command is used to check the number of files, disk space, and each user's defined quota in Linux.

147. How would you restore the original kernel system files after a hacked FTP server?

Ans: To restore original kernel system files after a hacked FTP server, first reinstall the core operating system, and then restore the system configuration files and user data from tape backup.

148. What command can you use to make a tape archive file of the /home directory and send it to the /dev/tape device?

Ans: To create a tape archive file of the /home directory and send it to the /dev/tape device, use the command tar -cvf /dev/tape /home.

149. What are the two different kinds of Linux User Modes?

Ans: The two primary Linux User Modes are Command Line Mode and Graphical User Interface (GUI) Mode. Command Line Mode involves text-based commands, while GUI Mode provides a visual interface with windows, icons, and menus.

150. What is the maximum length of a filename in Linux?

Ans: The maximum length of a filename in Linux is 255 characters, excluding the path name.

151. What is LD_LIBRARY_PATH?

Ans: LD_LIBRARY_PATH is an environment variable in Linux that specifies the directories to be searched for loading libraries during the runtime of an application.

152. Suppose, you wish to print a file

Ans: To print a file 'draft' with 60 lines on each page, use the command pr -l60 draft.

153. How can a Linux computer be converted into a router?

Ans: Convert a Linux computer into a router by enabling IP forwarding, setting up IP addresses, enabling NAT, configuring packet forwarding rules, setting up DNS forwarding, updating routing tables, and enabling IP forwarding on boot.

154. How can password security be enhanced?

Ans: Enhance password security by enforcing password complexity, setting expiration and rotation policies, enabling Multi-Factor Authentication (MFA), implementing account lockouts and failed login attempt restrictions, educating users on password security, and storing passwords in hashed and salted formats.

155. What is a soft link in Linux?

Ans: A soft link, or symbolic link, in Linux is a type of file that points to another file or directory. It is created with the command ln -s [original filename] [link name] and can be used across different file systems.

156. How can the size of LVM be shrunk?

Ans: Shrinking the size of an LVM in Linux involves reducing the size of the logical volume using the lvreduce command and then resizing the filesystem to match the new size of the logical volume.

157. What is a shell?

Ans: A shell in Linux is an interface that allows users to interact with the operating system, facilitating the execution of commands and scripts.

158. What do you mean by shell scripting?

Ans: Shell scripting in Linux is the process of writing a series of commands in a file to automate tasks and create custom commands.

159. What is the importance of writing shell scripts?

Ans: Writing shell scripts is important for automating tasks, creating custom commands, saving time, and automating system administration tasks.

160. List some of the common and mostly used Linux commands?

Ans. Common Linux commands include 'ls' for listing files, 'mkdir' for creating directories, 'rmdir' for removing directories, 'cp' for copying files, 'rm' for removing files, 'mv' for moving files, 'touch' for creating empty files, and 'cat' for displaying file contents.

161. What are the different types of commonly used shells on a typical Linux system?

Ans: Commonly used shells in Linux include the Bourne shell (Sh), C shell (csh), Korn shell (ksh), and Bourne again shell (bash).

162. What are the differences between soft and hard links?

Ans: Soft links are just links that define a name and are stored on different file systems. Hard links link to the inode of the file system and are also stored on different file systems.

163. Shell programs are stored in which file?

Ans: Shell programs are stored in a file system named “sh”.

164. What are the advantages of the C shell over the Bourne shell?

Ans: Advantages of the C shell over the Bourne shell include the ability to alias commands, use personal commands, command history features, and the ease of not having to type commands repeatedly.

165. Is a separate compiler required for executing a shell program?

Ans: No separate compiler is required in Linux to execute shell programs. The shell interprets and executes the commands in the programs.

166. When should shell programming or scripting not be used?

Ans: Shell programming or scripting should not be used for complex programs, high-level productivity tasks, or when working with different software tools.

167. What are the two types of shell variables available? Explain in brief?

Ans: The two types of shell variables are system variables (usually in CAPITAL letters) and user-defined variables (defined in lowercase). System variables are predefined, like SHELL, while user-defined variables are set by the user.

168. How are shell variables stored? Explain them with an example?

Ans: Linux shell variables are stored as strings. For example, in $ a=50, '50' is stored as a string in the variable 'a'.

169. Explain about file permission?

Ans: File permissions in Linux include read (r), write (w), and execute (x) permissions, with weights of 4, 2, and 1 respectively.

170. What are the three modes of operations of vi editor? Explain in brief?

Ans: The three modes of the vi editor are Command mode (interprets keys as editor commands), Insert mode (allows text insertion and editing), and ex-command mode (enables the insertion of commands at the command line).

About Author

A technical lead content writer in HKR Trainings with an expertise in delivering content on the market demanding technologies like Networking, Storage & Virtualization,Cyber Security & SIEM Tools, Server Administration, Operating System & Administration, IAM Tools, Cloud Computing, etc. She does a great job in creating wonderful content for the users and always keeps updated with the latest trends in the market. To know more information connect her on Linkedin, Twitter, and Facebook.

Upcoming Linux Certification Training Online classes

Batch starts on 21st Jul 2024
Mon - Fri (18 Days) Weekend Timings - 10:30 AM IST
Batch starts on 25th Jul 2024
Mon & Tue (5 Days) Weekday Timings - 08:30 AM IST
Batch starts on 29th Jul 2024
Mon & Tue (5 Days) Weekday Timings - 08:30 AM IST
To Top