Thursday, 2 May 2024

Linux Interview Questions and Answers

 

Q1.What is Linux? 

Ans: Linux is an open-source UNIX like operating system developed from scratch by Linus Torvalds. Although Linux is actually an alternate operating system since it is roused by UNIX, the commands and syntax of UNIX and Linux programs are generally similar. 

A portion of the Linux distributions are Ubuntu, RedHat, Fedora, etc. 

2.What are basic components of Linux? 

Ans: The basic Linux components are: kernel, shells and GUIs, system utilities, and application program. 

What makes Linux advantageous over other operating system is that each aspect accompanies additional features and all codes for these are downloadable for free. 

3.What are the Benefits of Linux? 

Ans:Users can be profited by Linux regarding effectiveness, stability, adaptability, compatibility, security, and cost. 

Despite the fact that Linux is somewhat complicated, any client can conquer it and can have efficient service from it. 

Easily its configuration can be changed, and once in the event that it is done, a sustainable service is guaranteed. 

Being available on the open-source, Linux is adaptable in addition, compatible as well with many software and applications. 

It offers security for the private computer by securing its operating system. Finally, 

the permitting expense isn't required for Linux, although; supportive software can be purchased; in any case; it isn't necessary; accordingly; it is cost-effective. 

Q4.What are basic components of Linux? 

Ans: The basic Linux components are: kernel, shells and GUIs, system utilities, and application program. 

What makes Linux advantageous over other operating system is that each aspect accompanies additional features and all codes for these are downloadable for free. 

Q5.How do you know whether a distant host is alive or not? 

Ans: You can check these by utilizing either ping or telnet command in UNIX. 

This question is most asked in various Unix command Interview because its most basic networking test anybody wants to do it 

Q6.How can we list all the processes running on a machine? 

Ans: Using Top utility, we can list all the running processes. Running 'top', records important attributes of the process like PID(process id), client/userId, parent process id, 

virtual memory utilized, physical memory utilized, process status, CPU utilization, process start time, command initiating the process, etc. 

Q7.What is the Difference Between Process and Service in Linux? 

Ans: Service is another name of daemon that is continually tuning in to ask for and send a response based on the given solicitation, 

and it works on the background. To put it another way, service is the command that allows start, stop, or restart. 

On the contrary, the process infers a content or an application that runs out of sight or foreground. 

Q8.How Many Types of Processes are There in Linux? 

Ans: Three basics processes are categorized in Linux, and they perform various functions in this operating system. The three processes are namely; 

Foreground or Interactive, Automated, and Daemons. The Interactive Process is responsible for interacting with the client and initiates a process in the terminal brief. 

Automated is a scripted process that works on data and time at command. 

Q9.How do you copy file from one host to other? 

Ans: Many options however you can say by utilizing "scp" command. 

You can also utilize rsync command to answer this UNIX inquiry question or even sftp would be alright. 

Q10.What are the contents in usr/local? 

Ans: It contains locally installed files. This directory actually matters in environments where files are stored on the network. Specifically, 

locally-installed files go to/usr/local/receptacle,/usr/local/lib, etc.). 

Another application of this directory is that it is utilized for software packages installed from source, or software not officially transported with the distribution. 

Q11.How to print the current working directory in Linux? 

Ans: Pwd command is utilized to display the current directory (Print Working Directory) 

$ pwd 

/c/Users/Kuldeep 

Q12.What is the "Bash" Process in Linux? 

Ans: Bash is a command processor, Unix shell and command language, interactively works with the clients by taking command and transforms it into action. 

It works as a book window and even from the shell content it can read and executes a command from the files. 

This command language is widely utilized in the login file and has been composed by Brian Fox. 

Q13.What is redirection? 

Ans: Redirection is the technique of directing data from one yield to another. It can also be utilized to guide a yield as a contribution to another process. 

Q14.How do you check how much space left in current drive ? 

Ans: By utilizing "df" command in UNIX. For example "df - h ." will list how full your current drive is. This is part of anyone day to day activity so I think this Unix Interview question will be to check anyone who claims to working in UNIX however not so much working on it. 

Q15.What is "Process Priority" in Linux? 

Ans: When any program is run in the Linux, then the system creates an instance of that program that is called the process. 

A certain amount of system resources is required for a process, for example; CPU time and RAM to finish tasks of that process. 

In this system, each process is resolved as a "process priority" to calculate the allocated CPU time to execute the functions, and that is "process priority."

 

Q16.What is a root directory? 

Ans: Linux follows a hierarchical or tree-based file system. 

The root directory is the parent directory of the hierarchy that incorporates all the other directories. It is represented by a forward slash '/'. 

Q17.What is "rc" File in Linux ?

Ans: "rc" can be elaborated with Run Command in the Linux-based system, 

and it is responsible in command for start information of any files. At the point when a lot of commands is stored in a file, 

it facilitates execution with the "runcom" that stands for run command and in this case file is called "runcom." 

