Linux Interview Questions

Quicken your Linux administration career with HKR’s frequently designed Linux Administration interview questions and answer article. Linux is an operating system and it is distributed under open-source license management. This operating system is designed on the kernel source which can be used as a customized operating system. This Linux administration interview question and answer section help you to explore the different requirements set by Linux administration tools and also enables you to crack any complex interviews with any company. Let’s start our journey with Linux administration course Q & A and also its importance in any business workforce.

Mostly frequently Asked Linux Interview Questions

1. What is Linux?

Ans: Linux is a popular operating system, which is designed on the base of Linux Kernel. This operating system is an open-source system and which can run on multiple hardware platforms. The importance of using the Linux operating system is to provide free and less expensive operating services for users. This operating system is also considered as a user-friendly work nature which can be modified easily and also enables the user to create variations in the source code.

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

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

Ans: Linus Torvalds created the Linux operating system. Linux Torvalds was a student at Helsinki University, Finland in 1991. During the time of his academic project, he started writing codes on his own to get the easier version of the UNIX for free. Later on, we started calling it Linux Kernel.

3. What is the difference between Linux and UNIX?

Ans: The following are the important differences between Linux and UNIX;

Linux UNIX
In Linux in both paid and free distributors available Unix is available on different paid structures for unique levels of Unix
Linux operating system uses the GUI which includes an optional command-line interface. Unix included only command-line interface
Linux operating system is portable to use which can be executed in different hard drives Whereas UNIX is not portable to use
Linux is designed by the worldwide Linux social community Whereas UNIX is developed by the AT&T developer community
Linux is a free open source system and the user can download it from the internet using GNU licenses Most of the Unix operating systems are not free
Linux can be operated at home-based personal computers, phones, tabs, etc. UNIX is mainly used in server systems.

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

Ans: The kernel is the core source of the Linux operating system.

5. Explain permission types in Linux.

Ans: Each file or directory has three permissions in Linux.

  1. Read: It refers only to read the file.
  2. Write: It refers to write the file or can modify the file of a directory.
  3. Execute: It affects the user’s capability to execute the file or to view the file of a directory. 

6. What is CLI?

Ans: The CLI is nothing but a Command-line interpreter. This interpreter interacts with different computer programs, and it can be used in the form of text lines. The CLI interpreter also interacts with the computer terminals, and it enables users to add text lines and later they will be converted into user-defined commands.

7. What is BASH?

Ans: BASH is a type of UNIX shell and the command lines are written by Brian Fox to work on GNU projects. It is free software and sometimes we can use it as a replacement for Bourne shell. This is also interpreted and cannot able to compile it. BASH shell can also be run on any terminal windows. So users can write commands and perform related actions. BASH shell is also used to read the commands which are written using shell scripts.

8. Explain the process management system calls in Linux.

Ans: The process management system calls in Linux implements the following methods.

  • fork(): This method creates a new process.
  • exec(): This method executes a new process.
  • wait(): This method is used to wait until process execution.
  • exit(): This method is used to get exit from the process.

The commands which are used in System calls to get the Process id are.

  • getpid(): It is used to find the unique process id. 
  • getppid(): It is used to find the unique parent process id. 

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

Ans: It is more secure because of the following reasons.

  • Linux provides limited default privileges for users which are restricted to the lower levels. So when the virus attack, it will reach only local files and folders where the system-wide damage is saved.
  • It has a powerful auditing system that includes detailed logs.
  • A greater level of security for the Linux machine is implemented by using the enhanced features of IPtables.
  • The permissions in Linux contains the tough program before installing anything on your machine.

10. What is the Linux kernel?

Ans: As I said earlier, the kernel is the heart of the Linux operating system. It acts as a bridge between both hardware and software. For example, if software requests any hardware requirement, then the kernel transfers the data between software and hardware. Most of the Android mobile devices use the Linux kernel.

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

11. What is LILO?

Ans: LILO can be abbreviated as a Linux Loader, this is a boot loader used for the Linux operating system. Most of the recent Linux versions use LILO, to boot up the operating system into RAM to start the operation.

12. What is grep command in Linux?

Ans: The grep searches file patterns. The grep searches the relevant lines for a specific pattern in the output of another command.

Example:

$ cat tomcat.log | grep org.apache.catalina.startup.Catalina.start

12-Jan-2018 17:08:35.542 INFO [main] org.apache.catalina.startup.Catalina.start Server startup in 681 ms

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

Ans: The commands are.

vi filename: This command is used in creating a new file as well as modifying an existing file.

View filename: This command opens an existing file in read-only mode.

X: This command deletes the character which is under the cursor or before the cursor location.

dd: This command is used to delete the current line.

14. Explain the Linux directory commands.

Ans: 

pwd: The command stands for “print working directory”. It is a built-in command which displays the current working location, working path that starts with / and directory of the user. It displays the full path of the current directory. 

ls: The command is used for listing all the files in the directed folder.

cd: The command stands for “change directory”. It is used for changing the directory on which you want to work from the present directory. To access a particular directory type cd followed by the directory name.

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

rmdir: The command is used for removing a directory from the system.

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

