Freshers Registration

Top 100 Linux Interview Questions and Answers

linux-interview-questions

This article provides the Top 100 Linux Interview Questions and Answers that cover all aspects of the framework, including Linux Interview Questions for Freshers, and Latest Linux Interview Questions and Answers.

★★ Latest Technical Interview Questions ★★

Linux Technical Interview Questions

The collection of Linux interview questions in this list covers various aspects, including technical and beginner-level questions. By reviewing the Top 100 Linux Interview Questions and Answers, you can enhance your understanding of Linux concepts and increase your chances of performing well in your next Linux interview. Whether you are a fresher or an experienced professional, these questions can be a valuable resource to prepare yourself for the Linux Technical Interview Questions.

Top 100 Linux Interview Questions and Answers

1. What is Linux and how is it different from other operating systems?

Linux is a free and open-source operating system that is based on the Unix operating system. It is different from other operating systems in that it is highly customizable, with users having full control over the system’s source code, and it is not owned by any one company or entity. It is also highly secure, reliable, and stable.


2. What do you mean by a Process state in Linux?

Linux Process is a type of process that can be in a number of different states. The process enters these states from start to end. Process states in Linux are as follows:

  • New/ Ready: A new process is created and ready to run.
  • Running: The process is being executed.
  • Blocked/ Wait: The process is waiting for input from the user or lacking resources like memory or file locks, which can cause it to remain in a waiting or blocked state.
  • Terminated/ Completed: The process has completed execution or has been terminated by the OS.
  • Zombie: The process is terminated, but information about the process remains in the process table.

2 q


3. Explain the Linux boot process.

The Linux boot process involves several stages. Firstly, the system firmware (e.g. BIOS) performs a Power-On Self-Test (POST) to check hardware components. Then, the bootloader (e.g. GRUB) is loaded, which locates and loads the Linux kernel. The kernel initializes the hardware, sets up memory management, and mounts the root file system. The init process is then started, which sets up the system and launches system services and user-level processes.


4. What is the syntax to display the contents of a file on the command line?

The command is cat [file]. For example, cat myfile.txt.


5. What is the Linux kernel, and how does it relate to the operating system as a whole?

The Linux kernel is the core of the operating system, responsible for managing system resources such as the CPU, memory, and input/output devices. It communicates directly with the hardware and provides an interface for user-level processes to interact with the system. The kernel also provides a system call interface, which allows applications to request services from the kernel.


6. Name different types of modes used in the VI editor.

VI editors (Visual Editor) is basically a default text editor that usually comes with most of the Linux OS. There are basically three types of modes used in the VI editor as given below:

  • Command Mode/Regular Mode: The default mode for vi editors used to type commands that perform specific vi functions. To enter this mode from Insertion Mode, press [esc]. It lets you view content.
  • Insertion Mode/Edit Mode: This mode allows text editing or typing text into a file. To enter from Command Mode, press [esc]. It lets you delete or insert text.
  • Ex Mode/Replacement Mode: This mode is used to save files and execute commands. It executes files with different parameters. To enter this mode, press [:]. It lets you overwrite content or text.

6q


7. How is memory management handled in Linux?

Memory management in Linux is handled by the kernel, which allocates and deallocates memory as needed. The kernel provides a virtual memory system, which allows processes to have their own virtual address spaces, isolating them from one another. The kernel also uses various techniques such as paging and swapping to manage memory effectively.


8. What is the difference between a process and a thread in Linux?

A process in Linux is an instance of a program in execution, with its own memory space and system resources. A thread, on the other hand, is a lightweight process that shares memory and other resources with other threads in the same process. Threads are often used to improve application performance by allowing multiple tasks to be performed concurrently within a single process.


9. What is the difference between a soft link and a hard link in Linux?

  • A soft link (also called a symbolic link) is a file that points to another file or directory by its name. It acts as a shortcut or alias to the original file or directory and can be created across different file systems.
  • A hard link is a file that points to the same inode as the original file or directory. It creates a second reference to the same data, and cannot be created across different file systems.

