Thursday, 2 May 2024

Linux Interview Questions&Answres

 

Q1. What is Linux?

Ans. Linux is an Open-Source Operating System first introduced by Linus Torvalds.  It is based on UNIX and it is available freely. It can be executed on different hardware platforms such as Intel, HP, MIPS, Motorola, SPARC, IBM, etc. 

Q2. What are the main components of LINUX?

Ans. Major components in the Linux operating system are:

  • Kernel: It is the primary component that manages hardware and basic operations in the Linux operating system.
  • Shell: It is an interpreter that executes commands for different functions in Linux.
  • GUI: Graphical User Interface (GUI) is an interface through which users interact with the system. It comprises images, text boxes, buttons, checkboxes, etc.
  • System Utilities: It includes software functions that help the user to manage the basic functioning of a computer.
  • Application Programs: These are a set of software programs intended to complete certain tasks

Q3. How to check and verify the status of the bond interface?

Ans. Using the command ‘cat /proc/net/bonding/bond0,’ we can check what mode is enabled and what LAN cards are used in this bond. In this example, we have one bond interface. However, we can have multiple bond interfaces like bond1, bond2, and so on.

Q4. What do you understand by Linux Kernal? Is it legal to edit it?

Ans. Kernal essentially refers to that core component of the PC working framework that gives fundamental administrations to alternate parts and in addition connects with client summons. With regards to 'Linux Kernal, it is referred to as low-level system software providing an interface for user-level interactions.

Linux Kernal is considered as free and open-source programming which is fit for managing hardware resources for the clients. As it is released under General Public License (GPL), it winds up legal for anybody to alter it.

Q5. How can we use LINUX?

Ans. LINUX is used widely because it is completely different from other operating systems with something extra i.e. some additional features

  • It is an open-source operating system where programmers get the advantage of designing their own custom OS.
  • Software and the server licensing required to install Linux is completely free and can be installed on many computers as required.
  • It has low or minimum but controllable issues with viruses, malware, etc
  • It is highly secured and supports multiple file systems.

Q6. Define GUI?

Ans. GUI stands for the Graphical user interface. GUI is considered as the most attractive and user-friendly because it consists of the usage of images and icons.

Q7. Define CLI?

Ans. CLI stands for Command Line Interface. It is a way for humans to interact with computers and is also known as a Command-line user interface.

Inclined to build a profession as Linux Developer? Then here is the blog post on, explore Linux Training

Q8. What is the maximum length for any file name under LINUX?

Ans. The maximum length for any filename under Linux is 255 characters.

Q9. How to Enable ACLs for /home partition?

Ans. Add following entry in /etc/fstab LABEL=/home /home ext3 acl 1 2 Now remount /home partition with acl option. mount -t ext3 -o acl /dev/sda3 /home

Q10.  How do you create an ext4 file system?

Ans. # mke2fs -t ext4 /dev/DEV

Q11. What is the name and path of the main system log?

Ans. By default, the main system log is ‘/var/log/messages’. This file contains all the messages and the script written by the user. By default, all scripts are saved in this file. This is the standard system log file, which contains messages from all system software, non-kernel boot issues, and messages that go to ‘dmesg’. dmesg is a system file that is written upon system boot.

Q12. What is partial backup?

Ans. When you select only a portion of your file hierarchy or a single partition to back up, it is called partial backup.

Q13. Differentiate between LINUX and UNIX?

Ans.

LINUXUNIX
LINUX is an open-source free operating system used in the functioning of computer hardware & software, system application, game development etc.UNIX is also an operating system mostly used in internet servers, HP, intel etc.
LINUX is available in both the versions- freely downloaded and distributed as well as priced minimally.UNIX comes in different versions with different price structures.
Linux can be easily used by anyone such as web developers, software engineers, home users, etc.UNIX is developed to be generally used for servers, mainframes, and workstations.
The file support system in LINUX comprises Ext2 to Ext4, Xfs, Jfs, FAT, Btrfs, etc.The file support system in UNIX consists of gpfs, jfs hfs, etc.
In LINUX, BASH (Bourne Again Shell) serves as the Linux default shell i.e. text-mode interface that can be executed on multiple command-line interpreters.Bourne shell acts as the text mode interface that is compatible with multiple other interfaces including BASH.
LINUX comprises two GUIs, Gnome and KDE.In UNIX, the Common desktop environment serves as a GUI.
Examples: Fedora, Red Hat, Debian, Ubuntu, etc.Examples: Linux, Solaris