Ans: The ‘cd’ stands for change directory and is used in changing the current directory on which the user is working.

Syntax: $ cd {directory}

The purpose of using the “cd” command is as follows.

  • To change from current to a new directory.
  • To change the directory by using the absolute path.
  • To change the directory by using the relative path.

The options in change directory are.

cd~: This command brings you to the home directory.

cd-: This command brings you to the previous directory.

. : This command brings you to the parent directory.

cd/: This command takes you to the entire system’s root directory.

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

Ans: The features of the Linux operating system include.

  • Portable: The software in Linux can work on different types of hardware. The data is portable to carry in pen drives and memory cards.
  • Open Source: The Linux Operating System is available for free which is a community-based development project. 
  • Multi-User: The applications can be used by multiple users. Multiple users can use ram and run programs at the same time.
  • Multi-Programming: Users can run multiple programs or applications at the same time.
  • Shell: It has a special interpreter program which executes programs and commands of a system.
  • Security: Linux provides data security by authentication, authorization, and encryption.

17. What is cat command in Linux?

Ans:  The cat command in Linux is used for concatenating and printing the files. Users apply cat command to check the contents of the dependencies file or to confirm the version of an application which is already built locally.

Example:

$ cat requirements.txt

flask

flask_pymongo

18. What is meant by PIPE in Linux?

Ans: A pipe is a form of redirection used in Linux. It is used in combining more than two commands and the output of one command can take as input to the next command.

Syntax:

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

19. Explain about chmod command?

Ans: The chmod command is used for changing the permissions of files and directories. There are three types of permissions, read, write and execute and are represented by numbers as shown below.

  • 4 - read permission
  • 2 - write permission
  • 1- execute permission

Syntax:

$ chmod options permissions file name 

$ chmod [OPTION]... MODE[,MODE]... FILE…

$ chmod [OPTION]... OCTAL-MODE FILE…

$ chmod [OPTION]... --reference=RFILE FILE…

Linux Certification Training

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

20. How to exit from vi editors?

Ans: There are two commands used for getting exit from vi editors.

  • wq: The wq command exits from the vi editor by saving the current work.
  • q!: The q! command exits from the vi editor without saving the current work.

21. How permissions are granted under Linux?

Ans: A system administrator grants the file permission using the “chmod” command. Following are the symbols used in writing the permissions.

  • ‘+’ is used for adding permission.
  • ‘-‘ is used for denying permission.

It also includes the single letter permissions which denote.

  • u: user; 
  • g: group; 
  • o: other; 
  • a: all; 
  • r: read; 
  • w: write;
  • x: execute.

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

Ans: The three different modes of vi editor are.

  • Command Mode/ Regular Mode.
  • Insertion Mode/ Edit Mode.
  • Ex Mode/ Replacement Mode.

23. Differentiate between Cron and Anacron?

Ans: 

Cron:

  • It allows the user in scheduling the tasks that have to be executed every minute.
  • A normal user can schedule the task and it is basically used when tasks must be completed/executed at a particular hour or minute.
  • Cron is ideal for servers.
  • Cron expects the system to run 24x7.

Anacron:

  • It allows the user to schedule the task to run on a specific date or the first available cycle after the date.
  • Only the superusers can use the anacron and is used when a task has to be executed irrespective of an hour or minute.
  • Anacron is ideal for desktops and servers.
  • Anacron doesn’t expect the system to run 24x7.

24. What is env command in Linux?

Ans: It is a shell command that is used for printing a list of current environmental variables which can run another process in another environment without any modification of the current environment.

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

Options:

  • -i, --ignore-environment: These tags describe starting with an empty environment.
  • -0, --null: The output line End with a 0 (null) byte rather than a newline.
  • -u, --unset=NAME: These tags remove variable NAME from the environment.
  • --help: It displays a help message and will exit.

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

Ans: One file can be appended to another file by using the command cat file 2 >> file 1. The operator “>>” appends the output of the named file or creates the file if it is not created. There is another command cat file 1 file 2 > file 3 which appends two or more files to one.

26. Explain Redirection.

Ans: It is the process of directing the data from one output to another or the output serves as input data for another process. There are three streams available in which input and output of the Linux environment are distributed.

  1. Input Redirection: A ‘<’ symbol is used for input redirection that is numbered as (0). So it is denoted as STDIN(0).
  2. Output Redirection: A ‘>’ symbol is used for output redirection that is numbered as (1). So it is denoted as STDOUT(1).

      3. Error Redirection: It is denoted as STDERR(2).

27. What is Shell?

Ans: Shell in Linux operating system is a computer program this acts as an intermediate between the user and the kernel. Users can also communicate with the kernel with the help of programming codes, commands, and scripts on the shell. This shell accepts the human-readable commands and later converted them into the kernel understandable language.

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

Ans: The port numbers used for these services are.

  • SMTP - 25
  • DNS - 53
  • FTP - 20(Data Transfer) 21(Connections Established)
  • DHCP - 68(dhcp client), 67(DHCP server)
  • SSH - 22
  • Squid - 3128

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