10. Name three standard streams in Linux.

Standard streams refer to the Input and Output (I/O) communication channels that exist between a program and its environment in Linux. In Linux, the input and output operations are spread across three standard streams, which are:

  • Standard Input (stdin)
  • Standard Output (stdout)
  • Standard Error (stderr)

10q


11. How can you check disk usage in Linux?

  • You can check disk usage in Linux by using the df command, which displays information about file system disk space usage.
  • You can also use the du command, which displays the disk usage of a particular directory or file.

12. Explain the role of the cron daemon in Linux, and how is it used.

  • The cron daemon is a time-based job scheduler in Linux that runs in the background and executes scheduled commands or scripts at specified times or intervals.
  • It reads the crontab files, which contain the schedule and commands to be executed, and manages the scheduled tasks.

13. How is input/output (I/O) handled in Linux?

  • Input/output (I/O) operations in Linux are handled by device drivers, which communicate with hardware devices such as disks, network adapters, and USB devices.
  • Linux uses a file system abstraction for all I/O operations, treating all devices and files as if they were regular files.
  • The kernel provides various I/O subsystems such as block I/O, network I/O, and memory-mapped I/O, which allow applications to perform I/O operations efficiently.

14. What is a Zombie Process?

In Linux, a Zombie Process, also known as a defunct or dead process, is a process that has completed execution, but its entry remains in the process table. This situation typically occurs due to a lack of communication between parent and child processes. When the child process finishes execution, it needs to communicate its status to the parent process through the wait system call. Once the parent process reads the status of the child process and completes the necessary tasks, the Zombie Process is removed from the process table.

14q


15. What is the purpose of the /proc filesystem in Linux, and how does it work?

  • The /proc filesystem in Linux is a virtual file system that provides information about the system and its processes. It does not contain actual files but rather dynamically generates information when accessed.
  • The /proc filesystem allows applications and utilities to access the system and process information through a hierarchical structure of virtual files and directories.

16. How is security handled in Linux?

  • Security in Linux is handled through various mechanisms such as permissions, access control lists, and security modules.
  • Linux uses a permission system that restricts access to files and directories based on the user, group, and file permissions. Access control lists provide a finer-grained access control system.
  • Security modules such as SELinux and AppArmor provide additional security by enforcing mandatory access control policies.

17. How do you delete a file or directory in Linux using the command line?

The syntax is rm [file/directory]. For example, rm myfile.txt.


18. Explain the difference between a dynamic and a static library in Linux.

  • A dynamic library is a shared library that is loaded into memory at runtime and can be used by multiple applications. It is linked to the application dynamically, and changes to the library affect all applications using it.
  • A static library is a library that is linked to the application at compile time and is included in the final executable. It cannot be shared among multiple applications, and changes to the library require recompilation of the application

19. What is the difference between a local and a global variable in Linux?

  • A local variable is a variable that is defined within a function or block and has a limited scope, meaning it is accessible only within that function or block.
  • A global variable is a variable that is defined outside of any function or block and has a global scope, meaning it can be accessed by any function or block within the program.

20. What is the syntax to copy a file from one directory to another in Linux

The syntax is cp [source file] [destination directory]. For example, cp myfile.txt /home/john.


21. What is the maximum length for a filename under Linux?

The maximum length for a filename under Linux is 255 bytes.


22. What is the purpose of the /sbin directory in Linux?

  • The /sbin directory in Linux contains system administration binaries that are required to manage and configure the system.
  • The binaries in /sbin are typically used by the root user or system administrator and are not intended for regular user access.

23. How does Linux handle file permissions and ownership?

Linux uses a permissions system to control access to files and directories. Each file and directory has a set of permissions that determine which users or groups can read, write, or execute the file. Ownership is also used to control access, with each file and directory having an owner and a group owner. The owner and group owner can be assigned different permissions to control access.


24. Explain the difference between hard links and symbolic links in Linux.