Q18.What is a hard link? 

Ans: A hard link is another name for the physically existing files on the circle in Linux, or other operating systems, for example, Unix and not on the pathname.There can be different quantities of hard links therefore there can be various quantities of any file. Also if, if the original file is renamed or moved, the link won't break as the link is for the file, not for the path where the file is located. 

Hard links have a special feature of having the ability to be created for other hard links. 

Q19. How to create basic shell scripts in Linux? 

Ans: Make sure that the file starts with "#!/canister/bash" before any command lines. Make it executable : chmod +x <filename>. Executed by running "sh <filename.sh>" OR <./filename.sh>". 

Q20.Which are the Shells that are utilized in Linux? 

Ans: Linux utilizes various shells for its functioning. A couple of for the most part utilized Shells are 

  • csh: C shell. As the name recommends, it follows a syntax, same as C and provides work control and spelling corrections. 
  •  ksh: Korn Shell (it is an elevated level programming shell). 
  • fish: Friendly interactive shell helps in providing auto-suggestions, electronic configuration, and clean scripts. 
  • bash: Bourne Again Shell( a default shell function for Linux). 
  • zsh: Z shell provides filename generation, watches login and logout, shutting remarks, startup files, etc. 

Q21.What is the root account? 

Ans: The root account is the account or a client that has access to each file and directory in Linux. The root account is also known as the superuser. A root client can also have access to run any command including adding clients, grant or revoke permissions, etc. 

Q22.How Does Linux Calculate Load Average? 

Ans: In Linux, load average is calculated by the decimal number, and it starts from 0.00. 

The load average suggests what number of programs had to wait for its chance to run on the system. The load average doesn't show instantly; be that as it may, it appeared at a particular second later. The status appears one-minute average, 

five-minute average, and fifteen minutes average. 

Q23.How to increase size of 'kernel ring buffer' file (dmesg)? 

Ans: By default the kernel ring buffer size is 512 bytes. In this way, to increase this space add "log_buf_len=4M" to the kernel stanza in grub.conf file. 

Q24.What is the difference between rpm - F <PackageName> and rpm - U <PackageName>? 

Ans: rpm - F = Basically renews a package which thusly upgrades a current package, otherwise doesn't install it if an earlier version not found. 

rpm - U = Upgrades a current package if exists otherwise install it. 

Q25.What are "System Calls"? 

Ans: System calls work as the fundamental interface between the application and Linux Kernel. 

This is the way a program enters the kernel to perform a given task. Much the same as library wrapper functions, 

system calls are generally not summoned straightforwardly yet via wrapper functions in other libraries, for example, glibc. 