Ans: There are two commands to check the ports listening in Linux Server.

  1. netstat --listen
  2. netstat -l

30. What Is Linux Shell?

Ans: Linux shell is a user interface used for executing the commands. Shell is a program the user uses for executing the commands. In UNIX, any program can be the users shell. Shell categories in Linux are:

Bourne shell compatible, C shell compatible, nontraditional, and historical.

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

31. What Is Shell Script?

Ans: A shell script, as the name suggests, is a script written for the shell. Script here means a programming language used to control the application. The shell script allows different commands entered in the shell to be executed. Shell script is easy to debug, quicker as compared to writing big programs. However the execution speed is slow because it launches a new process for every shell command executed. Examples of commands are cp, cn, cd.

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

Ans: 

First, let me discuss the advantage of open-source;

  •       Linux is one of the first open-source technologies.
  •       This helps users to add software that is completely open to the users.
  •       This lets the user download any kind of file and also you can change the code
  •       Open source also provides various options for users and this increases the security.

Now it’s time to explain the disadvantage of open source:

  •       Sometime it’s very difficult to use
  •       Compatibility issues
  •       Warranties and liabilities
  •       Cost is expensive.

33. What Are Pipes?

Ans: A pipe is a chain of processes so that output of one process (stdout) is fed an input (stdin) to another. UNIX shell has a special syntax for creation of pipelines. The commands are written in sequence separated by |. Different filters are used for Pipes like AWK, GREP.

E.g. sort file | lpr ( sort the file and send it to printer)

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

Ans: There are 5 shells in Linux;

  1. C shell (csh): This is available in the form of C syntax and helps the user to check the spellings.
  2. Korn shell (Ksh):  this is a high-level programming language shell.
  3. Z shell: This shell offers unique nature like log in or logout features, the file system also generates, start-up files documents, and closing comments.
  4. Bourne again shell (bash): this shell is a default one in the Linux operating system.
  5. Friendly interactive shell (Fish): This shell provides a web-based system configuration, auto-suggestions.

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

Ans: A stateless Linux server is a centralized server in which no state exists on the single workstations. There may be scenarios when a state of a particular system is meaningful (A snap shot is taken then) and the user wants all the other machines to be in that state. This is where the stateless Linux server comes into picture.

Features:

  • It stores the prototypes of every machine.
  • It stores snapshots taken for those systems.
  • It stores home directories for that system.
  • Uses LDAP containing information of all systems to assist in finding out which snapshot (of state) should be running on which system.

36. What are the basic components of Linux architecture?

Ans: The following are the important component which made a Linux operating system;

  •       Kernel: this is one of the core components in the Linux operating system; it acts as a bridge between hardware and software components.
  •       Shell: This acts as an interface between the system users and the kernel operating system.
  •       GUI: this is a graphical user interface which to interacts with the system.
  •       System utilities: this is a kind of software function, which allows users to manage the computer.
  •       Application programs: this is nothing but a set of tasks that are designed to perform a set of tasks.

37. What Is Bash Shell?

Ans: Bash is a free shell for UNIX. It is the default shell for most UNIX systems. It has a combination of the C and Korn shell features. Bash shell is not portable. any Bash-specific feature will not function on a system using the Bourne shell or one of its replacements, unless bash is installed as a secondary shell and the script begins with #!/bin/bash. It supports regular and expressions. When bash script starts, it executes commands of different scripts.

Related Article : How To Install Kali Linux

38. What Is A Zombie?

Ans: Zombie is a process state when the child dies before the parent process. In this case the structural information of the process is still in the process table. Since this process is not alive, it cannot react to signals. Zombie state can finish when the parent dies. All resources of the zombie state process are cleared by the kernel.

39. What is Swap space?

Ans: The swap space is used when we need to run the Physical memory. This also helps users to move the RAM inactive pages to the Swap space. The swap space is available in two forms such as swap partitions, and swap files.

40. What is the GUI?

Ans: GUI in Linux operating system is a Graphical user interface. It is also considered as a type of human-computer interface which uses the Windows, images, icons, and menu bars. Most of the recent computer applications in electronic devices communicate with users through GUI. A graphical user interface is a combination of a graphical and textual interaction that can be used in the form of buttons, menus, and message boxes.

41. Explain the file permissions types in Linux?

Ans: Each file or directory has 3 file permissions in Linux;

  1. Read -> this refers only when you read the file.
  2. Write -> this refers that when you write the file or modify the file.
  3. Execute -> this refers that when you execute the file or view any file of a directory.

42. What are the differences between BASH and DOS?

Ans: The main differences between BASH and DOS are as follows;

BASH DOS
BASH command is a case sensitive DOS command is not case sensitive
Under BASH the characters are directory separator and which acts as an escape character Under DOS the characters are the command argument delimiter and are the directory separator
BASH follows such no convention DOS follows a name convention

43. What are symbolic links?

Ans: Symbolic links are shortcuts in windows. These links point to programs, codes, files, or directory. This link allows direct instant access to the entire pathnames.

[ Related Article: Adobe CQ5 System Administrator Training ]

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

Ans: Yes, it works on Linux; we can use this key combination to restart the system.