Hard links and symbolic links are two types of links used in Linux. A hard link is a link that points directly to a file on the file system and behaves as if it were the original file. A symbolic link, on the other hand, is a special file that points to another file by name and behaves as if it were the file it points to. The main difference is that a symbolic link can point to a file or directory on a different file system or even a non-existent file, while a hard link can only point to a file on the same file system.


25. What is the purpose of the /etc/password file in Linux, and what information does it contain?

The /etc/password file in Linux contains information about user accounts on the system, including usernames, user IDs, group IDs, home directories, and login shells. It is used by various system utilities and applications to authenticate users and determine their permissions on the system.


26. What is a shell in Linux, and how does it differ from the kernel?

A shell is a command-line interface that allows users to interact with the operating system by entering commands. It interprets user commands and communicates with the kernel to execute those commands. The kernel, on the other hand, is the core of the operating system that manages hardware resources and provides services to the applications. It is responsible for controlling the hardware, managing memory, and handling input/output operations.


27. Under the Linux system, what is the typical size for swap partitions?

The typical size for a swap partition under a Linux system should be twice the amount of physical memory or RAM available on the system.


28. How can you check the Linux system information?

You can check Linux system information by using various command-line tools such as name, lsb_release, cat /etc/os-release, and hostnamectl. These tools display information about the Linux distribution, kernel version, hostname, and other system details.


29. What is the difference between Linux and UNIX?

Linux is an open-source operating system that is based on the Unix operating system. While both Linux and UNIX share similar features and commands, they differ in terms of licensing, development, and distribution. Linux is free and open-source, developed by a community of developers, and distributed under various licenses. UNIX, on the other hand, is a proprietary operating system that is developed and sold by various vendors.


30. Explain the concept of virtual memory in Linux.

Virtual memory is a technique used by the operating system to provide more memory to applications than what is physically available on the system. It does this by temporarily transferring data from RAM to disk storage, allowing the system to free up physical memory for other applications. The process of moving data between physical memory and disk storage is known as paging. Linux uses a combination of paging and swapping to manage virtual memory.


31. Name the Linux that is specially designed by Sun Microsystem.

Linux which is specially designed by Sun Microsystems is Solaris.


32. What is the role of the init process in Linux, and how does it work?

The init process is the first process started by the Linux kernel during system bootup. Its primary role is to start and manage other system processes, including services and daemons. The init process reads the configuration files in /etc/init.d/ and /etc/RC.d/ directories and executes the startup scripts for each service. In modern Linux systems, the init process has been replaced by systems, which provide advanced features such as parallel startup, dependency-based boot sequencing, and process monitoring.


33. What is the syntax to change the permissions of a file or directory in Linux?

The command is chmod [permission] [file/directory]. For example, chmod 755 myfile.txt.


34. How is device management handled in Linux?

Device management in Linux is handled by the kernel and device drivers. The kernel communicates with the device drivers to provide access to hardware devices such as disk drives, network adapters, and USB devices. Linux uses a device file system to manage hardware devices, where each device is represented by a file in the /dev directory. The device file system allows applications to interact with hardware devices by reading from and writing to the device files.


35. What is a socket in Linux, and how is it used?

A socket is a communication endpoint that allows processes to communicate with each other over a network. In Linux, sockets are used to implement various network protocols such as TCP/IP, UDP, and Unix domain sockets. A socket is identified by a unique IP address and port number. Applications use sockets to send and receive data over the network.


36. What is the purpose of the /usr/sbin directory in Linux?

  • Contains system administration binaries that are used by the system administrator.
  • These binaries are not intended to be used directly by normal users.

37. How are hardware detection and configuration handled in Linux?

  • Linux uses kernel modules to detect and configure hardware.
  • These modules are loaded at boot time or when the hardware is connected.

38. Explain the difference between a server and a client in Linux.

  • A server is a computer program or device that provides a service to other computers or devices on a network.
  • A client is a computer program or device that requests services from a server.

39. What is the purpose of the /var/log directory in Linux, and what type of data is typically stored there?

  • The /var/log directory contains log files generated by various system services and applications.
  • The data stored here include system messages, error logs, and application logs.