100 Important Linux Interview Questions with Answers

 

  1. What’s Linux?
    Linux is a free operating system quite similar to UNIX.
  2. Name the inventor of Linux.
    Linux was developed by Finnish-American software engineer Linus Torvalds in 1991.
  3. What’s an open-source OS?
    An open-source operating system means users can modify the source code and create their own versions of the software.
  4. Name some hardware platforms where Linux can be run.
    Linux can be run on various hardware platforms, including laptops, desktop computers, smartphones, tablets, raspberry pi, and so on.
  5. What does manage hardware resources?
    Linux kernel manages hardware resources for Linux users.
  6. What’s Linux Kernel?
    Linux Kernel is the core part of the Linux operating system. Kernel offers basic services to other components of the OS. Also, it interacts with user commands. Linux kernel is a free, modular, monolithic, multitasking, open-source, Unix-like OS kernel. It was created by Finnish-American software engineer Linus Torvalds in 1991. C and assembly language were used to write its code. Kernel 5.16.3 is its latest version.
  7. Is it legal if you use the Linux Kernel?

    Linux Kernel is free and open-source software. It comes under General Public License, shortened to GPL. Hence, it’s legal for anyone to edit the kernel.

  8. Explain one task performed by the kernel.
    Linux kernel manages your computer resources. Kernel enables a smooth run of various computer programs. Also, it allows the programs to use computer resources, such as CPU, memory, and i/o devices.
  9. How is the kernel useful in process management?
    The kernel takes care of process management. The kernel allows more than one process to run simultaneously.
  10. How do the processes access the devices attached to the computer?
    Processes access the devices attached with the help of the Linux kernel.
  11. Can you perform multiple tasks on Linux?
    Yes, Linux users can perform multiple tasks at once.
  12. What’s the role of the Linux kernel in managing memory?
    Linux kernel can access the system’s memory. So, it allows running processes to access the memory whenever needed.
  13. What’s the role of the Linux kernel in managing system calls?
    When the processes want to access the services, system calls are required. The kernel avails system calls for that purpose.
  14. What do you mean by a Command Line Interface?
    Command Line Interface, often shortened to CLI, is an interface that allows users to write declarative commands for instructing the computer to perform tasks.
  15. What are the characteristics of Command Line Interface?
    Below are the characteristics of CLI.

    • CLI is highly flexible.
    • OSes implement CLI in a program known as a Shell. It gives interactive access to the operating system’s services and functions.
  16. Does Ctrl+Alt+Del key combination work on Linux?
    Yes, Ctrl+Alt+Del key combination works on Linux. Just like Windows, this provides a system restart. The only difference is, on Linux, you won’t get any confirmation note, resulting in an immediate reboot of the system.
  17. How would you copy files to a Floppy Disk?
    For copying files to a Floppy Disk without any problem, we should follow the steps given below.

    • Mount the floppy disk
    • Copy the files to the disk
    • Unmount the floppy disk safely
  18. How many process states are there in Linux?
    There are five process states in Linux: new or ready, running, blocked or wait, zombie, and terminated.
  19. What does happen in the New process state?
    In the New or Ready process state, a brand new process gets created and becomes ready to run.
  20. What do you mean by the Running process state?
    The process being executed defines the Running process state.
  21. What do you mean by Blocked process state?
    In the Blocked or Wait process state, a process waits for input from the user.
  22. Define the Terminated process state.
    When a process has finished the execution or is terminated by the OS, it’s called a Terminated or Completed state.

  23. What’s the Zombie process state?
    In the Zombie process state, the process is deleted, but the information related to the process still remains in the process table.
  24. What are the system calls used for process management in Linux?
    System calls used for process management in Linux are fork(), exit(), wait(), exec(), nice(), getpid(), getppid().
  25. What’s the functionality of fork()?
    Fork() is used for creating new processes.
  26. What’s the functionality of exit()?
    Exit() is used to exit from the processes.
  27. What’s the functionality of wait()?
    The wait() is used for waiting until the process completes its execution.
  28. What’s the functionality of exec()?
    The exec() executes a new program.
  29. What’s the function of nice()?
    The nice() is used to bias the property of a process.
  30. What’s the role of getppid()?
    The getppid() gets the unique id of the parent process.
  31. What’s the role of getpid()?
    The getpid() gets the unique id of the process.
  32. What are Inode and Process Id?
    The inode or index node is the unique name given to each file. Process Id is the unique name given to each of the processes.
  33. What is Swap Space?
    Swap space is a part of a hard disk’s space that can be a substitute for physical memory.
  34. How does swap space work?
    Swap space works as virtual memory. It contains process memory images. During the memory shortage, your computer uses virtual memory. Swap space fulfils the RAM requirement of the operating system.
  35. What’s swapping?
    This information exchange between real memory and virtual memory is called swapping.
  36. Mention one advantage of using swap space.
    If your system has enough swap files, it keeps some amount of physical memory free.
  37. Why should we keep some physical memory free?
    The free physical memory can be used for different vital operations.
  38. Where are the unused applications kept?
    Unused or less used applications are usually kept in a swap file.
  39. How can swap space be used in reading or writing files?
    Swap space can be used as a single memory to reduce I/O operations during reading or writing files.
  40. Name two important features of the Linux operating system.
    Two important features of the Linux OS are:

    • Linux distributions come with live USB or CD required for installation purposes.
    • Linux has customized keyboards and outstanding application support.
  41. Which are the high-security services offered by Linux?
    Linux provides high-security services, such as Authentication, Encryption, and Authorization.
  42. How’s the file system offered by Linux?
    Linux offers a hierarchical file system, and its source code is free for everyone.
  43. Can you run Linux application programs on any hardware?
    Yes, the Linux kernel and the application programs are compatible with any hardware platform.
  44. What are daemons?
    Daemons are services that offer different functions that are not necessarily available under the base OS. Daemons receive service requests and respond as per the requests. Once the service is completed, it’s disconnected and then waits for the next requests.
  45. Name some daemons used in Linux.
    Daemons used in Linux are httpd, ftpd, amd, sshd, mysql, etc.
  46. Mention one speciality of Daemons used in Linux.
    Daemons mostly have ‘d’ at the end of their process names.
  47. What’s the full form of HTTPD?
    HTTPD stands for Hypertext Transfer Protocol Daemon.
  48. What’s the purpose of HTTPD?
    HTTPD runs in the background and works as a server.
  49. What’s the other name of the HTTP server?
    The HTTP server is better known as the Web Server.
  50. What’s the full form of FTPD?
    FTPD stands for File Transfer Protocol Daemon.
  51. What’s the full form of TCP?
    TCP stands for Transmission Control Protocol.
  52. What’s the full form of AMD?
    AMD stands for AutoMount Daemon.
  53. What’s the purpose of AMD?
    AMD takes care of mounted file systems’ cache.
  54. What’s the full form of NFSD?
    NFSD stands for Network File Sharing Daemon.
  55. What’s the purpose of NFSD?
    NFSD runs on a server. It manages client requests coming for file system operations.
  56. What’s AFS?
    AFS or Andrew File System is a distributed NFS used for facilitating stored server file access among AFS client computers placed in different areas.
  57. Who developed AFS?
    AFS was developed by Carnegie Mellon University. Later it was further developed by Transarc Corporation and IBM.
  58. Mention one difference between AFS and NFS.
    AFS has stateful servers.NFS has stateless servers.
  59. Explain the PWD command.
    When you open the Linux terminal, you land up to the user’s home directory. Using the PWD command lets you easily understand which directory it is. It provides the absolute path. The path starts from the root. The root is the Linux file system’s base. It’s denoted by the “/” (forward slash) sign. The user directory looks like “/home/username”.
  60. What’s the full form of SSHD?
    SSHD stands for Secure Shell Server Daemon
  61. What’s the purpose of SSHD?
    SSHD provides secured and encrypted communications between untrusted hosts across an insecure network.
  62. What do you mean by a computer file system?
    In short, filesystem or FS, a computer file system is a data structure and method used by an OS for controlling data storage and retrieval.
  63. What’s a Linux shell?
    The shell is the command-line interpreter of Linux. Linux shell acts as an interface between the kernel and the user. It’s used to execute programs called commands in Linux operating system. For instance, if you’ll enter LS, the shell will execute the LS command. Also, the Linux shell is able to execute many other programs, such as scripts, applications, and user programs. The shell is written in C or shell programming language.
  64. Which are the shells used in Linux?
    Some commonly used shells of Linux are BASH, CSH, KSH, and FISH.
  65. What’s BASH?
    BASH stands for Bourne Again Shell. BASH is the default shell found in most of the Linux distros.
  66. What’s CSH?
    CSH stands for C Shell. CSH is based on C-like syntax. And it offers job control and spelling correction.
  67. How to clear the cache in linux?
    echo 1 > /proc/sys/vm/drop_caches
  68. How to get the stack trace of a process on Linux
    Run pstack or run gdb and attach to process and use backtrace command
  69. What do you mean by a Virtual Desktop?
    A virtual desktop is a preconfigured image of an operating system and applications where the desktop environment is kept separated from the real physical device. That physical device is used for accessing it.
  70. How do the users access a virtual desktop?
    Users access virtual desktops remotely via a network. An endpoint device, like a smartphone, laptop, or tablet, is used for accessing a virtual desktop.
  71. How do a virtual desktop work?
    The virtual desktop works like a physical workstation. The VD service provider installs client software over the endpoint device. And the user interacts with the software on the device.
  72. What are the approaches to desktop virtualization?
    There are mainly 5 approaches to desktop virtualization. These are,

    • Remote Desktop Service or RDS
    • Operating system provisioning
    • Client hypervisors
    • Application virtualization
    • Client-side hosted virtual desktops
  73. What’s a hypervisor?
    A hypervisor is a software, hardware, or firmware that creates and runs VMs (virtual machines).
  74. What are client hypervisors?
    Client hypervisors are hypervisors designed for the purpose of using in client’s computers, such as workstations, desktops, or laptops, rather than using on a server.
  75. What’s a server?
    A server is computer software or hardware which offers functionality to other devices or programs, known as clients.
  76. What’s the other name used for the remote desktop services?
    Remote desktop services or RDS is also known as Terminal Services.
  77. What’s the full form of RDP?
    The full form of RDP is Remote Desktop Protocol.
  78. What do you mean by operating system provisioning?
    Operating system provisioning means installing an operating system over a number of host computers.
  79. What’s application virtualization?
    Application virtualization is a technology that lets users use any application from a different computer than the one machine where the application has been installed.
  80. What’s the right size for a swap partition?
    The ideal size for swap partition should be 2X of the RAM space installed in the computer. So for a 64 KB RAM, the swap space should be 128 KB.
  81. What are virtual desktops?
    Virtual desktops are operating systems and applications’ preconfigured images. Here desktop environment and the physical device used for accessing it are different.
  82. What’s the root account in Linux?
    The Root is the superuser account in Linux.
  83. What are the basic components of Linux?
    Linux OS has three basic components: kernel, system library, and system utility.
  84. How many permissions are there in Linux?
    There are mainly three types of file permissions in Linux: read, write, and execute.
  85. What’s the Linux kernel?
    Linux kernel is Linux’s core part. All major activities of the OS are performed by the Linux kernel. The kernel has various modules. It interacts with the underlying hardware. Linux kernel offers the required abstraction for hiding low hardware details.
  86. What do you mean by the Write file permission?
    With the Write permission, you have the authority to modify or change file contents. You can simply add, rename, and remove files that are stored in the directory. In any case, if you have the Write permission on the file but don’t have it on the directory, you can modify file contents. However, you can’t rename, remove, or move the file from the directory.
  87. What’s the Execute file permission?
    In Linux, you must set the Execute permission for running a program. If this isn’t set, you might be able to modify and see the program code, but you can’t run the program.
  88. How many Linux file ownerships are there?
    There are three types of Linux file ownerships such as User, Group, and Other.
  89. What do you mean by system libraries in Linux?
    In Linux, the system libraries are programs or special functions. Access Kernel features using these programs, system utilities, or application programs. System libraries implement operating system’s functionalities. They don’t require code access rights of Linux kernel modules.
  90. What do you understand by system utility in Linux?
    Linux uses applications called utilities that help users manage the computer. There are different utility programs. These vary across OSes. System utility is often accessed via the control panel or a special menu in the operating system.
  91. What’s the role of the Read file permission?
    With the Read file permission, you have the authority to read a file. You can list the content of a directory if you have the Read permission on the same. Also, you can open a file with the Read file permission.
  92. What are the differences between BASH and DOS?
    The major differences between BASH and DOS consoles are as given below.

    1. BASH commands are generally case-sensitive. DOS commands aren’t case-sensitive.
    2. In BASH, \ is an escape character and / acts as a directory separator. In DOS, \ acts as the directory separator and / is a command argument delimiter.
    3. DOS follows a particular convention in naming files. This is 8 character file name, a dot, and 3 characters for the extension. BASH doesn’t follow any such convention.
  93. What’s TCP?
    TCP stands for Transmission Control Protocol. It’s a transport protocol used to ensure packets’ reliable transmission. TCP provides mechanisms for solving problems caused by packet-based messaging, such as out-of-order packets, corrupted packets, duplicate packets, and lost packets.
  94. What does the CTRL+Q shortcut do in Linux?
    In Linux, the CTRL+Q shortcut quits the application in focus.
  95. What does the CTRL+ALT+F7 shortcut do in Linux?
    In Linux, the CTRL+ALT+F7 switches to the first graphics terminal.
  96. Briefly explain the history of Linux.
    Linux began its journey in 1991 as a hobby project by Linus Torvalds. Linus was a Finnish student who aimed to create a free OS kernel. Today’s Linux kernel results from constant efforts put throughout the past years. The source code was first released in 1991. Initially, Linux was a collection of a small number of files written in the C programming language. At that time, it was released under a license that prohibited commercial distribution. In mid-December of 1992, the kernel was released under the GNU GPL license. Around 2000, kernel started using the GPLv2 license. And in 2007, the GPLv3 license was released.

    Linus wanted to call this newly created OS Linux but dismissed the idea of being egotistical. So, he named the project Freax. Freax was a combination of “free”, “freak”, “x” from Unix. However, the team chose the name Linux as more appropriate later on.

  97. What does the CTRL+S shortcut do in Linux?
    In Linux, the CTRL+S saves the presently opened file.
  98. What’s Run level 0?
    The run level 0 denotes system halt. It means the system can be powered off without any activity.
  99. What do you mean by a run level?
    In Unix-based OSes, a Run level signifies the state of the computer after boot. Runlevel is previously set on various Linux distributions. There are seven Run levels, starting from zero to six. Run levels determine the programs to be executed after the operating system boots up. System admins assign a default run level as per their requirements. You can find out your computer’s current run level using the /sbin/runlevel command.
  100. What does the CAL command do? Give its syntax.
    In Linux, CAL is a calendar command. If you want to see a year’s calendar or a specific month, you need to use CAL. 