45. What are hard links?

Ans: The hard links directly point to the physical file on a disk, and never on the pathname. Suppose if you remove or move the original file, the hard link will not break because the link itself is used a file, not the path where the file is stored in a directory.

46. What are daemons?

Ans: Daemons are a kind of service which offers different functions that you can’t find them under the base operating system. The main tasks included are listening for a service request and let them act on these requests. Once the service is finished, it is then disconnected and waits for any further requests.

47. What is a Virtual desktop?

Ans: This virtual desktop is an alternative service to minimize and maximize the multiple windows on the currently running desktop. The main purpose of using a virtual desktop is to clear the desktop when you run one or more programs at a time. This enables users to shuffle between the desktops rather than minimizing/ restoring the programs.

48. What are I node and process ID?

Ans: The inode is a unique name given to any file or directory whereas process id is a unique name given to each process.

49. What are the process states in Linux?

Ans: There are 5 process states in Linux;

  1. New / Ready process
  2. Running process
  3. Blocked or Wait for process
  4. Terminated or completed the process
  5. Zombie process.

50. Name the file permission groups in Linux?

Ans: The file permission groups are based on each file or directory, they are as follows;

Owner: The owner will have permission to access the file or directory; they will not impact any action of other groups.

Group: The file permission will be applied only to groups that are assigned to the file or directory

All users: This type of file permission will be applied to all the users on the system.

51. What is a file system in Linux?

Ans: The Linux file system is used to store and handle the data. Without a file system, it becomes a very difficult task to know where the file begins from and where the file ends.

52. Why LVM is required?

Ans: LVM means large volume management; it is nothing but a storage management device. With the help of LVM users can create, resize, or delete the partitions. LVM also increases the abstraction, flexibility, control, gather existing storage device, and allocates the logical units.

53. What is Umask?

Ans: Umask = users for file creation mode. When you create the file, this offers the default file access permissions. Umask also specify a new restriction to the newly created file type.

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

Ans: To set the Umask permanently we have two options such as,

  •       Ocotal representation
  •       Symbolic representation.

Related Article : Linux File Permission

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

Ans: There are six different modes of the network bonding in Linux;

  •       Mode -0 (Balance –rr)
  •       Mode -1 (active-backup)
  •       Mode -2 (balance –Xor)
  •       Mode -3 (broadcast)
  •       Mode -4 (802.3ad)
  •       Mode -5 (balance –tlb)

56. Where are kernel modules located?

Ans: The directory name is lib/modules/kernel-version/, this is the directory where we can see the Kernel module, this stores all the valuable information about the compiled drivers. Using lsmod command users can see the installed kernel modules.

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

57. What is the difference between Linux Vs Windows?

Ans: 

Linux

  • The Linux operating system is available for free.
  • An operating system is open-source.
  • Linux can be customized.
  • Provides high-level security.
  • Primary partitioning and logical partitioning are available to boot.

Windows: 

  • The Windows operating system is purchasable.
  • An operating system is not open-source.
  • Windows cannot be customized.
  • Cannot defend from virus and malware attacks.
  • Booting is available while primary partitioning only.

58. What do you understand about Linux?

Ans. Linux is an open-source popularly used operating system based on Kernel or Kernel distributed. It supports different hardware devices and platforms. Also, it offers a free and low-cost OS for users and is very popular among developers also.  Linux is highly secure and we can install it on multiple systems at no cost.

59. Distinguish between Linux and Unix OS.

The following are the important differences between Linux and Unix OS.

Linux

  • Linux Operating System is portable.
  • It includes both paid and free editions.
  • Linux basically uses GUI and has an optional CLI.
  • It is an open-source OS and is available freely to everyone.
  • Linux is useful to all like home users, developers, etc.
  •  It also includes many built-in networking functions.

Unix

  •  It has multiple paid structures for different levels of OS users.
  •  Unix OS is used in servers, PCs, etc.
  • Users of Unix should wait for some time to fix the patch to bugs.
  • Unix OS is not portable and is not available in open-source.
  • Unix is developed by AT&T & other commercial developers.
  • Moreover, Unix is a complete pack of OS, and its source code is not available to anyone.

60. Define the core of the Linux Operating System?

Ans. The kernel is the main component or the core part of the Linux OS. Further, it includes different modules and it manages all the important activities of the Linux OS.

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

Ans. Linux OS was developed by Linus Torvalds, a student at the University of Helsinki, Finland in 1991. The name is derived from the Linux Kernel. This is a type of software that allows users and apps to access devices to execute some functions.

62. Explain LILO in Linux?

Ans. In Linux, LILO refers to Linux Loader which is a boot loader or a boot manager used for the Linux OS. LILO is useful to boot or load the Linux OS into the main memory to begin the operations.

63. Define Linux Kernel?

Ans. Linux Kernel is the important part and the heart of the Linux OS. It is basically responsible for all the actions in this OS and an interface between software processes and hardware.

You can understand this with an example; To play a song you have to start your default player. Then it sends a request to the kernel to play a song. The Kernel then contacts the hardware to get the permissions or to look for the hardware components. This is similar to that where you plugged any headset into a device. Moreover, Linux Kernel is used by many Android devices.