40. How is system-wide environment configuration managed in Linux?

  • System-wide environment variables are usually set in files located in the /etc directory.
  • The most common files are /etc/profile and /etc/environment.

41. What is the purpose of the /usr/include directory in Linux?

  • The /usr/include directory contains header files that are required for software development.
  • These header files define the interface to system libraries and kernel interfaces.

42. Explain the concept of a virtual machine in Linux.

  • A virtual machine is a software environment that emulates a physical computer.
  • It allows multiple operating systems to run simultaneously on the same physical hardware.

43. What is the purpose of the /usr/lib directory in Linux?

  • The /usr/lib directory contains shared libraries that are used by system programs and applications.
  • These libraries contain code that is used by multiple programs to perform common functions.

44. How are software installation and updates managed in Linux?

  • Linux distributions use package managers to install, remove, and update software.
  • The most popular package managers are APT, RPM, and Pacman.

45. Explain the purpose of the /usr/local/bin directory in Linux.

  • The /usr/local/bin directory contains executables that are installed locally on the system.
  • These executables are not managed by the system package manager and are installed by the user or system administrator.

46. Explain the purpose of the /etc/fstab file in Linux.

The /etc/fstab file is a configuration file in Linux that contains information about the file systems and partitions mounted at system startup. It defines the file system type, mount options, and device locations for each partition. The fstab file is used by the mount command to mount file systems and partitions at system startup.


47. What is a package manager in Linux, and how is it used?

A package manager is a software tool that automates the installation, updating, and removal of software packages on a Linux system. It manages a database of available packages and their dependencies, ensuring that all required packages are installed and configured correctly


48. Explain the difference between a hard drive and a partition in Linux.

A hard drive is a physical device that stores data permanently, while a partition is a logical division within a hard drive that separates data into distinct areas. In Linux, partitions are typically used to separate the operating system files from user data, allowing for more efficient storage and management.


49. How do you create a symbolic link in Linux using the command line?

The syntax is ln -s [source file] [destination file]. For example, ln -s myfile.txt mylink.txt.


50. What distinguishes open-source software from proprietary software in the context of Linux?

Open-Source Software Proprietary Software
Can be freely accessed, used, modified, and redistributed Is typically licensed and restricted by the owner
Often developed collaboratively by a community of users Is usually developed by a single company or individual
Can benefit from a large community of developers and users May be developed by a smaller team or individual
May have fewer bugs and security vulnerabilities due to community involvement in development and testing May have more frequent updates and patches due to dedicated support and development teams

 


51. How does Linux handle networking?

Linux includes a wide range of networking tools and protocols, including support for TCP/IP, DNS, DHCP, and many others. Linux also includes tools for configuring network interfaces and routing tables, as well as firewalls and other security features.


52. What is the difference between TCP and UDP in Linux?

TCP and UDP are both transport layer protocols used in networking. TCP provides reliable, ordered communication between applications, while UDP provides faster, but less reliable and unordered communication. TCP is used for applications like file transfers, email, and web browsing, while UDP is used for real-time applications like video conferencing and online gaming.


53. How can you check system uptime in Linux?

You can check the system uptime in Linux using the “uptime” command, which will display the current time, how long the system has been running, and the number of users currently logged in.


54. What is the difference between a package manager and a package installer in Linux?

Package Manager Package Installer
Manages software repositories and dependencies Installs software from a package file
Can update and remove packages as well as install them Can only install packages
Provides a centralized and consistent way to manage software May require manual dependency resolution and management
May include features like search, dependency tracking, and version control Does not include these features

 


55. Explain the purpose of the /etc/shadow file in Linux.

The /etc/shadow file is a system file in Linux that contains encrypted password information for user accounts. This file is only readable by the root user and is used to enhance the security of the system by protecting user passwords from unauthorized access.


56. What is the purpose of the /var directory in Linux, and what type of data is typically stored there?

The /var directory in Linux is used to store variable data files that can change in size or content over time, such as log files, email queues, and temporary files. This directory is separate from the system files stored in the /etc and /bin directories and is typically located on a separate partition to prevent issues with disk space.


