Linux Fundamentals Course Overview
Linux Fundamentals Training Course
Linux Interview Questions & Answers-------------------------------------------------------------------------------------------------------
1. What is Linux?
Linux is an operating system, which is based on Linux Kernel. It is an open-source operating system where it can run on different hardware platforms. It provides a free and low-cost operating system for users. It is a user-friendly environment where they can easily modify and create variations in the source code.
2) Who invented Linux? Explain the history of Linux?
Linus Torvalds created Linux. Linus Torvalds was a student at the University of Helsinki, Finland in 1991. He started writing code on his own to get the academic version of Unix for free. Later on, it became popular as Linux Kernel.
3) What is the difference between Linux and Unix?
Both paid and free distributions are available.
Different paid structures for different levels of Unix.
Linux primarily uses GUI with an optional command-line interface
Unix uses the command-line interface
Linux OS is portable and can be executed in different hard drives
Unix OS is not portable.
Linux is developed by a worldwide Linux community.
Unix is developed by AT&T developers.
Linux is free. And it is download through the internet under GNU licenses.
Most Unix Like Operating Systems is not free.
Linux is used at home-based PC's, phones, etc.
Unix is used in server systems.
4) What is the core of the Linux operating system?
Kernel is the core of the Linux operating system.
5) What is the Linux Kernel?
Kernel is the heart of the operating system. It acts as a bridge between software and hardware. If Software requests the hardware, then kernel delivers the data between software and hardware. For example, if you want to play a song you should launch your default player, it requests the kernel to play a song, now kernel will contact the hardware to seek the permissions or to seek the hardware components like if you plugged in any headset to the device. Most of the Android phones use Linux kernels.
6. What is BASH?
Bash is a Unix shell and command processor written by Brian Fox for the GNU project. It is free software and acts as a replacement for Bourne Shell. It is an interpreted and not compiled process which can also be run in the terminal window. This allows users to write commands and cause actions. Bash is capable of reading commands from shell scripts.
7) What is LILO?
LILO means Linux Loader is a boot loader that is used for the Linux operating system. Most of the Linux Operating systems use LILO, to boot the operating system into main memory to start the operations.
8) What is CLI?
CLI means Command language Interpreter. It interacts with the computer program, where the user issues command in the form of text lines. It Interacts with the computer terminals also, the interface accepts the text lines and converts them as a command to the operating system.
9) What is the advantage of Open Source?
Linux was one of the first open-source technologies, many programmers added software that completely open to the users, which means you can download the file and change the code as you like. It has a wide range of options for users and increased security.
10) What is the disadvantage of Open Source?
Disadvantages of Open Source Operating System mentioned below
1. Difficulty of use
2. Compatibility Issues
3. Liabilities and warranties
4. Hidden costs
11) What is Shell?
Shell is a computer program which acts as an interface between the user and the kernel. Users can communicate with the kernel by writing programs, commands and scripts on the shell. It accepts human-readable commands and converts them into the kernel understandable language.
12) How many types of Shells are there in Linux?
They are five Shells in Linux:
- C Shell (csh): It is like C syntax and provides spelling checking and job control.
- Korn Shell (ksh): Is a high-level programming language shell.
- Z Shell (Zsh): It provides some unique nature like it observes login/logout watching, file name generating, startup files, closing comments.
- Bourne Again Shell (bash): It is the default to Linux distributions.
- Friendly Interactive Shell (Fish): It provides web-based configuration, auto-suggestions, etc.
13) Please explain symbolic links in Linux.
Symbolic links point to directories, files, and programs in Linux. They allow gaining instant access to the object they are pointing without the need to traverse the entire path. Hence, symbolic links are like shortcuts in Windows.
14) Can you tell us about the various kinds of permission under Linux? Also, explain how to change permissions.
There are three types of permissions under Linux:
- Read – Users are allowed to read the files or list the directory
- Write – Users are allowed to write to the file or add new files to the directory
- Execute – Users are allowed to run the file or lookup for a specific file within a directory
15) Please explain the virtual desktop and how to share a program across different virtual desktops under Linux.
Simply, a virtual desktop presents an alternative to minimizing and maximizing different windows. Instead of minimizing or restoring different programs, virtual desktops allow shuffling between desktops having different program windows.
Many times there is a need to share a program across different virtual desktops. For doing so, simply go to the upper left corner of the program window and click on the pushpin-like icon. It will pin the application, making it accessible across all the virtual desktops.
16) What do you understand by daemons?
Daemons are a way of extending the functionality of the base operating system. In other words, daemons are services that offer several functions that might not be available in the operating system.
The main task of a daemon is to actively listen for a service request and to act upon them at the very same time. Once it completes the service, a daemon gets disconnected and waits for further requests.
17) Please explain the various modes when using the vi editor.
The vi editor offers 3 modes:
- Command Mode – This is the mode where the user starts
- Edit Mode – This mode allows to do the text editing
- Ex Mode – This mode allows interacting with vi, allowing executing instructions to process a file
18) What are the contents of /usr/local?
The /usr/local directory contains the locally installed files. The importance of the directory is when files are stored on some network. Moreover, the directory is used for storing software packages installed from a source or software not officially accompanying the distribution.
19) Tell us how you will execute more than one command or program from a single command line entry.
Linux allows for combining several commands in a single line. Each of the commands is separated by a semicolon (:). The execution is carried in the order the commands are specified, from left to right.
20) What do you mean by hard links in Linux?
Hard links in Linux point directly to the physical file present on the disk. It doesn’t concern the pathname. It simply means that in case the file is renamed or moved to some other location, the link will not break and will still function like before.
21) Please explain case-sensitivity issues in Linux.
Sometimes entering the same command in Linux results in different outputs. This is typically attributed to case sensitivity. Because Linux is case sensitive, a command that previously produced the desired output might not do the same when executed again.
22) What is Swap space?
Swap space is the amount of physical memory that is allocated for use by Linux to hold some concurrent running programs temporarily. This condition usually occurs when RAM does not have enough memory to support all concurrent running programs. This memory management involves the swapping of memory to and from physical storage.
23) What do you understand by the Root account?
As the name suggests, it is like a system administrator account which gives you the ability to fully control the system. The root account serves as the default account whenever Linux is installed.
24) Explain the virtual desktop?
When there are multiple windows available on the current desktop and there appears the problem of minimizing and maximizing windows or restoring all the current programs, there ‘Virtual Desktop’ serves as an alternative. It allows you to open one or more programs on a clean slate.
25) Explain the term GUI?
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. These images and icons are clicked and being manipulated by the users for the purpose of communication with the system.
26)) How can you determine the total memory used by LINUX?
It is always required to keep a check on the memory usage in order to find out whether the user is able to access the server or the resources adequately. There are roughly 5 methods that determine the total memory used by Linux.
27) What is the maximum length for any file name under LINUX?
The maximum length for any file name under Linux is 255 characters.
28) Explain the Linux Directory commands along with the description?
The Linux Directory commands along with descriptions are as follows:
- pwd: It is a built-in command which stands for ‘print working directory’. It displays the current working location, working path starting with/and directory of the user. Basically, it displays the full path to the directory you are currently in.
- Is: This command list out all the files in the directed folder.
- cd: This stands for ‘change directory’. This command is used to change to the directory you want to work from the present directory. We just need to type cd followed by the directory name to access that particular directory.
- mkdir: This command is used to create an entirely new directory.
- rmdir: This command is used to remove a directory from the system.
29) Explain the work of Ctrl+Alt+Del key combination on the Linux operating system?
The work of Ctrl+Alt+Del key combination on the Linux operating system is the same as is for Windows i.e. to restart the system. The only difference is that there is no confirmation message displayed and a system is rebooted directly.
30) What is the role of case sensitivity in affecting the way commands are used?
Linux is considered a case sensitive. Case sensitivity can sometimes serve as the reason for displaying different answers for the same command as you might enter the different formats of commands each time. In terms of case sensitivity, the command is the same but the only difference occurs with regard to uppercase and lowercase letters.
31) Explain Linux Shell?
For executing any commands user uses a program known as the shell. Linux shell is basically a user interface used for executing the commands and communicating with Linux operating system. Shell does not use the kernel to execute certain programs, create files, etc.
There are several shells available with Linux which includes the following:
- BASH (Bourne Again SHell)
- CSH ( C Shell)
- KSH ( Korn Shell)
There are basically two types of Shell commands
- Built-in shell commands: These commands are called from the shell and executed directly within the shell. Examples: ‘pwd’, ’help’, ’type’, ’set’, etc.
- External/ Linux commands: These commands are totally shell independent, have their own binary and are located in the file system.
32) What is a Shell script?
As the name suggests, the shell script is the script written for the shell. This is a program file or says a flat text file where certain Linux commands are executed one after another. Although the execution speed is slow, the Shell script is easy to debug and can also simplify everyday automation processes.
33) Explain the features of a Stateless Linux server?
The word stateless itself means ‘no state’. When on a single workstation, no state exists for the centralized server, and then the stateless Linux server comes into the picture. Under such conditions, scenarios like keeping all the systems on the same particular state can occur.
Some of the features of Stateless Linux server are:
- Stores prototype of every machine
- Store snapshots
- Store home directories
- Uses LDAP which determines the snapshot of state to be run on which system.
34) How you will run a Linux program in the background together with starting the Linux Server.
You need to use the nohup command first. It will stop the process receiving the NOHUP signal. The termination will log you out of the program that was invoked. Then start the Linux server, and enter the name of the Linux program followed by the & symbol to run the process in the background.
35) Can you explain how to remotely login with SSH?
Although there are many ways of accessing a remote computer, using the SSH (Secure SHell) protocol is widely preferred. The protocol makes use of a public-key cryptography authentication method for securing communication between the hosts.