64. What do you mean by BASH in Linux?

Ans. Bash in Linux OS is a command processor and a Unix shell written by Brian Fox. This is an updated version of Bourne Shell and is useful for the GNU project. Further, it is capable of reading and carrying out commands from the shell script. Also, users of Bash are allowed to write commands and cause actions.

65. Explain CLI?

Ans. CLI is a short form for the Command Line Interface that interacts with the computer program. It is a non-graphical and text-based interface to the system where the user can issue a command in the form of text lines. Thus, the interface (UI) receives the text lines and turns them into a command to the OS. Moreover, CLI can work much faster with great efficiency than other interfaces.

66. Define the benefits of Open Source OS?

Ans. Linux OS is one of the open-source technologies released under the GNU General Public License. This is completely open to the users where they can easily download the file and change the code as they like. Further, it offers different types of options for users with enhanced security.

67. Explain the drawbacks of Open Source OS?

Ans. The following are the various drawbacks of the Open Source OS:

  • Difficulty in usage
  • Compatibility Issues
  • Less technical support
  • Security issues
  • Hidden & Long-term costs

68. What is called a Shell in Linux?

Ans. A shell is a computer program and a Linux CLI that performs like an interface between the kernel and the user. Users have options to write programs, commands, scripts, etc. on the shell to connect with the kernel. It receives human-readable commands and turns them into the language that Kernel understands.

69. Define the different types of Shells in Linux?

Ans. There are five types of Shells in Linux:

  • C Shell (Csh): The C shell is a command shell similar to C syntax that provides spelling checking, job control, etc. Also, it allows users to type and execute commands.
  • Z Shell (Zsh): It's like an interactive login shell and is used as a command interpreter for scripting shells. Also, it observes various activities like login/logout, file name generating, startup files, and closing comments.
  • Friendly Interactive Shell (Fish): It's a smart and user-friendly shell that provides web-based configuration,  auto-suggestion, Sane scripting, etc.
  • Korn Shell (Ksh): This is a high-level programming language and command shell that executes commands that read from a file.
  • Bourne Again Shell (bash): The bash shell defaults to Linux distributions and is an improved version of the Bourne shell.

70. Name the basic Linus components?

Ans. The following are the various basic components of Linux.

Kernel: It is the major component of Linux that looks after all the OS actions and acts like an interface between hardware & software.

Shell: This is an interface between the user and the Kernel that hides the Kernel’s complexity. It receives commands from the user to perform certain actions.

GUI: It's a short form of Graphical User Interface. It offers a different way for the user to interact with the system. 

Utilities: The utilities are the software OS functions allowing users to manage the system.

Application Programs: These are a set of functions built to perform certain tasks.

Hardware: This is a combination of various peripheral devices like HDD, RAM, and CPU that form the Hardware layer for Linux OS.

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

Ans. You can start the terminal by pressing the CTRL+ALT+T buttons or by making the terminal available in the menu search bar. 

72. Explain Swap Space?

Ans. Swap Space is used when the physical memory or RAM is running out. When there is more memory requirement then it will move the inactive pages to the swap space. You can consider Swap space as a replacement for additional RAM. 

73. Define GUI?

Ans. GUI refers to Graphical User Interface which is an interface between the user & the system. It uses windows, icons, graphics, menus, etc., and these can be operated through a mouse/keyboard. Moreover, GUI is a communication tool with a user for many latest electronic gadgets. It generally combines graphics and texts for interaction and uses buttons, menus, message boxes, etc. Linux GUI has many components like Panels, Menus, Window Manager, Icons, Widgets, Dashboards, etc.

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

Ans. in Linux OS, every file or directory has 3 types of permissions:-

Such as:-

  • Read: It allows Read-only permission to a file.
  • Write: It allows you to write/edit or change the file of a directory.
  • Execute: It allows you to execute a file or a program by setting up permission to run.

75. Explain the Environment Variables in Linux?

Ans. They are a set of dynamic values stored within the OS and affect the programs’ process on a system. These can be of different types. You can build, edit, save, and delete them and they also report about the system’s behavior.

76. Define Symbolic links in Linux?

Ans. It has another name Symlink that is redirected to another file or folder using its path in the system. This link is equal to the Windows Shortcut but not an actual file. If you remove the target file, the symbolic link to that file is deleted, not the actual file.

77. What is a Hard link in Linux OS?

Ans. A hard link in Linux OS is a file stored on the hard drive. It points to a spot on the hard drive and represents a copy of the actual file. Even if you remove or change the file name, the Hard link still points to the underlying file in the system.

78. What is meant by Redirection in Linux?

Ans. Redirection in Linux refers to changing the way of usual input and output devices. To redirect a file or a program, you can use metacharacters. 

79. Explain what are called Daemons?

Ans. A Daemon is a process or a program that runs in the background without any human interaction. It accepts requests for service from other systems and it helps to observe and take care of subsystems. Also, ensures that the OS runs perfectly. Today, many operating systems use daemons in different forms.

80. Define the Root account?