Linux Interview Questions & Answers

 

 What do you understand by Linux?

A UNIX-based operating system is Linux. It was first introduced by Linus Torvalds. It is an open source operating system that was created to offer computer users a free and affordable operating system.

 What distinguishes UNIX and Linux from each other?

Linux is a free, open-source, and non-propriety operating system for general use while UNIX was initially developed as a proprietary operating system for Bell Laboratories, who later released their commercial version.

 What is LILO

A Linux boot loader is called LILO. It is used to start the Linux operating system's activities by loading it into the main memory.

 Explain features of Linux?

Free and Open Source: Anyone can access it without charge or difficulty.
Robust and Flexible: Linux is thought to be very resistant to security threats and can run continuously for extended periods of time without crashing.
More safe: It offers security through password authentication, security auditing, and file system access control, making it more secure.
Multiple programmes can work together or run simultaneously on a multiprogramming system.
Application Support: It has a dedicated software repository, which is a site or point of storage where users can download and install apps.
Supports customizable keywords: Because there are so many different languages spoken throughout the world, Linux allows for the installation of keyboards for numerous languages.
GUI (Graphical User Interface): It enables the usage of GUI programmes like VLC, Firefox, etc. and offers users a way to interact with the system.

 What fundamental parts or elements make up Linux?