Q14. What are LINUX's basic commands?

Ans. In Linux, commands are case-sensitive, and more often than not they are entirely in lowercase. Items that are surrounded by brackets ([]) are optional. You will more than likely use at least some of these commands every time you log into a Linux system. Become familiar with these commands because they can get you pretty far in a short amount of time.

  • ls - Lists directory contents. You will use ls to display information about files and directories.
  • cd [dir] - Changes the current directory to dir. If you execute cd without specifying a directory, cd changes the current directory to your home directory. This is how you navigate around the system.
  • pwd - Displays the present working directory name. If you don't know what directory you are in, pwd will tell you.
  • cat [file] - Concatenates and displays files. This is the command you run to view the contents of a file.
  • echo [argument] - Displays arguments to the screen.
  • man command - Displays the online manual for command. Type q to quit viewing the manual page. The documentation provided by the man command is commonly called "man pages." exit, logout,
  • or Ctrl-d - Exits the shell or your current session.
  • clear - Clears the screen
Checkout our new blog on Linux Tutorial

Q15. Define Automatic processes?

Ans. Automatic or batch processes are not connected to a terminal. Rather, these are tasks that can be queued into a spooler area, where they wait to be executed on a FIFO (first-in, first-out) basis. Such tasks can be executed using one of two criteria:

  • At a certain date and time: done using the at command.
  • At times when the total system load is low enough to accept extra jobs: done using the batch command. By default, tasks are put in a queue where they wait to be executed until the system load is lower than 0.8. In large environments, the system administrator may prefer batch processing when large amounts of data have to be processed or when tasks demanding a lot of system resources have to be executed on an already loaded system. Batch processing is also used for optimizing system performance.

Linux Basic Interview Questions

Q16. Explain Linux Kernel? Is it possible and legal to edit Linux Kernel?

Ans. The low-level system software is referred to as the Linux kernel. It is mainly used to allocate resources and to provide a medium for the user interface.

Yes, it is possible as well as legal to edit Linux Kernel. Since Linux comes under the General Public License (General Public License), it can be edited and modified by the end-users. 

Q17. What is BASH?

Ans. BASH refers to Bourne Again SHell. It is a replacement of the initial Bourne shell represented by/bin/sh. And it is created by Steve Bourne. It is the better version of the previous and original bourne shell as it contains unique additional features that are easy to use. Later it got adopted as a default shell script for most of the systems operating Linux.

Q18. What is LILO?

Ans. LILO is a term given to Linux LOader. It loads the Linux Operating System into the system’s main memory for execution. Mostly all the computers come with inbuilt boot loaders in some of the versions of Mac OS or windows. For using Linux OS, a special boot loader needs to be installed in the system and one such boot loader is LILO. One of the major advantages of using this boot loader is that it can boot Linux OS really fast. 

Q19. Which are the common Shells that are used in Linux?

Ans. Some of the common Shells that are used in Linux are

  • BASH: Bourne Again Shell-  default shell for almost all the Linux operating systems
  • KSH: Korn Shell- high-level programming language shell
  • CSH: C Shell- shell with C like syntax that offers job control and spell check and correction functions
  • ZSH: Z Shell- It offers unique features like filename generation, login/logout functions, startup files, closing comments etc.
  • FISH: Friendly Interactive Shell- It offers unique such as web-based configuration, scripting and auto-suggestions.

Q20. Define is a swap space?

Ans. It is a space that temporarily stores concurrent executing programs in Linux. When RAM has a shortage of enough space to store the programs that are executing in a system, then swap space comes into action.

Q21. What are the advantages of using LINUX?