Ans. The root account is a type of special user commonly given the name ‘root’. It by default can access all files and commands. The root user is different from the ordinary user. This user can perform many tasks like software installations, changing file permissions, etc.

81. Explain what is meant by Virtual Desktop?

Ans. A Virtual Desktop (VD) is useful as a user interface for managing multiple windows on your desktop computer. Further, it serves as an alternative for desktop issues. It's a kind of VM that generally runs a workstation OS using which an employee can do his tasks.

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

Ans. In Linux, you can find three kinds of modes in vi editors. 

  • Command Mode
  • Insert or Edit Mode.
  • Ex-command Mode.

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

Ans. The Inode in Linux is a uniquely given number for all the existing files and the process id is a unique name automatically allotted to each process.

84. Define the various Process states in Linux OS?

Ans. There are five process states in Linux OS. 

  • Running State: Upon creation of a new state, it is placed in a running state.
  • Sleeping State: While executing a process a point comes where it waits on data. During this wait, the app goes into a sleeping state. Thus, the process can be removed easily here.
  • Stopped State: Used to stop a process from Running state to Stopped state with SIGTSTP signal.
  • UnInterruptible State: This state will wait for the resources available before the process moves to the runnable state. Also, it doesn’t respond to any signals.
  • Zombie: The process is terminated here, but still the data regarding the parent process exists in the process table. It stays until the parent process removes it from the table.

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

Ans. A system call acts like an interface between the user program and OS. The various types of the process management system (PMS) call in Linux: 

  • fork(): Used to build a new or duplicate process for the main process.
  • exec(): It is used to replace the program or execute the new process.
  • getpid(): Used to get the unique process id.
  • wait(): You should wait for process execution or stop execution till the child process ends.
  • exit(): This is useful to terminate or stop the process.
  • getppid(): This is useful to get the single parent process id.

86. What are the different File Permission groups?

Ans. The following are the three user-based file permission groups for every file/directory in Linux. 

Owner: The permission allows owners only to access the file or directory rather than affecting the other users’ actions.

All Users: These File permissions apply to all the system users.

Group: These file permissions apply only to the allotted file or directory group. The permissions will not affect the actions of other users.

87. Define the File system in Linux?

Ans Linux file system is an arranged file collection on a disk drive that stores and manages the data. Without a file system, you cannot know about the starting and end of a file in the system. 

88. Define various file system types available in Linux?

Ans. In Linux, you can find the below file systems: 

Ext, Ext2, Ext3, Ext4, JFS, ufs, ReiserFS, XFS, btrfs, ntfs and swap file. 

89. Why LVM is required?

Ans. In Linux, LVM refers to Large Volume Management that works like a storage management device. With this, users can build, resize, and remove various LVM partitions. It helps to enhance extraction, flexibility, and authority. Further, through the LVM tool, you can allocate disks, and clear and resize logical volumes.

90. What is Umask in Linux?

Ans. In Linux, the term umask refers to the user-file-creation-mode mask. When the user creates a new file or folder, then this Linux command allows the user to set up a default file permission. Thus, the umask will mention some restrictions to the newly created file by the user. 

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

Ans. If the umask command is used without any arguments then it will present the existing mask. 

To set the umask permanently for a specific user, we can use these two types. 

  • Octal representation.
  • Symbolic representation. 

Hence, for example, if a user sets a umask to 0022 when he creates a new file. Then it would be built using 0644 permissions. Again, if you build a directory it will use 755 permissions. So, the user must need to minus the umask from the default 666 file and 777 folder permissions respectively.

Thus, the umask command is highly useful to set this mask or to present its current value to a user.

92. Define Network Bonding in Linux?

Ans. In Linux, Network Bonding refers to a process of merging two or many network interfaces into a single network interface. This bonding provides performance improvement and process repetition by increasing network bandwidth along with the output.

Even if you unplug or stop any interface, then no need to worry because the other interface will start working. Moreover, an interface’s behavior depends on the bonding method.

93. Explain the various modes of Network Bonding?

Ans. The following are the various modes of network bonding in Linux.

  • Mode-0(balance-rr): It is based on the Round-Robin policy and represents a default mode. Further, this mode of network bonding offers fault tolerance and load-balancing features. 
  • Mode-1: This network bonding mode is based on the Active Backup policy. Here, only one slave will actively work in the band and the other one will work when the other slaves fail in the band. Also, it is capable of fault tolerance.
  • Mode-2: This mode in the network sets a ‘xor’ mode between the source and the target Mac address to offer fault tolerance capability.
  • Mode-3: This mode in network bonding is based on broadcast policy and transfers all in the slave interface. It is capable of offering fault tolerance and is useful for a specific purpose only.
  • Mode-4: This mode in the network is a dynamic aggregation mode. It builds aggregation groups that are having the same speed. Moreover, it utilizes the transmit hashing approach to choose the slaves for departing traffic.
  • Mode-5: In this network mode the departing traffic is according to the existing load available on the slave. And the arriving traffic is obtained by the slave here. The process is also called an adaptive transmit load-sharing (balancing) mode.
  • Mode-6: This mode is called an adaptive load-sharing mode that doesn’t need any switch support.

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