Linux typically consists of the following five fundamental parts or elements:
The kernel, which is regarded as the foundation or core of Linux, is often in charge of all key OS operations including process and device management.
System Library: These are specialised programmes or functions that allow system utilities or application software to access kernel-level functionality without the need for coding. It merely serves to implement the OS's features.

System Utility: These utility applications are in charge of carrying out specific, individual-level functions. They are thought to be more trustworthy and provide users control over the machine.

Hardware: This refers to actual, tangible objects such a mouse, keyboard, monitor, CPU, etc.
We may execute our commands, shell scripts, and programmes in the shell environment. It is an interface between the user and the kernel that shields the user from the user's complexity of the kernel's functions. It is employed to carry out directives.

 Explain BASH?

A command language interpreter is essentially what BASH (Bourne Again Shell) is. It can be used in place of Bourne Shell and was created by Brian Fox for the GNU operating system. Although it is comparable to Bourne Shell, it has several extra capabilities like command-line editing that make it simpler and more practical to use. On the majority of Linux installations, it serves as the default user shell. Essentially, it is a non-compiled, interpreted process that can also operate in the terminal window. Additionally, it has the ability to read commands from shell scripts.

 Explain CLI

Command language interpreter is known as CLI. It engages in computer programme interaction when the user issues text-line commands. It also communicates with computer terminals; the interface accepts text lines and transforms them into instructions for the operating system.

 What benefit does open source offer?