57. In what ways is the Bash shell different from other command line interfaces in Linux?

Bash Shell Other Command Line Interfaces
Supports command line editing and history May not support command-line editing and history
Can interpret shell scripts written in Bash May use a different scripting language
Includes many built-in commands and utilities May require additional utilities to be installed
Uses tab completion to assist with command line input May not support tab completion

 


58. How can you check the Linux distribution version?

You can check the Linux distribution version using the “lsb_release” command, which will display information about the distribution, including the version number and release name.

59. Explain the difference between a process and a service in Linux.

A process is an instance of a running program or application, while a service is a process that runs continuously in the background and provides functionality to other programs or users. Services are typically started automatically when the system boots up, and can be managed using tools like systemd or init.


60. How do you create a new directory in Linux using the command line?

The command is mkdir [directory name]. For example, mkdir mydir.


61. What are the key differences between the Linux kernel and user space?

Linux Kernel User Space
Provides core operating system services like memory management and hardware control Runs applications and user-level processes
Has direct access to hardware resources Does not have direct access to hardware resources
Runs in privileged mode with elevated system access Runs in user mode with restricted system access

 


62. How is swap space managed in Linux?

Swap space is a type of virtual memory that is used when the system runs out of physical memory. Linux manages swap space using a combination of kernel memory management and swap file or partition management. The system will automatically allocate and deallocate swap space as needed to ensure that there is always enough memory available for running applications.


63. How is data backup and recovery handled in Linux?

  • Linux has various backup and recovery tools, including rsync, tar, and dd.
  • These tools can be used to create backups of data on local and remote systems.

64. Explain the difference between a socket and a pipe in Linux.

  • A socket is a method of communication between processes on different computers or different processes on the same computer over a network.
  • A pipe is a method of communication between two processes on the same computer.

65. What is the purpose of the /usr/local directory in Linux?

  • The /usr/local directory is used for locally installed software.
  • This directory is not managed by the system package manager and is intended for software that is not available in the official repository.

66. How is system logging handled in Linux?

  • Linux uses a system logging daemon called syslogd or rsyslogd to manage log files.
  • Log files are stored in the /var/log directory and contain information about system events, errors, and other messages.

67. Explain the purpose of the /tmp directory in Linux.

  • The /tmp directory is used for temporary files.
  • Files in this directory may be deleted at any time by the system.

68. How is interprocess communication (IPC) handled in Linux?

  • Linux supports various IPC mechanisms, including pipes, sockets, message queues, and shared memory.
  • These mechanisms allow processes to communicate and exchange data with each other.

69. How is file compression handled in Linux?

File compression in Linux is handled through various utilities such as gzip, bzip2, and xz. These utilities compress files or directories into a compressed archive format, reducing their size and saving disk space.

The compressed archive can be decompressed using the corresponding decompression utility or command, restoring the original file or directory.
Linux also supports compressed file systems such as squashfs and zram, which allow files and directories to be compressed and stored in a compressed format, reducing disk usage and improving performance.


70. How do the permissions and access control mechanisms in Linux differ from those in other operating systems?

Linux Permissions Other Operating Systems
Uses a combination of read, write, and execute permissions for owner, group, and others May use different permission models like access control lists
Supports the use of permission modifiers like sticky bit and setgid bit May not support these modifiers
Applies permissions recursively to directories and their contents May apply permissions only to individual files
Includes access control mechanisms like SELinux and AppArmor for additional security

 


71. What is the difference between a process and a program in Linux?

  • A program is a set of instructions or code that is stored on disk.
  • A process is an instance of a program that is executing in memory.

72. What is the purpose of the /etc/sysconfig directory in Linux?

  • The /etc/sysconfig directory contains configuration files for system services and daemons.
  • These files are read at boot time and contain system-wide settings and environment variables.

73. How is system time managed in Linux?

  • Linux uses the Network Time Protocol (NTP) to synchronize the system clock with remote time servers.
  • The NTP daemon runs in the background and periodically updates the system clock.

74. What is the purpose of the /etc/group file in Linux?