Ans. There are many reasons why LINUX is preferred over other operating systems. Some of them are listed below.

  • Being an open-source operating system, it provides the opportunity for the programmers to customize their own operating system
  • Software programs and server licenses that are needed to install Linux are available for free and can be installed on multiple systems.
  • It is comparatively more secure than other operating systems etc.
  • It is highly robust and scalable as it is compatible with most of the hardware and software programs and supports many file systems.

Checkout: [Linux System Administrator]

Q22. What is the root account in Linux?

Ans. It is the primary account similar to a system administrator that controls all the functioning in the system. It is a default account that gets loaded whenever the Linux is set up. Some of the functions performed by the root account are:

  • user accounts creation
  • user accounts maintenance
  • Allocating permissions for the new accounts created.

Q23. What are the advantages of using an open-source operating system?

Ans. In open-source, software including the source code is distributed without any cost to the end-users. People can customize the source code to customize and add features of their choice. They can even debug the source code if any error creeps in. The whole community can be benefited with enhanced features as the people can again distribute it freely after customizing it.

Q24. Differentiate BASH and DOS?

Ans. 

Sl. no.BASHBASH
1.Commands used for different functions are case-sensitive.Commands used for different functions are not case-sensitive.
2.(‘/’ forward slash) in BASH is used to separate directories. (” backslash) is used as an escape character.(‘/’ forward slash) in DOS is used as a command argument delimiter. (” backslash) is used as a directory separator.
3.A naming convention is followed in which 8 characters are fixed for file name postfixed with 3 characters for the extension.A naming convention is not followed

Q25. What is the importance of the GNU project?

Ans. GNU being a free software movement provides several advantages as it gives the flexibility to modify the programs according to their use and convenience. It is also allowed to redistribute the modified copies of the software for free and release it for the public to use it.

Q26. How can a command prompt be opened while writing a command?

Ans. The command prompt is found in the default shell and to open it Ctrl-Alt-F1 is pressed. This will start the command-line interface (CLI) from which commands can be entered and executed.

Q27. What is the preferred size of a swap partition in Linux?

Ans. Generally, the size of the swap partition is twice the size of the physical memory present in the system. If it is not possible to have this size, then the minimum required size for a swap partition is the amount of memory present in the system

Q28. Define Virtual Desktop?

Ans. This is a special feature which is very useful for the users who enhance the physical boundaries of a screen to a larger extent. With a virtual desktop, a virtual screen is created that can expand the normal screen of the system. A virtual desktop can be implemented by using 2 ways

Switching Desktops

With switching desktops, distinct virtual desktops can be created to run programs. Each virtual desktop acts as a separate desktop and programs executing on these desktops can only be accessed by the users who are using that particular virtual desktop 

Oversized Desktops

It does not provide distant desktops but lets the user scroll over a desktop that is expanded and is larger in size than the desktop having a normal physical screen. 

Q29. What are symbolic links in Linux?

Ans. Symbolic links are the same as shortcuts in Windows and they point to files or directories and programs. It provides instant access to the desired directories or files without going to the full pathname.

Q30. Explain daemons in Linux?

Ans. Daemons are those computer programs that run as a background process to execute those functions that are not there in the base Operating System. They are used to run the services in the background so that they can not be directly controlled by the end-users. They are also used to handle periodic requests so that these requests can be sent to the appropriate programs for implementation. 

Linux Admin Interview Questions

Q31. What are the commands to change permissions in Linux?

Ans. Only system administrators or file owners can grant or change the access permissions in Linux. Permissions are granted using the chmod command. + symbol is used to add permission and – symbol is used to deny permission, followed by any of these letters: u (user), o (others), g (group), an (all), r (read), w (write) and x (execute). For instance, the command chmod u+rw FILE23.TXT is used to grant read and write access to the file FILE23.TXT, which is assigned to users.

Q32. Write down the process states in Linux?

Ans. The process states in Linux are:

  • Ready: The process is ready for execution
  • Running: The process is in the execution state
  • Blocked or wait: Process is waiting for input or is blocked for execution from the user
  • Terminated or Completed: Process is successfully completed or was terminated due to some error by the Operating System
  • Zombie: The process is terminated by the system, but the information is still there in the process table.

