www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is Linux?1
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is Linux?1
➢ Linux is an open-source operating system inspired by UNIX.
➢ It was first introduced by Linus Torvalds.
➢ Linux is just a Kernel and a Linux distribution makes it a usable operating systems.
➢ It’s the preferred OS for computers, servers, mainframes, mobile devices and
embedded devices.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How different is LINUX when compared to UNIX?2
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How different is LINUX when compared to UNIX?2
➢ Unix is a propriety operating system from Bell Laboratories.
The Open Group holds the UNIX trademark & manage the UNIX trademark licensing program.
Companies have their own licensed UNIX: IBM(AIX), Solaris(Sun OS), HP(HP-UX), Apple(OSX)..
➢ Linux is free, open source and intended as a non-propriety operating system for the masses.
Linux is a clone of Unix, written from scratch by Linus Torvalds & his team.
Linux distro  GUI system + GNU utilities.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is the importance of the GNU project?3
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is the importance of the GNU project?3
➢ GNU project is a result of the Free Software Movement started by Richard Stallman.
➢ It supported the open-source & collaborated development of operating system software.
➢ Acronym of GNU is “GNU’s Not Unix!”.
➢ GNU project was intended to create a UNIX-like OS; but free & open-source.
➢ This lead to the birth of Linux OS  Linux Kernel + GNU utilities.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is Linux Kernel?4
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is Linux Kernel?4
➢ The Linux Kernel is a low-level systems software whose main role is to
manage hardware resources for the user.
➢ It is the core of any OS & it is responsible for translating the user commands
into equivalent language understood by the computer hardware.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is Shell?
 What is BASH?5
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is Shell?
 What is BASH?5
➢ Shell
➢ The Shell is a program that takes commands from the keyboard and passes them to the
operating system (kernel) for performing.
➢ During the initial days, Shell was the only mode for communicating with kernel (via the CLI).
➢ BASH
➢ BASH is short for Bourne Again SHell. It’s a replacement to the original Shell (/bin/sh).
➢ BASH combines the features of the original Shell + additional functionality to make it
easier and more convenient to use.
➢ Nowadays, BASH has been adopted as the default shell for most Linux systems.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What are Daemons?6
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What are Daemons?6
➢ A daemon is a type of program that runs in the background, free of user control.
➢ They can be activated (initiated as a process) by the occurrence of a specific event or condition.
➢ Daemons accommodate service requests from other programs or hardware activity or requests
from other computers on a network.
➢ After the request is serviced, the Daemon disconnects and waits for further requests.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is LILO?7
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is LILO?7
➢ LILO is an acronym for Linux Loader.
➢ It is a boot loader, which loads the Linux operating system into main memory so
that it can begin its operations.
➢ LILO can be configured to boot other operating systems also.
➢ LILO is customizable, which means that if the default configuration is not correct,
it can be changed. Config file for LILO is lilo.conf.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What are the advantages of Linux being open-source?8
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What are the advantages of Linux being open-source?8
➢ Being open-source, Linux gives users access to the source code.
➢ Open source allows users to distribute the software, including source the code (freely) to anyone
interested.
➢ It allows users to add features, debug and correct errors in the original source code.
➢ When the source code has been improved, it can be freely redistributed (open-source
collaboration).
➢ This benefits everyone in the open-source community.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What are the basic components of Linux OS?9
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What are the basic components of Linux OS?9
➢ Kernel
➢ Kernel is the core of Linux OS which is responsible for all the major activities.
➢ It interacts directly with the underlying hardware while also providing the required abstraction to hide low level
hardware details to the system or application programs.
➢ Shells & GUI (System Libraries)
➢ They are special functions or programs using which application programs or system utilities access Kernel's features.
➢ These libraries implement most of the functionalities of the OS & do not require Kernel module's code access rights.
➢ System Utilities
➢ System utility programs are responsible for the execution of special and individual tasks.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How to check Memory stats and CPU stats as a Linux admin?10
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How to check Memory stats and CPU stats as a Linux admin?10
➢ By using ‘free’ & ‘vmstat’ command, you can see the physical memory & virtual memory statistics respectively.
➢ By using the ‘sar’ command, you can see the CPU utilization & other stats.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How to reduce or shrink the size of LVM partition?11
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How to reduce or shrink the size of LVM partition?11
The actions need to be performed in the below order:
1. Unmount the filesystem using unmount command
Syntax: umount /dev/hda2 /dir1
2. Use resize2fs command
Syntax: resiz32fs /dev/mapper/myvg-mylv 10G
3. Now use the lvreduce command
Syntax: lvreduce -L 10G /dev/mapper/myvg-mylv
The above Command will shrink the size LVM partition and fixes the filesystem size to 10GB.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 Explain the functionality of root user.12
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 Explain the functionality of root user.12
➢ The root user is similar to a superuser or a system administrator.
➢ Root user (superuser) has ultimate control and access to all files/ directories in the system.
Examples: Creating and maintaining user accounts, assigning different permissions for each
account, etc.
➢ Another advantage: restricted programs can be executed from the terminal by using the root
account
➢ Root is the default account every time Linux is installed.
#: root
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is CLI?
 What is GUI?13
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is CLI?
 What is GUI?13