The /etc/group file in Linux is used to manage group permissions for user accounts. This file contains information about each group on the system, including the group name, group ID, and a list of users who are members of the group. By setting permissions on groups, system administrators can control access to files and directories on the system.


75. How can you check the Linux kernel version?

You can check the Linux kernel version using the “name” command with the “-r” option, which will display the kernel release number.


76. Explain the purpose of the /usr directory in Linux.

The /usr directory in Linux is used to store user-related programs and data, including applications, libraries, and documentation. This directory is separate from the system files stored in the /bin


77. What distinguishes a Linux server from a Linux desktop environment in terms of functionality and performance?

Linux Server Linux Desktop Environment
Designed to run server applications and services like web servers, email servers, and databases Designed for personal computer use and productivity tasks
Often does not include a graphical user interface Includes a graphical user interface
Prioritizes stability and security over user experience Prioritizes user experience over stability and security
Typically has higher performance and resource utilization requirements Typically has lower performance and resource utilization requirements

 


78. What is the purpose of the /usr/bin directory in Linux?

  • It is the directory where most user commands are stored.
  • It contains executable files and scripts that are available to all users.
  • The contents of this directory are typically included in the system’s default path.

79. What is the syntax to list all files in a directory, including hidden files?

The command is ls -a.


80. How can you check network connectivity in Linux?

  • Use the ping command to test network connectivity to a specific IP address or domain name.
  • Use the traceroute or trace path command to see the path that networks traffic takes to reach a particular destination.
  • Use the netstat or ss command to view active network connections and listening ports.
  • Use the ifconfig or ip command to check network interface configurations and status.

81. Explain the purpose of the /usr/share directory in Linux.

  • It is a directory where architecture-independent data files are stored.
  • It typically contains documentation, examples, and other data files that are not specific to any particular architecture or package.
  • This directory is meant to be shared across multiple systems and is often mounted as read-only.

82. How is user authentication handled in Linux?

  • User authentication is typically done through the Pluggable Authentication Modules (PAM) framework.
  • PAM provides a flexible way to authenticate users using a variety of methods, including passwords, smart cards, and biometric authentication.
  • Authentication is usually performed by a system daemon, such as the systemd-logind service on modern Linux systems.

83. In what ways do the networking protocols and tools available in Linux differ from those in other operating systems?

Linux Networking Other Operating Systems
Includes a wide range of networking protocols like TCP/IP, SSH, and FTP May include a different set of protocols
Includes many networking tools like ping, traceroute, and netstat May include different networking tools or require additional software to be installed
Provides extensive support for network virtualization and containerization May provide limited or no support for these technologies
Is widely used in enterprise networking and server environments May be less widely used in enterprise networking and server environments

 


84. What is the purpose of the /etc/rc.d directory in Linux?

  • It is a directory where scripts used during system startup and shutdown are stored.
  • This directory is used by the system’s init process to execute startup and shutdown scripts as needed.
  • The specific files and directories in this directory can vary depending on the Linux distribution and version.

85. Explain the difference between a public and a private IP address in Linux.

  • A public IP address is a globally unique IP address that is assigned to a device on the public internet.
  • A private IP address is an IP address that is not publicly routable and is used for internal network communication.
  • Private IP addresses are typically assigned by a network administrator and are used to identify devices on a local network.

86. What is the difference between Linux and Unix operating systems?

Linux Unix
Developed by Linus Torvalds in 1991 Developed by Bell Labs in 1969
Available as open-source software Originally a proprietary software
Supports a wider range of hardware and devices Designed for specific hardware systems
Follows the GNU Public License Follows various licenses including proprietary licenses
Has many different distributions and flavors Has a limited number of commercial variants

 


87. What is the purpose of the /boot directory in Linux, and what type of data is typically stored there?

  • The /boot directory is used to store the Linux kernel and bootloader files.
  • This directory typically contains the kernel image, initial ramdisk, and bootloader configuration files.
  • The contents of this directory can vary depending on the Linux distribution and version.