Q33. What are the ways to access partitions under Linux?

Ans. In Linux, numbers are assigned as a suffix to the drive identifier. For instance, the first IDE hard drive had three primary partitions, will be written as name/number just like /dev/hda1, /dev/hda2, and /dev/hda3.

Q34. What is the use of the grep command in Linux?

Ans. Grep is the term used for Global Regular Expression Print. It is used to search for a text expression in a file by matching the patterns based on a regular expression.

It follows the following syntax

Syntax: grep [text options] pattern [filename]

For Example:

$ grep -c "shell script" inlinux.txt

This command will print the count of the word “shell script” in the “inlinux.txt” file.

Q35. What do hard links refer to in Linux?

Ans. Hard links are the links that point directly to the file and not to the pathname. It means even if the file is renamed or moved from one location to the other, the link will remain the same as the link is for the file and not for the path where the file is located.

Q36. What is Process Management System Calls in Linux?

Ans. Process management system calls are:

  • fork () – It is used for the creation of a new process
  • exec(): It is used for the execution of a new program
  • wait(): It is used to direct the system to wait until the process execution is finished
  • exit(): It is used to exit from the current process
  • System Calls that are used to get Process ID are:
  • getpid():- It is used to get the unique process id (pid) of the process
  • getppid():- It is used to get the unique id of the parent process

Q37. What is the role of the ‘ls’ command in Linux?

Ans. The ls command lists down all the files in a particular directory. The syntax for using this command is:

$ ls  

For instance: The command to list all the files in the tutorial directory will be as follows:

$ ls tutorial/

Different options can be used with the ls command to provide extra information about the file/folder from where information needs to be fetched. The options are:

  • l  Lists long format(displays the access permissions of the file)
  • a  lists all the files including hidden files
  • i  lists all the files along with their inode number
  • s  lists all the files along with their size
  • S  Lists all files with their respective size and sorts the list by the size of a file
  • t   sorts all the listed files by their date and time

Q38. What are filenames that are preceded by a dot?

Ans. Generally, all the hidden files are preceded by a dot. These files hold important or setup info as they can be configuration files. Keeping these files as hidden makes them secure from being accidentally deleted.

Also read: Features of UNIX/LINUX

Q39. What is the use of a redirection operator in Linux?

Ans. The redirection operator is used when there is a need to use the output of one command as an input to the other command or file. It is generally used in 2 ways

‘>’ – this operator overwrites the existing data in the file or makes a new file.

‘>>’ appends the new data at the end of the file or makes a new file. 

So in simple words, in this ‘>’ redirection operator, the data in the file is overwritten and in this ‘>>’ redirection operator, the data is appended.

Q40. Is it possible to execute more than 1 command from a single command line entry? If yes, how?

Ans. Yes, it is possible to execute several commands from a single command line entry by separating them using a semicolon symbol. For instance: Consider the example below in which a series of commands are issued from a single entry.

ls –l cd .. ls –an EXAMPLE of having 3 commands from the single line: ls -l cd.. ls -an EXAMPLE

Q41. What is the use of the tar command in Linux?

Ans. An archived file can be created or extracted by using the tar command in Linux. For instance: to extract all the files from the archive ‘example.tar.gz’, the following command will be used:

$ tar -xvzf example.tar.gz

To create an archive of all the file stored in /home/linux/, the following command can be used:

$ tar -xvzf filename.tar.gz

where c refers to create an archive, x refers to extract, v refers to verbose and f refers to file

Q42. How programs can be shared across different virtual desktops in Linux?

Ans. For sharing the programs across different virtual desktops, press the button in the upper left-hand corner of a window which appears to be a pushpin. It will "pin" that application thus making it visible at the same position on the physical screen in all virtual desktops.

Q43. What does Latch mean in Linux?

Ans. A Latch is a binary storage device that stores the file temporarily and is controlled by a timing signal with the value being either 0 or 1. It has two stable states. The high output state denotes 1 and a low output state denotes 0. If the power is on, it can store 1 bit of data. 

Q44. What does a nameless or empty directory signify in Linux?