One of the first open-source technologies was Linux, to which many programmers contributed software that was totally accessible to consumers. As a result, you could download the file and modify the code whatever you pleased. It offers users a variety of options and improved security.

 What do you mean by Swap space?

When the RAM is not large enough to accommodate the processes, Linux uses additional space known as swap space to hold concurrently running programmes. A programme runs from memory (RAM) so that the processor can swiftly fetch data. If you have more running programmes than the RAM can accommodate, they are placed in the Swap Space. Now, the processor will search the RAM and the Swap Space for information. Linux makes use of swap space as an addition to its RAM.

 What are the file permission in Linux?

There are 3 types of access
enables the user to access and read the file.
Allows the user to access and alter the file.
Allows a user to open and run the file.

Explain different types of modes used in VI editor?

The default text editor that is often included with the majority of Linux operating systems is called VI editor (Visual Editor). In the VI editor, there are generally three different sorts of modes, as listed below:
The default mode for vi editors is called command mode or regular mode. Typically, commands that execute specified or specialised vi functions are typed in this way. Press [esc] to transition into this mode from the Insert mode. Simply said, it enables you to view the material.
Text editing and text entry are both possible in the insertion mode/edit mode. Press [esc] to transition into this mode from the command mode. Simply put, it allows you to erase or add text or information.
Ex Mode/Replacement Mode: This mode is frequently utilised to store files and carry out command execution. Basically, it runs files with various settings. By pressing [:], one can access this mode. Simply put, it allows you to replace text or other information.

 What do you mean by environmental variables?

They are dynamic values that have an impact on how computer programmes run. Every operating system has them, and they come in a variety of sorts. They provide data regarding system behaviour and can be generated, changed, saved, and deleted.

 What is the longest filename that can be used under Linux?

Under Linux, a filename can only be 255 bytes long.

What do you mean by virtual desktop?

Users can use the desktop in ways that go beyond the actual boundaries of the screen thanks to a feature called Virtual Desktop. In short, Virtual Desktop expands the capabilities of the physical screen by creating a virtual one.

Virtual Desktop can be implemented in one of two ways:
Switching Desktops
Oversized Desktops

Switching Desktops: You can build distinct virtual desktops to run programmes in the Switching Desktops scenario. In this scenario, each virtual desktop will function as a separate desktop, and the apps running on each of these desktops are only accessible to people who are currently logged into that desktop.
Oversized Desktops: Instead of providing a separate virtual desktop, oversized desktops let the user pan and browse around a desktop that is bigger than the actual screen.

 What do you mean by daemons ?

A daemon is a computer software that runs in the background to offer features that might not be present in the operating system's core functionality. Typically, daemons are employed to manage services in the background without having direct access to interactive users. Daemons are designed to handle recurring requests and then route them to the proper applications for execution.

 Explain grep command?

Global Regular Expression Print is referred to as Grep. The grep command uses regular expression-based pattern matching to find specific content within a file.

Syntax: grep [options] pattern [files]

 Describe ls command?

To view a list of the files in a given directory, use the ls command.

 What are the Linux process states?

The following are the process states:
The procedure has been created and is prepared to start.
Running: The operation is being carried out.
Block or hold off: The process is awaiting user input.
Process execution was terminated by the operating system or reached its conclusion.
Zombie: Although the process was ended, the data was still present in the process table.

 What is a Latch?

A latch is a timing-controlled temporary storage device that can either store 0 or 1. A Latch is primarily used to store state information and has two stable states (high output, or 1, and low output, or 0). As long as it is switched on, a latch can store one piece of data.

 What is Microprocessor?

A microprocessor is a machine that carries out commands. It is a single-chip device that retrieves, decodes, and executes instructions from memory. A microprocessor can do the following three basic tasks:
Addition, subtraction, multiplication, and division are examples of mathematical operations.
Transfer information between two locations in memory
Based on the circumstances, make decisions and then follow new, different instructions.

 How many disc partitions must be present for Linux to be installed?