88. How is process scheduling handled in Linux?

  • Process scheduling is handled by the Linux kernel’s scheduler.
  • The scheduler determines which processes are allowed to run and for how long.
  • The scheduler uses a variety of algorithms to decide which process to run next, including priority-based scheduling and fair queuing.

89. How do you change the ownership of a file or directory in Linux?

The syntax is chown [new owner]:[new group] [file/directory]. For example, chown john:users myfile.txt.


90. What is the difference between a fork and a clone in Linux?

  • Forking is the process of creating a new process by duplicating an existing process.
  • Cloning is a more flexible process that allows for the creation of new processes with more control over the sharing of resources.
  • Cloning allows for the creation of lightweight processes, or threads, that share memory and other resources with the parent process.

91. How is thread synchronization handled in Linux?

  • Thread synchronization is typically handled using locks or semaphores.
  • Linux provides several synchronization primitives, including mutexes, spinlocks, and reader-writer locks.
  • These primitives can be used to coordinate access to shared resources and ensure that multiple threads do not interfere with each other.

92. How does the Linux file system differ from the file system used in Windows?

Linux File System Windows File System
Uses a hierarchical directory structure Uses a drive letter system
Uses forward slashes (/) to separate directories Uses backslashes () to separate directories
Does not differentiate between upper and lowercase letters in file names Treats uppercase and lowercase letters as distinct
Supports many different file systems including ext4, btrfs, and xfs Primarily uses NTFS and FAT32 file systems

 


93. How can you check the available disk space in Linux?

To check the available disk space in Linux, you can use the ‘df’ command in the terminal. The ‘df’ command stands for ‘disk free’ and it shows information about the file system disk space usage. Running ‘df -h’ will display the information in a human-readable format.


94. Explain the concept of a mount point in Linux.

In Linux, a mount point is a directory to which a file system is attached. When a file system is mounted, it becomes part of the directory hierarchy and files can be accessed through the mount point. Mount points are typically located in the /mnt or /media directory, but they can be located anywhere in the file system.


95. How is system performance measured in Linux?

System performance in Linux can be measured using various tools such as ‘top’, ‘htop’, ‘sar’, ‘vmstat’, ‘iostat’, and ‘netstat’. These tools can provide information about CPU usage, memory usage, disk I/O, network usage, and other performance metrics.


96. What is the syntax to search for a specific string in a file using the command line?

The syntax is grep [string] [file]. For example, grep hello myfile.txt.


97. What is the purpose of the /lib directory in Linux?

The /lib directory in Linux contains the shared library files that are required by the system and other programs. These files are essential for the proper functioning of the system and they are loaded into memory when a program is run.


98. What is the purpose of the /usr/share/doc directory in Linux?

The /usr/share/doc directory in Linux contains documentation files for various programs and libraries installed on the system. These files provide information about how to use the programs and libraries, their features, and their limitations.


99. What are the main differences between Ubuntu and Fedora distributions of Linux?

Ubuntu Fedora
Based on Debian architecture Based on Red Hat architecture
Uses the apt package manager Uses the dnf package manager
Includes the GNOME desktop environment by default Includes the GNOME or KDE desktop environment by default
Has a 6-month release cycle Has a 13-month release cycle
Has a larger user community and a larger number of software packages available Has a smaller user community and a smaller number of software packages available

 


100.  How do you rename a file or directory in Linux using the command line?

The syntax is mv [old name] [new name]. For example, mv myfile.txt newfile.txt.

If you’re looking to prepare for technical interviews and enhance your Linux knowledge, the Top 100 Linux Interview Questions and Answers can serve as a valuable resource for both freshers and experienced professionals. To further expand your knowledge, you can follow us at freshersnow.com.

Freshersnow.com is one of the best job sites in India. On this website you can find list of jobs such as IT jobs, government jobs, bank jobs, railway jobs, work from home jobs, part time jobs, online jobs, pharmacist jobs, software jobs etc. Along with employment updates, we also provide online classes for various courses through our android app. Freshersnow.com also offers recruitment board to employers to post their job advertisements for free.