Ans. In Linux, an empty directory acts as the nameless base of the file system. It serves as an attachment for all other files, directories, devices, and drives.

Q45. What is a Microprocessor?

Ans. It is a single-chip device that is used to execute commands. It fetches, decodes, and then decodes the instructions from the memory. The basic functions carried out by microprocessor are:

basic mathematical operations such as add, subtract, multiply, and divide

moving data from one place to another

decision making based on the conditions and then moving on to new instructions based on those decisions. 

Linux Interview Questions for Experienced

Q46. What does the pwd command do?

Ans. The pwd command refers to the print working directory. It displays the pathname of the directory which is currently in use.

For instance: If we will write the below command

Pwd

The following output will be generated:

/home/ajay12/myDir 

Q47. Explain Regular Expressions in Linux

Ans. Regular Expressions in Linux are used to search for options with specified patterns. Some commands used with regular expressions are sed, tr,vi and grep.

Some symbols used with Regular Expressions are:

.To match any character
$To match the end of the String 
^To match the beginning of the String
 It is used to depict special characters
*To match zero or more than one characters
? It is used to match exactly one character

Q48. How switching from one desktop environment to another can be done such as KDE to Gnome?

Ans. Considering that these two desktop environments are already installed, just log out from the current session through the user interface. Then again login from the login screen by entering the ID and password and choose the session type you wish to continue with. This will remain the default desktop environment until you change it to some other environment.

Q49. What is the effect of case sensitivity while using the commands?

Ans. Linux being a case sensitive language, it can alter the output if every character is not encoded as it is including the uppercase and lowercase letters. For instance- CD, cd, and Cd will produce different outputs as these are three different commands. If a command is written in lowercase where it should be in uppercase, it will generate different results.

Q50. How many disk partitions are required to install Linux?

Ans. Minimum 2 partitions are required to install Linux. In one partition, all the local files are stored including configuration files of the OS, application files and services along with user files. The second partition is used as Swap Space which is an extended memory for RAM in Linux. 

Q51. Define environmental variables?

Ans. Environmental variables are also known as global shell variables. They are global settings responsible for controlling the shell’s function along with other Linux programs.

Q52. How shortcuts can be created for long path names?

Ans. Shortcuts can be created by using a feature called filename expansion in which the TAB key is used for this purpose. The condition is that the pathname should be unique and the shell which is in use should support this feature. For instance, pathname /home/shell/example directory, will be written as follows: /ho[tab]/she[tab]/exa[tab].

Q53. List down the modes that are used while using vi editor?

Ans. Vi editor uses 3 modes for its functioning

  • Command mode – This is the mode from where the commands are initiated
  • Edit mode – This is the mode from where text editing is done
  • Ex mode – This is the mode where instructions are given to interact with Vi to process a file.

Q54. What does the Ctrl+Alt+Del key combination do in Linux?

Ans. It works similarly as in windows to restart a system. The only difference is that the reboot starts immediately in Linux after striking this key combination without giving any notification or confirmation message.

Q55. What does /usr/local directory stores?

Ans. This directory holds locally installed files and is mainly used in the environments where files are generally stored in a network. They are used for those software packages that are installed from the source or software that are not official to use. Local files normally go to /usr/local/bin, /usr/local/lib etc. kinds of directories in Linux.

Q56. List down some of the Linux distributors with its usage?

Ans.  Linux distributors are often called Distros. Different parts of LINUX such as the kernel, graphical programs, system environment etc. are developed and distributed by different organizations. Distros assemble these parts and compile them in an operating system that is ready to be installed in a system for use. There are more than six hundred Linux distributors in the market but some of the well-known distributors are

  • UBuntu: It is the most common Linux Distribution that comes with many pre-installed apps and repositories in its library. It is extremely user-friendly, easy to use, and works similarly to a MAC operating system.
  • Debian: It is the fast, stable, and user-friendly Linux Distribution.
  • Linux Mint: It is mostly used by those who are not used to Linux as it works on windows.
  • Fedora: It provides the latest version of Linux but is less stable as compared to other distributions. By default, it has the GNOME3 desktop environment.
  • Arch Linux: This is not suggested for beginners as every package needs to be installed by the users according to their requirements.
  • Red Hat Enterprise: It is a stable and durable distribution from Linux that is mostly used for commercial purposes and therefore needs to be tested rigorously before releasing it.