There must be at least two partitions.

All files are kept on a single partition that serves as the local file system. Files from the OS, files from programmes and services, and user files are all included in this. The other partition, which serves as RAM's "extended memory," is used as swap space.

 Why is LVM necessary and what does it mean?

LVM (Logical Volume Management) is essentially a utility that gives the Linux kernel logical volume management. It is merely being introduced to simplify the management of physical storage devices. Allocating drives, striping, mirroring, and resizing logical volumes are all included. Increased abstraction, flexibility, and control are its key benefits. It merely enables flexible management of disc space. Resizing the file system's size online is very necessary. The "lvextend" and "lvreduce" commands in Linux can be used to increase or decrease the size of the LVM partition, respectively.

 What do you mean by “/proc” file system?

A pseudo or virtual file system called Proc offers access to the kernel data structure. Usually, it contains helpful details about currently active processes. Additionally, it can be used to modify a few kernel settings as they are being executed or run. It is also thought of as the kernel's command and information hub. Virtual files is the name given to every file in this directory.

 How may a running process in Linux be stopped?

Each process has its own individual process id. We must first locate the process id in order to end the process. The list of active processes produced by the ps command includes the process id. The process is then ended by using the kill command.

 What do you mean by netstat command?

The netstat (Network Statics) command can be used to view all network connections on a system and is typically used as a networking utility for configuration and troubleshooting. It merely offers a means of determining which connections are active and whether various TCP/IP features are functioning.

 What do you mean by ping command?

The ping (Packet Internet Groper) command for Linux is used to verify the status of a connection between a source and a destination. Simply said, this command is used to determine whether a network is accessible and whether the host can be reached. It can also be used to resolve names, check IP connectivity to a second TCP/IP device, and troubleshoot other connectivity difficulties. This command can be used to verify the computer's IP address and name.

 What does the Linux OS's sudo command stand for?

Sudo stands for "superuser do," with the root user of Linux serving as the superuser. This software allows users with superuser privileges to execute specific system commands at the root level on Linux/Unix-based systems.

 What does sar provide? Where the sar logs are stored?

The sar command in Linux is used to log and analyse a range of information pertaining to system activity. It collects, reports, or stores system activity information. SAR also enables the retrospective study of the load values for various sub-systems with performance issues (CPUs, memory, disks, interrupts, network interfaces, and so on). The workload sampled is said to be CPU-bound if CPU usage is close to 100%.

The /var/log/sa/sadd file, where the dd option denotes the current day, is where the sar command's log files are by default found.

 Explain the commands used in linux?

Working with files and directories in Linux can be done using the following five basic commands:
pwd: The acronym stands for "print working directory." This command is used to display the path to the active working directory. This command's syntax is $ pwd.
cd stands for "change directory." This command is used to switch the current working directory to the precise directory that is needed. This command's syntax is $ cd.
ls: ls stands for "list." This command allows us to display a complete list of the files and folders in the current working directory. This command's syntax is $ ls.
mkdir stands for "make directory." In Linux, we use this command to create folders.

 In Linux, how are shadow passwords distributed?

The command pwconv is used in Linux to provide the shadow passwords. The use of shadow passwords improves system security. This command changes all passwords in the /etc/passwd file to "x" and creates the file /etc/shadow.
The entries in the shadowed file that are not present in the main file are first deleted. The shadowed entries are then updated if the main file's password isn't 'x'. Also included are any missing shadowed entries. Passwords in the main file are finally changed with a "x." If the primary file is manually changed, these tools can be used for initial conversion as well as updating the shadowed file.

 What do you mean by puppet manifests?

The configuration information for each Puppet Node or Puppet Agent is stored in the Puppet Master in the native Puppet language. These details are known as puppet manifests and are expressed in a language the puppet can comprehend. These manifests have the.pp file extension and are written in Puppet code. For instance, we can use the Puppet Master to generate a manifest that instals Apache and creates a file on every Puppet Agent or slave that is linked to the Puppet Master.

What is root account?

The user name that by default has access to all files and commands is called root. The root user has access to several functions that a regular user does not, such as modifying file permissions and installing software.

Describe samba. Why is it necessary?

Samba is essentially a collection of open-source programmes. It supports a variety of operating systems, including OpenVMS, IBM, etc. Simply by offering Microsoft SMB capability, it is typically used to connect Linux machines to Microsoft network resources. For every client or user using the SMB (Server Message Block) or CIFS (Central Server Message Block) protocol, it offers more secure, reliable, and quick file and print services.

Explain difference between Linux and Unix?

Linus Torvalds created Linux, an operating system that is open-source and free to use, in 1991. It is specifically made to deliver free and inexpensive operating systems to users of personal computers. It supports networking effectively and has very minimal hardware requirements. Variants refer to several Linux releases.