➢ CLI stands for Command Line Interface. This interface allows user to type declarative commands to instruct the
computer to perform operations.
➢ Linux CLI is called Terminal and the commands will be interpreted by the Shell. Preferred by developers/ programmers.
➢ Advantage: Multiple steps can be executed by specifying a single command.
➢ GUI stands for Graphical User Interface and makes the system attractive
➢ Users who find it difficult to remember commands, can use the GUI.
➢ GUI allows the users to navigate/ access files by clicking on images and icons.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How can you find out how much memory Linux is using?14
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How can you find out how much memory Linux is using?14
➢ From the command line, use the “cat” command for memory usage information.
$ cat /proc/meminfo
➢ You will get an output like this: Mem: 64655360
This is the total memory Linux has available for use.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is Swap space?
 What is the typical size for a Swap partition under Linux system?15
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is Swap space?
 What is the typical size for a Swap partition under Linux system?15
➢ Swap space is a certain amount of space used by Linux to temporarily hold active programs.
This happens when RAM does not have enough memory to hold all programs that are being executed.
Swap space is defined in File System.
➢ The preferred size for a swap partition is twice the amount of physical memory available on the system.
If this is not possible, then the minimum size should be the same as the amount of memory installed.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How do you access partitions under Linux?16
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How do you access partitions under Linux?16
➢ Linux assigns numbers at the end of the drive to identify them uniquely.
➢ For example, if the first IDE hard drive had three primary partitions, they would be:
/dev/hda1, /dev/hda2 and /dev/hda3.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How are hard drives and floppy drives referred in Linux filesystem?17
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How are hard drives and floppy drives referred in Linux filesystem?17
➢ Floppy drives can be accessed by using: /dev/fd0 and /dev//fd1
➢ IDE/EIDE hard drives can be accessed by using: /dev/hda, /dev/hdb, /dev/hdc, and so forth.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 In Linux, how are names assigned to the different serial ports?18
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 In Linux, how are names assigned to the different serial ports?18
➢ Serial ports are identified as /dev/ttyS0 to /dev/ttyS7.
➢ These are the equivalent names of COM1 to COM8 in Windows.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How are parallel ports (like printers) referenced in Linux?19
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How are parallel ports (like printers) referenced in Linux?19
➢ In Linux, parallel ports are referred to as /dev/lp0, /dev/lp1, /dev/lp2 and so forth.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What are the kind of permissions available in Linux?20
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What are the kind of permissions available in Linux?20
There are basically 3 levels of file/ directory permissions in Linux:
➢ Read: Users only read the files or list the directory contents
➢ Write: Users can write information to the file and create files/ sub-directories in a directory
➢ Execute: Users can run the file or lookup a specific file within a directory
➢ Besides these, you can have a combination of all these three levels of permissions or two
of them or only one of them.
Read – ‘r’
Write – ‘w’
Execute – ‘x’
F I L E P E R M I S S I O N S
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How do you change permissions under Linux?21
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How do you change permissions under Linux?21
The following commands are used along with operators as arguments:-
➢ chmod : To change the permissions of files and directories
➢ chown : To change the owner of files and directories
➢ chgrp : To change the group ownership of file and directories
➢ Examples:
• chmod g+wx,o-wx,u=rwx filename
• chown username filename
Add permissions: ‘+’
Revoke permissions: ‘–’
Replace permissions: ‘=’
OPER ATOR S
Users – ‘u’
Groups – ‘g’
Others – ‘o’
All – ‘a’
D EN OTION S
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What are Symbolic links?22
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What are Symbolic links?22
➢ Symbolic links are similar to shortcuts in Windows. Also called Soft links.
➢ Symbolic links can point to either programs or files or directories; but do not
contain the data in the target file.
➢ Benefit: Allows instant access to a file without having to navigate to the entire
pathname.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What are the qualities of soft links?23
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What are the qualities of soft links?23
i. Soft link files have different inode numbers compared to the source file.
ii. The soft link file will be of no use if original file is deleted.
iii. Soft links are not updated.
iv. They can create links between directories.
v. They can cross file system boundaries.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What are Hard links?24
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What are Hard links?24
➢ Hard links point directly to the physical file on disk, and not to the path name.
➢ Even if you rename or move the original file, this link will not break.
➢ Since this link points to the file itself and not the path where the file is located.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is the maximum length of a filename under Linux?25
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is the maximum length of a filename under Linux?25
➢ The filename can have a maximum of 255 characters.
➢ This limit does not include path name
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 Which type of files are prefixed with a dot?26
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 Which type of files are prefixed with a dot?26
➢ Filenames that are prefixed with a dot are hidden files.
➢ These hidden files can be configuration files that hold important data or setup info.
➢ Setting these files as hidden makes it less likely to be accidentally deleted.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is a Virtual desktop?27
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is a Virtual desktop?27
➢ When a user’s desktop environment (icons, wallpaper, windows, folders, toolbars, widgets,
etc.) is stored in a remote server, rather than on a local PC, then it’s called a virtual
desktop.
➢ Desktop virtualization software separates the server and the client.
➢ The remote server supporting virtual desktops uses a software called hypervisor to create a
“virtual machine” that simulates the user’s desktop environment.
➢ Internet connection is the only need for accessing virtual desktops.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is the benefit of Virtual desktops in Linux?28
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is the benefit of Virtual desktops in Linux?28
You can share a program/ file/ directory across various virtual desktops using Linux OS.
➢ To share a program across different virtual desktops, press the pushpin button in the upper left-hand corner of a
program window.
➢ This will cause the “pinned” application to appear in all virtual desktops, in the same position onscreen.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What does a nameless (empty) directory represent?29
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What does a nameless (empty) directory represent?29
➢ An empty directory name serves as a nameless base for the Linux file system.
➢ This serves as an attachment for all other directories, files, drives and devices.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How can you create folders and files using the Terminal?30
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How can you create folders and files using the Terminal?30
➢ To create a folder the command used is: mkdir
➢ To create a file any of the following commands can be used:
➢ vi
➢ vim
➢ gedit
➢ nano and many more.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What are the different ways to view the contents of a file?31
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What are the different ways to view the contents of a file?31
To view file contents, you can use any of Linux’s inbuilt editor or a graphical editor. Some of them are:
➢ cat
➢ vi
➢ vim
➢ gedit
➢ kate/kwrite
➢ pico
➢ nano and many more.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What are Environmental variables?32
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What are Environmental variables?32
➢ Environmental variables are global settings that control the behavior of Shell, software packages installed in
Linux and other processes.
➢ The path where the various software’s are installed, will be stored as environment variables.
➢ Environmental variables are thus used to pass information into processes that are spawned from the shell.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is the functionality of ‘tab’ key in CLI?33
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is the functionality of ‘tab’ key in CLI?33
➢ ‘Tab’ key is a shortcut key which is used to autofill the complete filename/ pathname of any file or directory.
➢ For example, while navigating to a directory, the next directory in the path is shortlisted.
To reach /home/edureka/Documents/Folder1/File1.txt ,
You can press ‘Tab’ after typing in a few characters like: /ho[tab]/edur[tab]/Docu[tab]/Fo[tab]/Fi[tab]
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is Redirection in Linux?34
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is Redirection in Linux?34
➢ In Linux, Redirection is used to pass the output of one operation as input to another operation in the same command.
➢ The operator used for Redirection is ‘>’
➢ Examples:-
cat file1 file2 > file3.txt
cat >> file1.txt
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is GREP command?35
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is GREP command?35
➢ To search for a particular string/ word in a text file ‘grep’ command is used.
➢ It also supports pattern-based searching.
➢ Pattern-based searching is done by including options and parameters in the command.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How to terminate an ongoing process in Linux?36
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How to terminate an ongoing process in Linux?36
➢ Every process in the Linux system is identified by a unique process id or ‘pid’.
➢ To terminate any process, use the ‘kill’ command followed by its pid.
➢ To terminate all process at once, use kill 0.
➢ You can also terminate an ongoing process by pressing ‘ctrl + z’.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How to insert comments in command prompt?37
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How to insert comments in command prompt?37
➢ Comments are inserted by using the ‘#’ symbol before the comment text.
➢ When ‘#’ is prefixed to any line, then that line is ignored and will not be executed by the Shell.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 Can you insert several commands in a single command line entry?
If so, then how?38
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 Can you insert several commands in a single command line entry?
If so, then how?38
➢ Several commands can be combined by separating each of them by using a semicolon(;).
➢ For example, you can issue such a series of commands in a single entry.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 Write a command that will display all the ‘.txt’ files, along with its
permissions.39
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 Write a command that will display all the ‘.txt’ files, along with its
permissions.39
$ ls -a -l *.txt
➢ ls command will list down all the content in the directory.
➢ -a is used to include even hidden files.
➢ -l is used to display the contents in long format.
➢ *.txt filters the results and displays only .txt files.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 Write a command that will look for files with “txt” extension, and has the
occurrence of the string “edureka” in it.40
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 Write a command that will look for files with “txt” extension, and has the
occurrence of the string “edureka” in it.40
$ Find ./ -name “*.txt” | xargs grep –i “edureka”
➢ Find is used to shortlist all files with extension ‘.txt’.
➢ grep is used to search for the string “edureka” from the file.
➢ ‘|’ a.k.a ‘pipe’ command is used to perform two operations in the same command.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How to find the status of a process?41
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How to find the status of a process?41
The following command can be used to find the status of all the running process:
$ ps ux
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is the command to calculate the size of a folder?42
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is the command to calculate the size of a folder?42
The following command can be used to find the size of a folder:
$ du –sh folder-name.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How to check the memory status of the system?43
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How to check the memory status of the system?43
You can use the ‘free’ command to check the memory status of the system.
$ free -m // Displays the output in MB
$ free -g // Displays the output in GB
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How to log in as root in Linux from the terminal?44
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How to log in as root in Linux from the terminal?44
➢ The ‘su’ command can be used to switch user account to root user (superuser).
$ su root
# apt-get update
➢ The ‘sudo’ command can be used to execute only that command as root user.
$ sudo apt-get update
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How you can run a Linux program in the background simultaneously
when you start your Linux Server?45
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 How you can run a Linux program in the background simultaneously
when you start your Linux Server?45
➢ By using the ‘nohup’ command, the process will run in the background.
➢ The process receiving the NOHUP signal will be terminated when you log out of the program, which was used to
invoke it.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 Which daemon tracks events on your system?46
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 Which daemon tracks events on your system?46
➢ The syslogd daemon tracks the system information and saves it to specified log files.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is partial backup?47
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is partial backup?47
➢ When you select only a portion of your file hierarchy or a single partition for back up, it is called partial backup.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is an Inode?48
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What is an Inode?48
➢ Contents of the file will be stored in Data blocks.
➢ Whereas, information about that file will be stored in Inode.
➢ The information stored would be:
➢ File-size
➢ Mode/permission (protection)
➢ Owner ID
➢ Group ID
➢ Number of hard links to the file
➢ Time last accessed
➢ Time last modified
➢ Time Inode last modified
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 Which command is used to set a processor-intensive job to execute in
less CPU time?49
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 Which command is used to set a processor-intensive job to execute in
less CPU time?49
➢ Priority of the jobs can be changed by using the ‘nice’ command.
➢ Syntax:-
nice [OPTION] [COMMAND [ARG]...]
➢ Priority ranges from -20 to 19 where, -20 is the highest priority and 19 is the lowest priority.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What are shadow passwords? And how are they enabled?50
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING
Linux Interview Questions & Answers
 What are shadow passwords? And how are they enabled?50
