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. 

No comments:

Post a Comment