Q57. How comments can be inserted in the command line prompt?

Ans. Comments are always followed by a # symbol in Linux. From this symbol, shell understands that this is a comment and not a command. Shell completely ignores the content which is followed by # symbol. For instance "# Comment is followed by this symbol and not the command."

Q58. How memory usage can be tracked in LINUX?

Ans. It is important to determine the total memory used by different programs in Linux in order to analyze whether the resources and the server is being used adequately by the users or not. Below are some of the methods to find out the memory in use. 

Free command: Memory usage can be checked by this simple command. For instance, ‘$ free –m’, in this command’ displays all the data in MBs.

Vmstat: With this command, the memory usage statistics can be known. For instance, ‘$ vmstat –s’

/proc/meminfo: Memory in use can also be known by reading the file /proc/meminfo file. For instance,  ‘$ cat /proc/meminfo’

Top command: Total memory which is in use along with the RAM usage can be determined by using this command.

Htop: Memory usage along with other useful details can be displayed by using this command.

Q59. How can an ongoing process be terminated?

Ans. Every process has a unique id known as pid in Linux. Kill command followed by pid is used to terminate a process. To terminate all the processes in one go, kill 0 is followed by pid.

Q60. How does command grouping work in Linux?

Ans. Parentheses can be used to group commands in Linux. For instance, To send the recent date and time along with a file named EXAMPLE to a second file named GROUPING, command grouping can be applied by using this command (date cat EXAMPLE) >GROUPING

Linux Commands Interview Questions

Q61. What do you know about LINUX and elucidate the differences between Unix and Linux? 

Ans: Linux is referred to as one of the most common and popular operating systems that are designed with the Linux Kernel. The Linux operating system is an open-source operating system that is capable of running on multiple platforms. The primary focus of this operating system is to provide the users with a less expensive operating system and free operating system to utilize while working within the organization for multiple projects. The Linux Operating system is also called a user-friendly operating system. It provides the flexibility to users to modify things easily and enables the user to perform the creation of variations within the source code. 

Below are the significant differences between Linux and Unix: LINUX operating system is portable while the Unix operating system is not portable. LINUX operating system is an open-source operating system that is free of cost, and the users from the internet can download it by making use of the GNU license. In contrast, the Unix operating system is not free of cost. LINUX operating system makes use of the which also includes a command-line interface which is an optional thing. The Unix operating system controls only the command-line interface.

Q62. Briefly explain the different permission types available in Linux? 

Ans: There are three permission types that are available in Linux for each file or directory. They are: 

Read: This file permission type is used for reading the file. 

Write: This file permission type is used for writing the fine or for performing any modification to the file of a directory. 

Execute: This file permission is used to execute the file, which will affect the user's capability and view the directory's file.

Q63. Can you explain why Linux is more secure than any other operating system? 

Ans: Linux is more secure because of the following reasons: 

  • Linux is flexible and incompatible with providing the Limited default privileges to the users that will help in the restriction to the lower levels. Just in case if there is any file attack, then it will only affect the local files and folders and will save from the system-wide damage. 
  • Linux is also referred to as a powerful auditing system that will maintain the logs. 
  • Linux has enhanced features of IPtables that will help in maintaining security at a greater level. 

Q64. What do you know about CLI and BASH? 

Ans:

CLI: CLI refers to a command-line interpreter used for interacting between the different computer programs. It is usually represented in the form of text format. It is also responsible for allowing the users to add the text lines, which can be further converted into user-defined commands. 

BASH: BASH  is referred to as a Unix command, which is written by Brian Fox. Bash is also referred to as free software that is also the replacement for The Bourne shell. BASH allows the users to write the command and perform the related actions, even allowing the users to read the commands that are written in the form of Shell Scripts.

Q65. Briefly explain the features of the Linux operating system? 

Ans: There are different features available in the Linux operating system. They are explained below: 