➢ Shadow passwords are given for better system security.
➢ Every user’s password will be stored in /etc/passwd file.
➢ By implementing shadow passwords, all passwords will be stored in encrypted form in a new file: /etc/passwd
➢ Passwords in the original file will then be replaced with ‘x’.
www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATION CERTIFICATION TRAINING

Linux Interview Questions And Answers | Linux Administration Tutorial | Linux Training | Edureka

  • 1.
  • 2.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is Linux?1
  • 3.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is Linux?1 ➢ Linux is an open-source operating system inspired by UNIX. ➢ It was first introduced by Linus Torvalds. ➢ Linux is just a Kernel and a Linux distribution makes it a usable operating systems. ➢ It’s the preferred OS for computers, servers, mainframes, mobile devices and embedded devices.
  • 4.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How different is LINUX when compared to UNIX?2
  • 5.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How different is LINUX when compared to UNIX?2 ➢ Unix is a propriety operating system from Bell Laboratories. The Open Group holds the UNIX trademark & manage the UNIX trademark licensing program. Companies have their own licensed UNIX: IBM(AIX), Solaris(Sun OS), HP(HP-UX), Apple(OSX).. ➢ Linux is free, open source and intended as a non-propriety operating system for the masses. Linux is a clone of Unix, written from scratch by Linus Torvalds & his team. Linux distro  GUI system + GNU utilities.
  • 6.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is the importance of the GNU project?3
  • 7.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is the importance of the GNU project?3 ➢ GNU project is a result of the Free Software Movement started by Richard Stallman. ➢ It supported the open-source & collaborated development of operating system software. ➢ Acronym of GNU is “GNU’s Not Unix!”. ➢ GNU project was intended to create a UNIX-like OS; but free & open-source. ➢ This lead to the birth of Linux OS  Linux Kernel + GNU utilities.
  • 8.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is Linux Kernel?4
  • 9.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is Linux Kernel?4 ➢ The Linux Kernel is a low-level systems software whose main role is to manage hardware resources for the user. ➢ It is the core of any OS & it is responsible for translating the user commands into equivalent language understood by the computer hardware.
  • 10.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is Shell?  What is BASH?5
  • 11.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is Shell?  What is BASH?5 ➢ Shell ➢ The Shell is a program that takes commands from the keyboard and passes them to the operating system (kernel) for performing. ➢ During the initial days, Shell was the only mode for communicating with kernel (via the CLI). ➢ BASH ➢ BASH is short for Bourne Again SHell. It’s a replacement to the original Shell (/bin/sh). ➢ BASH combines the features of the original Shell + additional functionality to make it easier and more convenient to use. ➢ Nowadays, BASH has been adopted as the default shell for most Linux systems.
  • 12.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What are Daemons?6
  • 13.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What are Daemons?6 ➢ A daemon is a type of program that runs in the background, free of user control. ➢ They can be activated (initiated as a process) by the occurrence of a specific event or condition. ➢ Daemons accommodate service requests from other programs or hardware activity or requests from other computers on a network. ➢ After the request is serviced, the Daemon disconnects and waits for further requests.
  • 14.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is LILO?7
  • 15.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is LILO?7 ➢ LILO is an acronym for Linux Loader. ➢ It is a boot loader, which loads the Linux operating system into main memory so that it can begin its operations. ➢ LILO can be configured to boot other operating systems also. ➢ LILO is customizable, which means that if the default configuration is not correct, it can be changed. Config file for LILO is lilo.conf.
  • 16.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What are the advantages of Linux being open-source?8
  • 17.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What are the advantages of Linux being open-source?8 ➢ Being open-source, Linux gives users access to the source code. ➢ Open source allows users to distribute the software, including source the code (freely) to anyone interested. ➢ It allows users to add features, debug and correct errors in the original source code. ➢ When the source code has been improved, it can be freely redistributed (open-source collaboration). ➢ This benefits everyone in the open-source community.
  • 18.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What are the basic components of Linux OS?9
  • 19.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What are the basic components of Linux OS?9 ➢ Kernel ➢ Kernel is the core of Linux OS which is responsible for all the major activities. ➢ It interacts directly with the underlying hardware while also providing the required abstraction to hide low level hardware details to the system or application programs. ➢ Shells & GUI (System Libraries) ➢ They are special functions or programs using which application programs or system utilities access Kernel's features. ➢ These libraries implement most of the functionalities of the OS & do not require Kernel module's code access rights. ➢ System Utilities ➢ System utility programs are responsible for the execution of special and individual tasks.
  • 20.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How to check Memory stats and CPU stats as a Linux admin?10
  • 21.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How to check Memory stats and CPU stats as a Linux admin?10 ➢ By using ‘free’ & ‘vmstat’ command, you can see the physical memory & virtual memory statistics respectively. ➢ By using the ‘sar’ command, you can see the CPU utilization & other stats.
  • 22.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How to reduce or shrink the size of LVM partition?11
  • 23.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How to reduce or shrink the size of LVM partition?11 The actions need to be performed in the below order: 1. Unmount the filesystem using unmount command Syntax: umount /dev/hda2 /dir1 2. Use resize2fs command Syntax: resiz32fs /dev/mapper/myvg-mylv 10G 3. Now use the lvreduce command Syntax: lvreduce -L 10G /dev/mapper/myvg-mylv The above Command will shrink the size LVM partition and fixes the filesystem size to 10GB.
  • 24.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  Explain the functionality of root user.12
  • 25.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  Explain the functionality of root user.12 ➢ The root user is similar to a superuser or a system administrator. ➢ Root user (superuser) has ultimate control and access to all files/ directories in the system. Examples: Creating and maintaining user accounts, assigning different permissions for each account, etc. ➢ Another advantage: restricted programs can be executed from the terminal by using the root account ➢ Root is the default account every time Linux is installed. #: root
  • 26.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is CLI?  What is GUI?13
  • 27.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is CLI?  What is GUI?13 ➢ CLI stands for Command Line Interface. This interface allows user to type declarative commands to instruct the computer to perform operations. ➢ Linux CLI is called Terminal and the commands will be interpreted by the Shell. Preferred by developers/ programmers. ➢ Advantage: Multiple steps can be executed by specifying a single command. ➢ GUI stands for Graphical User Interface and makes the system attractive ➢ Users who find it difficult to remember commands, can use the GUI. ➢ GUI allows the users to navigate/ access files by clicking on images and icons.
  • 28.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How can you find out how much memory Linux is using?14
  • 29.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How can you find out how much memory Linux is using?14 ➢ From the command line, use the “cat” command for memory usage information. $ cat /proc/meminfo ➢ You will get an output like this: Mem: 64655360 This is the total memory Linux has available for use.
  • 30.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is Swap space?  What is the typical size for a Swap partition under Linux system?15
  • 31.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is Swap space?  What is the typical size for a Swap partition under Linux system?15 ➢ Swap space is a certain amount of space used by Linux to temporarily hold active programs. This happens when RAM does not have enough memory to hold all programs that are being executed. Swap space is defined in File System. ➢ The preferred size for a swap partition is twice the amount of physical memory available on the system. If this is not possible, then the minimum size should be the same as the amount of memory installed.
  • 32.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How do you access partitions under Linux?16
  • 33.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How do you access partitions under Linux?16 ➢ Linux assigns numbers at the end of the drive to identify them uniquely. ➢ For example, if the first IDE hard drive had three primary partitions, they would be: /dev/hda1, /dev/hda2 and /dev/hda3.
  • 34.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How are hard drives and floppy drives referred in Linux filesystem?17
  • 35.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How are hard drives and floppy drives referred in Linux filesystem?17 ➢ Floppy drives can be accessed by using: /dev/fd0 and /dev//fd1 ➢ IDE/EIDE hard drives can be accessed by using: /dev/hda, /dev/hdb, /dev/hdc, and so forth.
  • 36.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  In Linux, how are names assigned to the different serial ports?18
  • 37.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  In Linux, how are names assigned to the different serial ports?18 ➢ Serial ports are identified as /dev/ttyS0 to /dev/ttyS7. ➢ These are the equivalent names of COM1 to COM8 in Windows.
  • 38.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How are parallel ports (like printers) referenced in Linux?19
  • 39.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How are parallel ports (like printers) referenced in Linux?19 ➢ In Linux, parallel ports are referred to as /dev/lp0, /dev/lp1, /dev/lp2 and so forth.
  • 40.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What are the kind of permissions available in Linux?20
  • 41.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What are the kind of permissions available in Linux?20 There are basically 3 levels of file/ directory permissions in Linux: ➢ Read: Users only read the files or list the directory contents ➢ Write: Users can write information to the file and create files/ sub-directories in a directory ➢ Execute: Users can run the file or lookup a specific file within a directory ➢ Besides these, you can have a combination of all these three levels of permissions or two of them or only one of them. Read – ‘r’ Write – ‘w’ Execute – ‘x’ F I L E P E R M I S S I O N S
  • 42.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How do you change permissions under Linux?21
  • 43.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How do you change permissions under Linux?21 The following commands are used along with operators as arguments:- ➢ chmod : To change the permissions of files and directories ➢ chown : To change the owner of files and directories ➢ chgrp : To change the group ownership of file and directories ➢ Examples: • chmod g+wx,o-wx,u=rwx filename • chown username filename Add permissions: ‘+’ Revoke permissions: ‘–’ Replace permissions: ‘=’ OPER ATOR S Users – ‘u’ Groups – ‘g’ Others – ‘o’ All – ‘a’ D EN OTION S
  • 44.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What are Symbolic links?22
  • 45.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What are Symbolic links?22 ➢ Symbolic links are similar to shortcuts in Windows. Also called Soft links. ➢ Symbolic links can point to either programs or files or directories; but do not contain the data in the target file. ➢ Benefit: Allows instant access to a file without having to navigate to the entire pathname.
  • 46.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What are the qualities of soft links?23
  • 47.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What are the qualities of soft links?23 i. Soft link files have different inode numbers compared to the source file. ii. The soft link file will be of no use if original file is deleted. iii. Soft links are not updated. iv. They can create links between directories. v. They can cross file system boundaries.
  • 48.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What are Hard links?24
  • 49.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What are Hard links?24 ➢ Hard links point directly to the physical file on disk, and not to the path name. ➢ Even if you rename or move the original file, this link will not break. ➢ Since this link points to the file itself and not the path where the file is located.
  • 50.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is the maximum length of a filename under Linux?25
  • 51.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is the maximum length of a filename under Linux?25 ➢ The filename can have a maximum of 255 characters. ➢ This limit does not include path name
  • 52.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  Which type of files are prefixed with a dot?26
  • 53.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  Which type of files are prefixed with a dot?26 ➢ Filenames that are prefixed with a dot are hidden files. ➢ These hidden files can be configuration files that hold important data or setup info. ➢ Setting these files as hidden makes it less likely to be accidentally deleted.
  • 54.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is a Virtual desktop?27
  • 55.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is a Virtual desktop?27 ➢ When a user’s desktop environment (icons, wallpaper, windows, folders, toolbars, widgets, etc.) is stored in a remote server, rather than on a local PC, then it’s called a virtual desktop. ➢ Desktop virtualization software separates the server and the client. ➢ The remote server supporting virtual desktops uses a software called hypervisor to create a “virtual machine” that simulates the user’s desktop environment. ➢ Internet connection is the only need for accessing virtual desktops.
  • 56.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is the benefit of Virtual desktops in Linux?28
  • 57.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is the benefit of Virtual desktops in Linux?28 You can share a program/ file/ directory across various virtual desktops using Linux OS. ➢ To share a program across different virtual desktops, press the pushpin button in the upper left-hand corner of a program window. ➢ This will cause the “pinned” application to appear in all virtual desktops, in the same position onscreen.
  • 58.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What does a nameless (empty) directory represent?29
  • 59.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What does a nameless (empty) directory represent?29 ➢ An empty directory name serves as a nameless base for the Linux file system. ➢ This serves as an attachment for all other directories, files, drives and devices.
  • 60.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How can you create folders and files using the Terminal?30
  • 61.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How can you create folders and files using the Terminal?30 ➢ To create a folder the command used is: mkdir ➢ To create a file any of the following commands can be used: ➢ vi ➢ vim ➢ gedit ➢ nano and many more.
  • 62.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What are the different ways to view the contents of a file?31
  • 63.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What are the different ways to view the contents of a file?31 To view file contents, you can use any of Linux’s inbuilt editor or a graphical editor. Some of them are: ➢ cat ➢ vi ➢ vim ➢ gedit ➢ kate/kwrite ➢ pico ➢ nano and many more.
  • 64.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What are Environmental variables?32
  • 65.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What are Environmental variables?32 ➢ Environmental variables are global settings that control the behavior of Shell, software packages installed in Linux and other processes. ➢ The path where the various software’s are installed, will be stored as environment variables. ➢ Environmental variables are thus used to pass information into processes that are spawned from the shell.
  • 66.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is the functionality of ‘tab’ key in CLI?33
  • 67.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is the functionality of ‘tab’ key in CLI?33 ➢ ‘Tab’ key is a shortcut key which is used to autofill the complete filename/ pathname of any file or directory. ➢ For example, while navigating to a directory, the next directory in the path is shortlisted. To reach /home/edureka/Documents/Folder1/File1.txt , You can press ‘Tab’ after typing in a few characters like: /ho[tab]/edur[tab]/Docu[tab]/Fo[tab]/Fi[tab]
  • 68.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is Redirection in Linux?34
  • 69.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is Redirection in Linux?34 ➢ In Linux, Redirection is used to pass the output of one operation as input to another operation in the same command. ➢ The operator used for Redirection is ‘>’ ➢ Examples:- cat file1 file2 > file3.txt cat >> file1.txt
  • 70.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is GREP command?35
  • 71.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is GREP command?35 ➢ To search for a particular string/ word in a text file ‘grep’ command is used. ➢ It also supports pattern-based searching. ➢ Pattern-based searching is done by including options and parameters in the command.
  • 72.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How to terminate an ongoing process in Linux?36
  • 73.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How to terminate an ongoing process in Linux?36 ➢ Every process in the Linux system is identified by a unique process id or ‘pid’. ➢ To terminate any process, use the ‘kill’ command followed by its pid. ➢ To terminate all process at once, use kill 0. ➢ You can also terminate an ongoing process by pressing ‘ctrl + z’.
  • 74.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How to insert comments in command prompt?37
  • 75.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How to insert comments in command prompt?37 ➢ Comments are inserted by using the ‘#’ symbol before the comment text. ➢ When ‘#’ is prefixed to any line, then that line is ignored and will not be executed by the Shell.
  • 76.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  Can you insert several commands in a single command line entry? If so, then how?38
  • 77.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  Can you insert several commands in a single command line entry? If so, then how?38 ➢ Several commands can be combined by separating each of them by using a semicolon(;). ➢ For example, you can issue such a series of commands in a single entry.
  • 78.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  Write a command that will display all the ‘.txt’ files, along with its permissions.39
  • 79.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  Write a command that will display all the ‘.txt’ files, along with its permissions.39 $ ls -a -l *.txt ➢ ls command will list down all the content in the directory. ➢ -a is used to include even hidden files. ➢ -l is used to display the contents in long format. ➢ *.txt filters the results and displays only .txt files.
  • 80.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  Write a command that will look for files with “txt” extension, and has the occurrence of the string “edureka” in it.40
  • 81.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  Write a command that will look for files with “txt” extension, and has the occurrence of the string “edureka” in it.40 $ Find ./ -name “*.txt” | xargs grep –i “edureka” ➢ Find is used to shortlist all files with extension ‘.txt’. ➢ grep is used to search for the string “edureka” from the file. ➢ ‘|’ a.k.a ‘pipe’ command is used to perform two operations in the same command.
  • 82.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How to find the status of a process?41
  • 83.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How to find the status of a process?41 The following command can be used to find the status of all the running process: $ ps ux
  • 84.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is the command to calculate the size of a folder?42
  • 85.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is the command to calculate the size of a folder?42 The following command can be used to find the size of a folder: $ du –sh folder-name.
  • 86.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How to check the memory status of the system?43
  • 87.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How to check the memory status of the system?43 You can use the ‘free’ command to check the memory status of the system. $ free -m // Displays the output in MB $ free -g // Displays the output in GB
  • 88.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How to log in as root in Linux from the terminal?44
  • 89.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How to log in as root in Linux from the terminal?44 ➢ The ‘su’ command can be used to switch user account to root user (superuser). $ su root # apt-get update ➢ The ‘sudo’ command can be used to execute only that command as root user. $ sudo apt-get update
  • 90.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How you can run a Linux program in the background simultaneously when you start your Linux Server?45
  • 91.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  How you can run a Linux program in the background simultaneously when you start your Linux Server?45 ➢ By using the ‘nohup’ command, the process will run in the background. ➢ The process receiving the NOHUP signal will be terminated when you log out of the program, which was used to invoke it.
  • 92.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  Which daemon tracks events on your system?46
  • 93.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  Which daemon tracks events on your system?46 ➢ The syslogd daemon tracks the system information and saves it to specified log files.
  • 94.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is partial backup?47
  • 95.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is partial backup?47 ➢ When you select only a portion of your file hierarchy or a single partition for back up, it is called partial backup.
  • 96.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is an Inode?48
  • 97.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What is an Inode?48 ➢ Contents of the file will be stored in Data blocks. ➢ Whereas, information about that file will be stored in Inode. ➢ The information stored would be: ➢ File-size ➢ Mode/permission (protection) ➢ Owner ID ➢ Group ID ➢ Number of hard links to the file ➢ Time last accessed ➢ Time last modified ➢ Time Inode last modified
  • 98.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  Which command is used to set a processor-intensive job to execute in less CPU time?49
  • 99.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  Which command is used to set a processor-intensive job to execute in less CPU time?49 ➢ Priority of the jobs can be changed by using the ‘nice’ command. ➢ Syntax:- nice [OPTION] [COMMAND [ARG]...] ➢ Priority ranges from -20 to 19 where, -20 is the highest priority and 19 is the lowest priority.
  • 100.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What are shadow passwords? And how are they enabled?50
  • 101.
    www.edureka.co/linux-adminEDUREKA’S LINUX ADMINISTRATIONCERTIFICATION TRAINING Linux Interview Questions & Answers  What are shadow passwords? And how are they enabled?50 ➢ Shadow passwords are given for better system security. ➢ Every user’s password will be stored in /etc/passwd file. ➢ By implementing shadow passwords, all passwords will be stored in encrypted form in a new file: /etc/passwd ➢ Passwords in the original file will then be replaced with ‘x’.
  • 102.