Ans. To check the default route and routing table, the following commands are useful. 

  • $ route-n 
  • $ netstat-rn 
  • $ ip

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

Ans. The following two commands are available to check which ports are listening in Linux Server.

# netstat --listen

# netstat -l 

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

Ans. The default run level in Linux OS can be altered using the ‘init’ command.

e directory lib/modules/kernel-version/ holds all the data about the compiled drives in the Linux OS. Using the “lsmod” command in Linux, we can also see the existing kernel modules.

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

Ans. The default run level in Linux OS can be altered using the ‘init’ command.

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

Ans. The method to share a directory using NFS is as follows.

First, you need to edit the config file and the ‘/etc/exports’ file. Then you need to make an entry like ‘/. Now you can restart the NFS service on the Linux OS. 

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

Ans. This process is carried on for security purposes so that unofficial users can’t log in to the account. Therefore, we have a few different methods to lock the user account. 

  • To lock or remove the account password, we use the ‘passwd’ command.
  • We can close/end the user account with the ‘usermod’ or change command.
  • Also, we can alter the shell using the ‘nologin’ command.

Linux Certification Training

Weekday / Weekend Batches

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

Ans. It is a basic command in Linux OS and is used to list all the files & directories available in the file system.zom 

ls [OPTIONS] [FILES]

Utilizing the command without passing the arguments will list all the existing files in the existing working directory. Also, this command enables displaying all the files in alphabetical order. 

Is

If you want to list particular directory files, then use the directory name in the syntax, such as:-

ls /etc

In Linux, you can also pass many directory names using the syntax, but splitting by giving space.

ls /etc /var /etc/passwd

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

Ans. The Tail command in Linux OS is useful to print the last N number of lines of the given data. But, by default, it prints 10 lines only. 

The Syntax we use for Tail: 

tail [OPTION]... [FILE]

The example of the Tail command is as follows:- 

$ cat names.txt

Tableau

SQL server

Linux administration

Now, you can check the given syntax without providing any input.

$ tail state.txt

102. Define the ‘grep’ command in Linux?

Ans. The ‘grep’ command is a type of filter useful for the global search for regular expressions. 

The Syntax for ‘grep’ is: 

grep [options] pattern [files]

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

Ans. The command ‘ps’ is useful to present the existing process status of the system. And it also shows the process IDs including other related data. 

The Syntax we use is: 

Ps [options]

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

Ans. The ‘env’ command is a shell command in Linux useful to print a list of existing environment variables. Further, it can run another process in another environment without any change or alteration of the existing environment. 

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

Ans. The command ‘top’ refers to the Table of Processes in Linux OS. It is useful to present the system process. It also shows and updates the arranged process data. 

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

Ans. The command ‘netstat’ is useful to present the network status and routing tables, interface statics, connections, and much more about the system. 

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

Ans. The command ‘lsof’ refers to a List of files. Using this command we can know the file opened by any process. 

#lsof

108. Explain the ‘chmod’ command?

Ans. This command ‘chmod’ is used to control access to the scripts and to alter the permission of system files and directories. Therefore, we can see there are three different types of permissions available: read, write and execute. Also, they are displayed by numbers such as. 

  • 4 - read-(r) 
  • 2 - write- (w) 
  • 1- execute (x)

109. Define the ‘cp’ command in Linux?

Ans. The ‘cp’ command in Linux is useful to copy files and directories from the system. Also, you can use it to back up files or directories in the system. 

The Syntax we use: $ cp filename

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

Ans. The rm command is used to delete a file or a directory from the given command line. While removing any file or directory from the system, you must take care. 

Syntax: 

rm filename---

Command Description

  • rm filename - It helps to remove the single file.
  • rm filename1, filename2, filename 3 - This command deletes multiple files.
  • rm * .pdf - This is useful to delete all pdf files from the existing directory.
  • rm -i filename(s) - Here, the term -i refers to confirming the data before deleting a file/directory.
  • rm -f filename(s) It deletes all files without reminding the user.
  • rm -fv *.txt -  It deletes all .txt files in the existing directory without any reminder.

111. Define the command ‘mkdir’ in Linux?

Ans. The command ‘mkdir’ enables users to build directories in the Linux OS. Further, users can develop as many directories at once and can set the permissions to them for use. 

Syntax: 

mkdir [options...] [directories ...]

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

Ans. Using the command ‘rmdir’ you can delete each directory stated on the command line. 

The syntax we use for rmdir: 

rmdir [-p] [-v | –verbose] [–ignore-fail-on-non-empty] directories

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

Ans. To exit from the vi editor, there are two commands in use:- 

  • Wq: This command stores the ongoing work and exits from the vi editor.
  • q!: This command does not save the ongoing work, but helps to exit from the vi editor.

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

Ans.  The below-stated commands are useful to remove any data from a file in vi editors. 

  • Command ‘x‘ removes the existing character from the vi editors.
  • Command ‘dd’ is useful to remove the current line. 

115. List the Linux File content commands?

Ans. 