Portable: LINUX operating system is designed in such a way that it can work on multiple types of hardware. The data is allowed to be carried in the pen drives and memory cards, allowing it to be included in the probability feature. 

Open source: The Linux operating system is a free, open-source operating system that is based on the community development project. 

Multiprogramming: LINUX operating system provides the feature of multiprogramming, allowing users to run multiple programs at the same time. 

Multi-user: the applications are allowed to be created and used by multiple users. In Linux, various users can use their RAM and run the programs at the same time. 

Security: Linux is flexible to provide data security by using the different forms of security policies or security features like authorization, authentication, and encryption.

Q66. What is meant by Linux kernel? 

Ans: Linux Kernel is referred to as a low-level system software with the primary responsibility of managing the user's resources. Linux Kernel is also responsible for providing an interface or a bridge for user-level interaction.

Q67. What do you know about LILO? 

Ans: LILO refers to Linux loader. Linux loader is referred to as the bootloader for Linux. The bootloader's primary responsibility for Linux is to mainly load the Linux operating system into the main memory so that it can start working on the operations.

Q68. Explain briefly about GUI? 

Ans: GUI refers to a graphical user interface that uses the images and Icon so that users can click and navigate checkout to communicate with the machine or a computer. The graphical elements make it easier to interact with the system instead of using the different commands and type the commands, which is more challenging for a human to remember. GUI will also improve the attraction through the icons, color, and images bringing up a good view.

Linux Tutorials

Q69. Give a brief idea about the Linux directory commands? 

Ans: Below is the list of commands of the Linux directory. 

pwd: This command is used for a print working directory. It is referred to as a built-in command that displays the current working location and the working path along with the full path of the directory. 

Is: This command is used for listing the files in the directory folder. 

cd: command is used for change directory, which is used for changing the directory from the present directory to the directory that you want to work. 

mkdir: This command is used for creating a new directory. 

rmdir: This Command is used explicitly for removing the directory from the system.

Q70. Briefly explain the cat command in Linux? 

Ans: The cat command in Linux is used for concatenating and printing the files. Users use this command to check the contents of the dependencies file and confirm the version of the application that they are built already locally.

Q71. What do you know about PIPE in Linux? 

Ans: A pipe in Linux is referred to as a form of redirection in Linux. The PIPE is specifically used for combining more than two commands, and the output of one command will be taken as input for the next command. 

Syntax: 

command_1 | command_2 | command_3 |command_4 | .... | command_N

Q72. Give a brief idea about the Chmod command? 

Ans: The Chmod command is responsible for changing the file permissions and directory permissions. The Chmod consists of three different types of permissions called to read, write, and execute. They are represented in numbers as below: 

4- read permission 

2- write permission 

1- execute permission

Q73. What are the different commands that are used to exit from VI editors? 

Ans: Two different commands can be used for getting the exit from the VI editors. 

wq: This command is used for exiting from the VI editor by saving the current work that you have done. 

q! : This command is used to exiting from the VI editor without saving the work you have done.

Q74. List different types of modes that are available when you are using the vi editor? 

Ans: There are three different modes of vi editors. They are: 

  1. Insertion mode or edit mode 
  2. Command mode or regular mode 
  3. Ex mode or replacement mode 

Q75. Briefly give an idea about the env command in Linux? 

Ans: The env command is referred to as a shell command that is used explicitly for printing the list of environment variables that run another process in another environment without performing any modifications of changes to the current environment. 

Syntax: env [OPTION]... [-] [NAME=VALUE]... [COMMAND [ARG]...]

Linux System Administrator Interview Questions

Q76. Is there a possibility to append one file to another file in Linux? 

Ans: Yes, there is a possibility to append one file to another file in Linux. The command that is used to append from one file to another file is cat file 2 >> file 1. The operator >> in the command is used for appending the output of the named file and is also capable of creating the file if there is no file already created. The other command that is stated below is also used to append two or more files to one. Command: cat file 1 > file 2 > file 3

Q77. What are the different ports that are used for SMTP, FTP, DHCP, SSH, and Squid? What are the commands that are used to check the ports that are there listening in the Linux server?