Originally created in the 1960s, Unix is a closed-source operating system that was taken from the original AT&T Unix. Both the source code and the use of it are not open. Generally speaking, it can manage numerous users' actions at once. It is additionally specifically made to be more portable, multi-user, and capable of multitasking in a time-sharing scenario. Distros are different Unix distributions.

What distinguishes BASH and DOS from each other?

The Bourne shell, which is used on UNIX systems, is being developed into BASH (Bourne Again Shell), which is essentially a strong command shell and scripting language. It supports a variety of OS, and new features are frequently added. It has the ability to read and run scripts from files called shell scripts.
Disk Operating System, or DOS, is essentially an operating system that utilises a hard drive. It was the initial operating system that IBM-compatible computers utilised. In essence, it offers a command-line where users are free to issue commands as instructions.

What do Linux Process Management System Calls mean?

In Linux, the following commands are made by the process management system:
fork(): A method for starting a fresh process.
exec(): Run a fresh process.
wait(): holds off till the process is finished.
exit(): end the current process.
Get the Process ID using system calls: To determine the distinct process id, use getpid().
To identify the distinct parent process id, use getppid().

Why is LVM necessary?

Large Volume Management, or LVM, is a storage management tool. LVM partitions can be created, resized, and deleted by users. It improves control, flexibility, and abstraction. Existing storage devices are gathered into a group and distributed logical units using LVM.

What does Linux's load average mean?

As the name implies, load average refers to the average system load determined over a certain time period for Linux servers. The "top" and "uptime" commands can be used to determine the load average for Linux servers. The only purpose is to monitor system resources. It is shown as a decimal number beginning with 0.00. It reveals the amount of load the system has endured.

What are Process Id and INODE?

INODE: The operating system gives each file its individual name. Within a file system, every inode has a distinct inode number. It keeps track of numerous details about files under Linux, including ownership, file size, file type, access mode, links, and so forth.

Process Id (Identifier): Each process is given a special Id. Up until the process terminates, it is merely utilised to uniquely identify an active process throughout the system.

What is Shell Script?

As the name implies, a shell script is one created just for shell. Script in this context refers to a computer language used to run programmes. Simply put, it enables the execution of various commands entered into the shell. It generally aids in the development of intricate programmes with conditional statements, loops, and functions. In comparison to building large programmes, it is significantly faster and much easier to debug, and it can streamline routine automation procedures.

What are the various Linux network bonding modes?

Below is a list of the various network bonding modes available in Linux:
The round-robin policy is the foundation of mode-0 (balance-rr), which is the default mode. It has functions like load balancing and fault tolerance.
Active-backup mode 1: This mode is based on the active-backup policy. When other nodes fail in this, just one node responds or functions.
It establishes an XOR (exclusive-or) mode to provide load balancing and fault tolerance in mode 2 (balance-xor).
Broadcast policy underpins Mode 3 (broadcast). It establishes a broadcast mode to provide fault tolerance and can only be applied in certain circumstances.
Mode-4 (802.3ad): This mode, also known as Dynamic Link Aggregation mode, is based on the IEEE 802.3ad standard. It establishes a dynamic link aggregation mode compliant with IEEE 802.3ad and establishes aggregation groups that use the same speed and duplex parameters.
The mode-5 (balance-tlb) is often referred to as the adaptive TLB (Transmit Load Balancing). For load balancing and fault tolerance, it activates TLB mode. Traffic will be loaded based on each network slave in this mode.
Adaptive Load Balancing is another name for Mode-6 (balance-alb). For load balancing and fault tolerance, it sets ALB mode. It is not required to have any unique switch support.

Explain the difference between Soft and Hard links?

A unique type of file known as a "hard link" points to the same underlying inode as another file. It can be thought of as an additional name for a file that already exists on Linux OS. The "ls -l" command can be used to display the total number of hard links for a file. Such linkages are incompatible with other file systems.

Soft Links: Another name for them is symbolic Links. File types known as soft links typically point to another file. It merely directs to another entry somewhere in the file system and does not add any data to the destination file. Such linkages are applicable to several file systems.

Describe pipe?

A pipe is essentially a type of redirection in Linux that is used to deliver a command's output to another command for additional processing. It merely uses the results of one command as the input for another. It provides buffered I/O routines for asynchronous command execution.

Why is the tar command used?

To extract or generate an archived file, use the tar command.
The command would be as follows if you wanted to extract every file from the archive called sample.tar.gz:

$ tar -xvzf sample.tar.gz

How may a file be copied in Linux?

In Linux, you can copy a file using the cp command. This is the basic syntax:
$ cp <source> <destination>

How may a text file be created without being opened?

You can create a text file without opening it by using the touch command. A blank file will be created by the touch command. The following is the syntax:
$touch <filename >

How do you log in from your system to another system on your network?

SSH is suitable for this. This is how the syntax looks:
ssh <username>@<ip address>