The following are the different types of file content commands in Linux.

  • head:  It shows the top (heading) lines of the file.
  • cat: It is useful to concatenate more than 2 files.
  • tail: It presents the last (ending) lines of the file.
  • more: This command is useful for showing the content in pager form to see in the terminal.

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

Ans. The following are the Linux Distributors out of many distros available. 

  • Linux Mint: The Linux Mint uses mate desktop and cinnamon and is very robust to use.
  • openSUSE: This Linux Distro is a good option to use for new and existing users also.
  • Ubuntu: This Linux distributor is available for both desktop & server editions. Further, it is based on a Debian distributor.
  • Manjaro: This distributor gives a satisfying experience to new as well as experienced users.
  • Debian: The Debian distributor is known for its robustness, stability, and well-oiled release cycles. It is a much more user-friendly distribution and is replaced by version 9.

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

Ans. The following important reasons behind the use of LINUX are listed out here.

  • Highly Stable: It offers high stability and does not crash. Also, it runs very fast since it was installed at the start.
  • Easy Operation: Linux OS offers ease of use and we can easily install it on the system. This is because all the Linux OS variants include their own software repositories. You can easily set up an automatic updating system for periodic updates or can do it manually. 
  • Compatible Hardware: Since the hardware is compatible, we use Linux on any hardware. Hence, there are no restrictions on the same. 
  • Security: The Linux OS offers high security to the user as a dependable server. It also helps to easily avoid viruses and malware on our system. Moreover, the attacker cannot modify anything within the system. This requires the user to log in as the root user.
  • Open-Source: Linux is free and Open Source Software, so its source code is easily available.

118. Define the various features of the Linux OS?

Ans. Below are the most important features of the Linux OS.

  • Portable: Software supports the working of multiple hardware and is easy to carry in pen drives and memory cards.
  • Multi-User: It facilitates multi-users to use all features like RAM, and applications, and run programs simultaneously.
  • Security: Its highly secured feature offers verification, authorization, and encryption facilities to the data.
  • Multiprogramming: You can run multiple programs or apps simultaneously on Linux OS.
  • Shell: It consists of a special interpreter program that helps you to execute programs and commands of the system.
  • Open-source OS available for free to use.

119. Distinguish between BASH and DOS in Linux?

Ans. The following points differ between Bash and DOS.

Bash

  • The Bash commands are case-sensitive in Linux
  • The forward slash in Bash shows the escape character
  • The backward slash shows the directories separator

DOS

  • The DoS commands aren’t case-sensitive like in bash.
  • The operator ‘’ shows the directories separator
  • It follows naming protocol within files
  • The slash ‘/’ shows the command arguments

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

Ans. 

Internal Commands: These commands are directly run by the shell and there is no other process to run them.

External Commands: These commands in Linux are run by the kernel and each command here owns a unique process id.

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

Ans. The process of communication between the child and parent process includes the use of sockets, pipes, messages queues, and more. 

122. What does Stateless Linux Server mean?

Ans. A Stateless Linux Server is a central server that doesn’t include any existing states on the working station. It may have outlines when a specific system’s state takes a snapshot. Then the user may require all other systems to be in that specific state only.

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

Ans. The command ip tables is helpful to block or allow traffic on a Linux host. It is like a network firewall that prevents some applications from receiving and passing on requests.

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

Ans. The pushd command in Linux saves the existing working directory within memory or stack so that we can get it back at any time.

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

Ans. The “du” command allows us to quickly check the disk usage or the number of blocks used for a file.

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

Ans. The command df -h represents the free space available in the file system. The df -i command represents the number of free inodes available in the file system.

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

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

128. What is meant by SMTP?

Ans. SMTP refers to a Simple Mail Transfer Protocol, an internet standard useful for mail transmission.

129. How can you decompress GZIP files in Linux?

Ans. We can use gunzip command to uncompress or decompress gzip files in Linux.

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

Ans. MD5, or Message-Digest Algorithm, is an encryption method or a helpful cryptographic protocol to encrypt passwords before they are saved. It helps in message authentication and content verification.

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

Ans. The following are the commands used for user management in Linux:-

  • useradd
  • chmod
  • chown
  • usermod
  • change
  • userdel
  • delgroup
  • last
  • chsh

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

Ans. The maximum length of a filename is 255 characters.

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

Ans. We use the command - dmesg to view Kernel Boot messages in Linux.

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

Ans. Linux Ping or Packet Internet Groper is the command useful to verify the connection status or network connectivity between the host & server.

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

Ans. Fstab refers to the filesystem table in Linux; a configuration table developed to make it easier to mount and unmount the file systems to a device.

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

Ans. It is an empty directory that is nameless in the Linux file system. It is similar to an attachment for other directories, such as files, drives, etc.

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

Ans.

We can use the following commands-

  • Free -m presents the data in MB
  • Free -g presents the data in GB

Find our upcoming Linux Certification Training Online Classes

  • Batch starts on 24th Mar 2023, Fast Track batch

  • Batch starts on 28th Mar 2023, Weekday batch

  • Batch starts on 1st Apr 2023, Weekend batch

 
Global Promotional Image
 

Categories

Request for more information

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

Protected by Astra Security