Ans: Below are the port numbers that are used for these services. 

  1. DNS - 53 
  2. SMTP - 25 
  3. DHCP - 68 
  4. FTP - 20 
  5. SSH - 22 
  6. Squid - 3128

The two commands that are used for checking if the 4th and listening in the Linux server are: 

netstat -l 

netstat --listen

Q78. What are environment variables? 

Ans: Environment variables are referred to as the global settings that will help control the cell's function and the other Linux programs. The environment variables are also called the Global shell variables.

Q79. List out the basic components of the Linux architecture? 

Ans: Below is a list of the basic components of the light next architecture. 

Kernel: Kernel is referred to as one of the most essential core components in the Linux operating system. It is referred to as an interface or a bridge between the software and hardware components. 

Shell: Shell in Linux is also referred to as an interface between the parallel operating system and the users. 

GUI: GUI refers to the graphical user interface used to establish the interaction with the system. 

System Utilities: The system utilities are referred to as a software function responsible for allowing the users to manage the computer. 

Application programs: Application programs here refer to the set of tasks that are specifically designed to perform the set of tasks or operations. 

Q80. Give a brief idea about swap space? 

Ans: The swap space is referred to as a space that is allocated and used when we need actually to run the physical memory. Describe space is responsible for helping users move the inactive pages in their RAM to the swap space. The swap space is available in two different forms called partitions and swap files.

Q81. What do you know about Hard links? 

Ans: The hard links are used to directly point to the physical file on the desk but not on the pathname. Let us take an example and think that if you move the original file or remove the same, there will be no breaking of hard links as the link itself is used as a file, not the pathname, where the file will be stored in the directory.

Q82. Does the Control + alt + delete key combination work on Linux? 

Ans: Yes, the Control + alt + delete combination works on Linux, and it can be perfectly used to restart the system.

Q83. Briefly describe daemons? 

Ans: Daemons are usually referred to as a kind of service that will offer the different functionalities which we cannot find under the basic operating system. It includes the main tasks like listening for a service request and then performing an action on these requests. Once the service is completed, it will disconnect itself and wait for the next request that will be coming up.

Q84. Know about inode and process ID? 

Ans: The inode is referred to as a unique name given to any file or directory. The process ID is referred to as a unique name given to each process that is created.

Q85. Briefly give an idea about zombies? 

Ans: Zombie is referred to the process state in which the child dies before the parent process dies. In this situation or scenario, the process's structural information will still exist in the process table. As a Process is dead, it will not react to any signals. The kernel is responsible for clearing the resources of the Zombie state processes.

Q86. Briefly explain the differences between Bash and DOS? 

Ans:

BASH: The Bash command is referred to as a case-sensitive command. Bash command does not follow any convention. Under the dash command, the characters are the directory separator and acts as an escape character. 

DOS: DOS command is not Case sensitive command, and it follows a naming convention. Under those characters are referred to as the command argument delimiter.

Q87. Give a brief idea about symbolic links?

Ans: The symbolic links In Linux are referred to as the shortcuts used in windows. The symbolic link will be pointing to the codes, files, programs, or directories and will also allow direct instant access to the entire pathnames.

Q88. What do you mean by virtual desktop? 

Ans: A virtual Desktop usually refers to the alternative service used to minimize and maximize the multiple windows on the currently running desktop. The primary purpose of using the virtual desktop is for clearing and running one or more programs at one time. The virtual desktop will allow the users to perform the shifting between the desktop rather than minimizing; they are restoring the programs. 

Q89. List out the different process states in Linux? 

Ans: Below is a list of the different process states in Linux. 

  1. New or ready process 
  2. Running process 
  3. Blocked or wait for the process 
  4. terminated or completed the process 
  5. Zombie process 

Q90. Briefly explain the different file permission groups available in Linux? 

Ans: There are three types of file permission groups available based on each file or directory. They are: 

  1. Owner: The owner will generally have permission to access the file or directory; however, it will not impact any action of the Other groups. 
  2. Group: The Group file permission will be assigned to the groups that are assigned to the directory for a file. 
  3. All users: All user's file permission is applied to the users that are using this system.

No comments:

Post a Comment