Last updated on Nov 11, 2023
HKR's Linux Administration interview questions and answers guide is designed to accelerate your career in Linux administration. Linux, an open-source licensed operating system, is based on kernel source and can be customized. This guide not only covers various aspects of Linux administration tools but also prepares you for complex interviews with any company. Start your journey in understanding the role and significance of Linux administration in the business workforce.
Ans: Linux is a widely used operating system developed on the Linux Kernel foundation. Known for its open-source nature, it supports various hardware platforms. Linux is favoured for offering cost-effective, user-friendly operating solutions that are easily adaptable. The ability to customize and adapt its source code is a key advantage.
Interested in learning Linux Join hkr and Learn more on Linux Training
Ans: Linus Torvalds, a student at the University of Helsinki in Finland in 1991, conceived the Linux operating system. It originated as a personal project by Torvalds to create a free version of UNIX. It evolved into what we now know as the Linux Kernel.
Ans: Linux and UNIX differ in several ways:
Ans: The core of the Linux operating system is its Kernel.
Ans: Linux permissions include Read (viewing files), Write (modifying files), and Execute (running files).
Ans: CLI, or Command-Line Interface, is a user interface interacting with computer programs via text commands.
Ans: BASH, developed for GNU projects, is a UNIX shell and command processor created by Brian Fox. It’s free software that can replace the Bourne shell and is interpreted, not compiled.
Ans: Linux's process management includes system calls like fork() (creating new processes), exec() (executing new processes), wait() (pausing for process execution), and exit() (exiting a process). It also includes commands for retrieving process IDs.
Ans: Linux's superior security stems from its limited default user privileges, robust auditing system, and use of IPtables for enhanced security measures.
Ans: The Linux kernel, central to the operating system, facilitates communication between software and hardware.
Become a UiPath Certified professional by learning this HKR Embedded Hardware Design Development Training !
Ans: LILO, or Linux Loader, is a boot loader for the Linux operating system.
Ans: The grep command searches for specific patterns in files or outputs.
Ans: Commands in the vi editor include vi filename (creating/modifying files), view filename (opening files in read-only mode), X (deleting characters), and dd (deleting lines).
Linux directory commands include:
Ans: The ‘cd’ command, used for navigating directories, has options like cd~, cd-, ., and cd/.
Ans: Linux features portability, open-source availability, multi-user capabilities, multi-programming, a
shell interface, and robust security.
Ans: The cat command is used for displaying file contents and concatenating files.
Ans: PIPE in Linux is a redirection method that connects the output of one command as input to another.
Ans: The "chmod" command changes file and directory permissions in Linux.
Ans: To exit “vi” editors, use commands like wq (save and exit) or q! (exit without saving).
Ans: Permissions in Linux are managed using the chmod command with symbols like ‘+’ (add), ‘-’ (deny), and single-letter permissions for user, group, others, and all.
Ans: The vi editor has modes like Command Mode, Insertion Mode, and Ex Mode.
Ans: Cron is used for scheduling tasks to execute at specific times, ideal for servers, whereas Anacron is used for tasks to run on specific dates, suitable for both desktops and servers.
Ans: The env command in Linux is used to print a list of current environment variables or to run processes in a different environment.
Ans: In Linux, files can be appended using commands like cat file2 >> file1.
Ans: Redirection in Linux refers to directing data from one output to another, categorized as Input, Output, and Error Redirection.
Ans: The Linux Shell is an interface between the Kernel and the user, facilitating command execution and script processing.
Ans: Default ports include SMTP (25), DNS (53), FTP (20/21), DHCP (67/68), SSH (22), and Squid (3128).
Ans: To check listening ports, use commands like netstat --listen or netstat -l.
Ans: The Linux Shell is an interface for executing commands and supports various categories like Bourne shell compatible, C shell compatible, nontraditional, and historical.
We have the perfect professional Linux Tutorial for you. Enroll now!
Ans: A shell script is a sequence of commands for the shell to control applications or perform tasks.
Ans: Open-source offers flexibility and security but can present challenges in usability and compatibility.
Ans: Pipes in UNIX are processes connected so that the output of one serves as the input to another.
Ans: Linux includes shells like C shell, Korn shell, Z shell, Bourne again shell, and Friendly interactive shell.
Ans: A stateless Linux server does not maintain individual workstation states, storing prototypes, snapshots, and home directories for systems.
Ans: Linux architecture includes the Kernel, Shell, GUI, System Utilities, and Application Programs.
Ans: Bash is a free shell for UNIX, combining features of the C and Korn shells.
Related Article : How To Install Kali Linux
Ans: In Linux, a Zombie refers to a process state where the child process dies before the parent, remaining in the process table.
Ans: Swap space in Linux is used for managing memory, especially when physical memory runs low.
Ans: The GUI, or Graphical User Interface, in Linux is a user-friendly interface using windows, icons, and menus.
Ans: File permissions in Linux include Read, Write, and Execute.
Ans: Differences between BASH and DOS include case sensitivity, directory separators, and command conventions.
Ans: Symbolic links in Linux are like shortcuts pointing to other files or directories.
[ Related Article: Adobe CQ5 System Administrator Training ]
Ans: Yes, the CTRL+ALT+DELETE key combination works on Linux for system restart.
Ans: Hard links in Linux directly point to the physical file on a disk.
Ans: Daemons in Linux are background services providing various functionalities.
Ans: A Virtual desktop in Linux is an alternative workspace to manage multiple running programs.
Ans: An inode in Linux uniquely identifies files or directories, while a process ID uniquely identifies each process.
Ans: Process states in Linux include New/Ready, Running, Blocked/Waiting, Terminated/Completed, and Zombie.
Ans: File permission groups in Linux include Owner, Group, and All Users.
Ans: The Linux file system manages and stores data, defining file boundaries.
Ans: LVM, standing for Logical Volume Management, is a critical tool in modern storage management. It offers enhanced flexibility by allowing users to create, resize, and delete disk partitions on-the-fly. LVM elevates storage management by offering increased abstraction and control, integrating various storage devices, and facilitating efficient allocation of logical volumes.
Ans: Unmask, short for user file creation mode mask, sets default file access permissions. When a file is created, Umask determines its initial access rights, adding a layer of security by applying specific restrictions to new files.
Ans: Setting a Umask permanently can be done through two methods: octal or symbolic representation. This ensures consistent file creation permissions, aligning with security protocols.
Related Article : Linux File Permission
Ans: Linux supports six modes of network bonding: Mode-0 (Balance-rr), Mode-1 (active-backup), Mode-2 (balance-Xor), Mode-3 (broadcast), Mode-4 (802.3ad), and Mode-5 (balance-tlb), each offering unique benefits for network resilience and performance.
Ans: Kernel modules reside in lib/modules/kernel-version/, storing compiled drivers' crucial information. The lsmod command reveals installed kernel modules.
Ans: Linux is free, open-source, customizable, offers high security, and supports both primary and logical partitioning for booting. In contrast, Windows is purchasable, not open-source, non-customizable, less resilient to viruses, and supports booting only from primary partitions.
Ans. Linux is an open-source, widely used OS based on the Linux Kernel, supporting diverse hardware and platforms. Renowned for its security and cost-effectiveness, it's a top choice for developers and offers multi-system installation at no cost.
Ans: Linux is portable, comes in both free and paid editions, primarily uses a GUI with an optional CLI, and is open-source. Unix, in contrast, is mostly paid, used in servers and PCs, is not open-source, and its source code is not publicly available.
Ans: The Kernel is the core of Linux OS, comprising various modules and managing all critical system activities.
Ans. Developed by Linus Torvalds in 1991 at the University of Helsinki, the Linux OS was named after the Linux Kernel, a software enabling user and application interactions with the system's devices.
Ans. LILO, or Linux Loader, is a boot loader in Linux, playing a crucial role in loading the OS into memory for operation initiation.
Ans. The Linux Kernel is at the heart of the Linux OS, responsible for all system actions and acting as an interface between software processes and hardware. It manages requests from applications to hardware components.
Ans. Bash, a Unix shell and command processor, is an advanced version of the Bourne Shell, part of the GNU project, and facilitates command execution from shell scripts.
Ans. CLI, or Command Line Interface, is a text-based interaction system where users execute commands via text lines, offering efficiency and speed over graphical interfaces.
Ans: Open Source OS, like Linux, offers accessibility, modifiability, and enhanced security, providing various user options and fostering innovation.
Ans. Challenges of Open Source OS include usability complexity, compatibility issues, limited technical support, potential security risks, and hidden long-term costs.
Ans. A shell in Linux is an interface between the user and the Kernel, allowing program and command execution.
Ans. Linux hosts various shells: C Shell (Csh), Z Shell (Zsh), Friendly Interactive Shell (Fish), Korn Shell (Ksh), and Bourne Again Shell (bash), each offering unique features and functionalities.
Ans. Linux's basic components include the Kernel (system core), Shell (user-kernel interface), GUI (Graphical User Interface), Utilities (system management tools), Application Programs (task-specific software), and Hardware (physical devices).
Ans. To open a terminal in Linux, press CTRL+ALT+T or search for 'terminal' in the menu search bar.
Ans: Swap Space in Linux acts as a backup for RAM, moving inactive pages to swap space when memory is insufficient.
Ans: GUI, or Graphical User Interface, in Linux uses windows, icons, and graphics, operated via mouse or keyboard, enhancing user interaction with the system.
Ans. Linux file permissions include Read (viewing files), Write (modifying files), and Execute (running programs or files).
Ans. Environment Variables in Linux are dynamic values affecting system processes, customizable for different functionalities.
Ans. Symbolic links (Symlinks) in Linux point to other files or folders, acting similarly to shortcuts.
Ans: A Hard link in Linux is a direct pointer to a file's location on the hard drive, independent of the original file's name or location changes.
Ans: Redirection in Linux changes the standard input/output paths, using metacharacters for file or program direction.
Ans: Daemons are background processes or programs in Linux, handling requests and system maintenance without direct user interaction.
Ans. The root account in Linux is a superuser with full system access, capable of performing tasks like software installation and file permission changes.
Ans. A Virtual Desktop in Linux is a user interface for managing windows, offering an alternative for desktop management.
Ans. The vi editor in Linux has three modes: Command Mode, Insert or Edit Mode, and Ex-command Mode.
Ans. Inode in Linux uniquely identifies files, while Process ID is a unique identifier for each running process.
Ans. Linux OS has five process states: Running, Sleeping, Stopped, Uninterruptible, and Zombie, each representing a different stage of a process lifecycle.
Ans. Process Management System Calls in Linux are interfaces between user programs and the OS, managing processes through various functions like fork(), exec(), getpid(), wait(), exit(), and getppid().
Ans. File Permission groups in Linux include Owner (specific user access), All Users (universal access), and Group (restricted group access).
Ans: The File System in Linux is a crucial component for data management and storage, organizing files within the system.
Ans. Linux supports a variety of file systems including Ext, Ext2, Ext3, Ext4, JFS, ufs, ReiserFS, XFS, btrfs, ntfs, and swap files.
Ans. LVM in Linux, essential for managing large storage volumes, provides flexibility in creating, resizing, and deleting partitions, and enhances storage control and abstraction.
Ans. Unmask in Linux sets default permissions for new files and directories, applying restrictions to enhance security.
Ans: To set a user's Umask permanently, use either octal or symbolic representation, shaping file and directory permissions.
Ans: Network Bonding in Linux combines multiple network interfaces into one, improving performance and redundancy.
Ans. Linux's network bonding modes include Mode-0(balance-rr), Mode-1(active-backup), Mode-2(xor), Mode-3(broadcast), Mode-4(dynamic aggregation), Mode-5(adaptive load-balancing), and Mode-6(adaptive load-sharing).
Ans. To check the default route and routing table in Linux, use commands like route -n, netstat -rn, and ip.
Ans. To check listening ports on a Linux Server, use commands like netstat --listen or netstat -l.
Ans. Kernel modules in Linux are located in lib/modules/kernel-version/, storing information about compiled drivers.
Ans. The 'init' command is used to alter the default run level in the Linux Operating System.
Ans: Sharing a directory using NFS involves editing the '/etc/exports' file, making an entry like '/', and restarting the NFS service in Linux OS.
Ans: To lock a user account in Linux OS, use the 'passwd' command to lock or remove the account password. The 'usermod' or 'change' command can end the user account. Alternatively, use the 'nologin' command to alter the shell for security purposes.
Ans: The 'ls' command in Linux OS lists files and directories. Using it without arguments lists files in the current directory. It can also display files in alphabetical order and list specific directory files using the directory name in the syntax.
Ans: In Linux OS, the Tail command displays the last N number of lines from the provided data, defaulting to the last 10 lines. The syntax is 'tail [OPTION]... [FILE]'.
Ans: The 'grep' command in Linux is a filter used for searching text through regular expressions. The syntax is 'grep [options] pattern [files]'.
Ans: The 'ps' command in Linux OS displays the current process status of the system, including process IDs and other related data. The syntax is 'Ps [options]'.
Ans: The 'env' command in Linux is a shell command used to print a list of current environment variables and can run another process in a different environment without changing the current one.
Ans: The 'top' command in Linux OS, referring to the Table of Processes, displays and updates arranged process data, showing the system process.
Ans: The 'netstat' command in Linux provides information on network status, routing tables, interface statistics, connections, and more.
Ans: The 'lsof' command in Linux OS, standing for List of Files, is used to identify files opened by any process.
Ans: The 'chmod' command in Linux is used for changing access permissions to scripts, system files, and directories. It represents permissions like read (4), write (2), and execute (1).
Ans: The 'cp' command in Linux is used for copying files and directories within the system. The syntax is '$ cp filename'.
Ans: The 'rm' command in Linux is utilized to delete files or directories. It offers various options for safe and selective removal, such as '-i' for confirmation and '-f' for forceful deletion.
Ans: The 'mkdir' command in Linux allows users to create directories, enabling the creation of multiple directories at once with assigned permissions. The syntax is 'mkdir [options...] [directories ...]'.
Ans: The 'rmdir' command in Linux is used to delete each directory specified on the command line. The syntax is 'rmdir [-p] [-v | –verbose] [–ignore-fail-on-non-empty] directories'.
Ans: To exit from the vi editor in Linux, use 'Wq' to save and exit, or 'q!' to exit without saving.
Ans: In vi editors, use the command 'x' to remove a character and 'dd' to remove a line for editing files.
Ans: Linux file content commands include 'head' for showing top lines, 'cat' for concatenating files, 'tail' for displaying ending lines, and 'more' for paginated viewing.
Ans: Linux Distributors include Linux Mint for robust use, openSUSE for new users, Ubuntu for desktop and server editions, Manjaro for a satisfying user experience, and Debian for stability and user-friendliness.
Ans. LINUX OS is used for its high stability, ease of operation, hardware compatibility, security, and open-source nature.
Ans: Linux OS features include portability across hardware, multi-user capabilities, high security, support for multiprogramming, and a shell for command execution.
Ans: Differences between Bash and DOS in Linux include case sensitivity, path separators, and command structures in Bash, while DOS commands are not case-sensitive and follow different naming protocols.
Ans. Internal commands in Linux are run directly by the shell without a separate process. External commands have their own process ID and are run by the Kernel.
Ans: Communication between parent and child processes in Linux involves sockets, pipes, message queues, and other inter-process communication mechanisms.
Ans: A Stateless Linux Server does not store states on workstations and may snapshot specific system states for outline requirements.
Ans: The 'ip tables' command in Linux is used for managing network traffic, functioning like a network firewall to block or allow traffic.
Ans: The 'pushd' command in Linux saves the current working directory in memory or stack for later retrieval.
Ans: The 'du' command in Linux is used for quickly checking disk usage or the number of blocks used by a file.
Ans: The 'df -h' command in Linux shows free space in the file system, while 'df -i' displays the number of free inodes.
Ans. The 'W' command in Linux shows who is logged into the system.
Ans: SMTP stands for Simple Mail Transfer Protocol, an internet standard for email transmission.
Ans: GZIP files in Linux can be decompressed using the 'gunzip' command.
Ans: The MD5 option in Linux, a Message-Digest Algorithm, is used for encrypting passwords before storage and for message authentication.
Ans: Basic Linux commands for user management include 'useradd', 'chmod', 'chown', 'usermod', 'change', 'userdel', 'delgroup', 'last', and 'chsh'.
Ans: The maximum length of a filename in Linux is 255 characters.
Ans: The 'dmesg' command is used to view Kernel Boot messages in Linux.
Ans: The Ping command in Linux, known as Packet Internet Groper, checks network connectivity between the host and server.
Ans: The 'fstab' command in Linux, referring to the filesystem table, is used for easier mounting and unmounting of file systems.
Ans. The "Nameless" directory in the Linux file system is an empty directory that functions as an attachment point for other directories, files, drives, etc.
Ans: To check memory status in Linux, use 'Free -m' for data in MB and 'Free -g' for data in GB.
Ans: To join two lines from two organized files in Linux, use the "comm file1 file2" command.
Ans: To examine resource usage in Linux, use the '/usr/bin/time -v ls' command.
Ans: Enable ACLs for the /home partition by checking if ACLs are enabled with the mount command, editing the /etc/fstab file to include the acl option for the /home partition, saving the changes, and then remounting the /home partition with sudo mount -o remount /home. Verify ACLs are enabled with the mount command again.
Ans: The modprobe.conf file is related to network devices as it specifies which kernel module to load for each device. For example, an entry like "alias eth0 b44" in modprobe.conf would associate the eth0 network device with the b44 kernel module.
Ans: To extend an existing VG0 volume group to 4 GB, first check the available space with vgdisplay. If needed, add physical volumes with pvcreate, extend VG0 with vgextend, and then use lvextend to increase the size of the logical volume to 4 GB. Finally, resize the filesystem using either resize2fs or xfs_growfs.
Ans: A Linux Administrator typically assigns either the /bin/false or /bin/no login shell to a POP3 mail-only account to prevent login access.
Ans: To change the window manager in Linux, modify the /.xinitrc file with the command exec window_manager_name. This sets the specified window manager to launch when the start command is run.
Ans: Yes, a Linux computer can be converted into a router. Enable IP forwarding, set up IP addresses, enable NAT with iptables, configure packet forwarding rules, set up DNS forwarding, update routing tables, and enable IP forwarding on boot to allow multiple machines to use the same Internet connection.
Ans: The "repquota" command is used to check the number of files, disk space, and each user's defined quota in Linux.
Ans: To restore original kernel system files after a hacked FTP server, first reinstall the core operating system, and then restore the system configuration files and user data from tape backup.
Ans: To create a tape archive file of the /home directory and send it to the /dev/tape device, use the command tar -cvf /dev/tape /home.
Ans: The two primary Linux User Modes are Command Line Mode and Graphical User Interface (GUI) Mode. Command Line Mode involves text-based commands, while GUI Mode provides a visual interface with windows, icons, and menus.
Ans: The maximum length of a filename in Linux is 255 characters, excluding the path name.
Ans: LD_LIBRARY_PATH is an environment variable in Linux that specifies the directories to be searched for loading libraries during the runtime of an application.
Ans: To print a file 'draft' with 60 lines on each page, use the command pr -l60 draft.
Ans: Convert a Linux computer into a router by enabling IP forwarding, setting up IP addresses, enabling NAT, configuring packet forwarding rules, setting up DNS forwarding, updating routing tables, and enabling IP forwarding on boot.
Ans: Enhance password security by enforcing password complexity, setting expiration and rotation policies, enabling Multi-Factor Authentication (MFA), implementing account lockouts and failed login attempt restrictions, educating users on password security, and storing passwords in hashed and salted formats.
Ans: A soft link, or symbolic link, in Linux is a type of file that points to another file or directory. It is created with the command ln -s [original filename] [link name] and can be used across different file systems.
Ans: Shrinking the size of an LVM in Linux involves reducing the size of the logical volume using the lvreduce command and then resizing the filesystem to match the new size of the logical volume.
Ans: A shell in Linux is an interface that allows users to interact with the operating system, facilitating the execution of commands and scripts.
Ans: Shell scripting in Linux is the process of writing a series of commands in a file to automate tasks and create custom commands.
Ans: Writing shell scripts is important for automating tasks, creating custom commands, saving time, and automating system administration tasks.
Ans. Common Linux commands include 'ls' for listing files, 'mkdir' for creating directories, 'rmdir' for removing directories, 'cp' for copying files, 'rm' for removing files, 'mv' for moving files, 'touch' for creating empty files, and 'cat' for displaying file contents.
Ans: Commonly used shells in Linux include the Bourne shell (Sh), C shell (csh), Korn shell (ksh), and Bourne again shell (bash).
Ans: Soft links are just links that define a name and are stored on different file systems. Hard links link to the inode of the file system and are also stored on different file systems.
Ans: Shell programs are stored in a file system named “sh”.
Ans: Advantages of the C shell over the Bourne shell include the ability to alias commands, use personal commands, command history features, and the ease of not having to type commands repeatedly.
Ans: No separate compiler is required in Linux to execute shell programs. The shell interprets and executes the commands in the programs.
Ans: Shell programming or scripting should not be used for complex programs, high-level productivity tasks, or when working with different software tools.
Ans: The two types of shell variables are system variables (usually in CAPITAL letters) and user-defined variables (defined in lowercase). System variables are predefined, like SHELL, while user-defined variables are set by the user.
Ans: Linux shell variables are stored as strings. For example, in $ a=50, '50' is stored as a string in the variable 'a'.
Ans: File permissions in Linux include read (r), write (w), and execute (x) permissions, with weights of 4, 2, and 1 respectively.
Ans: The three modes of the vi editor are Command mode (interprets keys as editor commands), Insert mode (allows text insertion and editing), and ex-command mode (enables the insertion of commands at the command line).
|Batch starts on 6th Dec 2023||
|Batch starts on 10th Dec 2023||
|Batch starts on 14th Dec 2023||