Linux Interview Questions Check !.. how good you are in Linux. 1 / 54 What is the purpose of the “lsblk” command in Linux? Display a list of available shells List block devices (storage devices) and their information List all running processes List installed software packages 2 / 54 Which Linux command is used to find and replace text in a file? find sed replace grep 3 / 54 What does the “dmesg” command display in Linux? System hardware information List of installed packages Kernel boot messages and system logs User login history 4 / 54 Which file contains the user-specific environment settings in a Linux home directory? /etc/profile .bash_profile /etc/environment /etc/passwd 5 / 54 In Linux, what does the “man” command do? Display system logs Create a new text file Generate random numbers Display manual pages for commands 6 / 54 Which Linux command is used to remove files or directories? rmdir rm delete clear 7 / 54 In Linux, what is the purpose of the “chroot” command? Create a new user account Change the root directory for a process Change the permissions of a file Change the system's time and date 8 / 54 What does the “whoami” command in Linux display? The current user's home directory The system's hostname The username of the current user The list of available commands 9 / 54 Which directory contains system configuration files in Linux? /etc /usr/local /var /lib 10 / 54 In Linux, what does the “uptime” command display? The current user's login time The system's uptime and load average A list of user accounts The time and date 11 / 54 Which Linux command is used to view the content of a file in reverse order (from the last line to the first)? cat tail tac head 12 / 54 What does the “umask” command control in Linux? User login permissions System timezone settings File and directory creation permissions System clock synchronization 13 / 54 In Linux, what is the primary function of the “rsync” command? Synchronize files and directories between systems Run remote shell commands Rename files Remove files and directories 14 / 54 Which command is used to display real-time system resource usage in Linux? top status sysinfo stats 15 / 54 What is the purpose of the “passwd -e” command in Linux? Change a user's password Encrypt a file Enable a user account Change a user's username 16 / 54 Which Linux command is used to create a compressed archive using the gzip algorithm? zip compress tar -czvf gzip 17 / 54 What does the “ls -l” command do in Linux? List files and directories in the current directory in long format List files and directories in long format with timestamps Create a new directory Display hidden files and directories 18 / 54 In Linux, what does the “date” command display by default? The system's uptime The current date and time The list of available time zones The contents of a text file 19 / 54 Which directory contains system log files in Linux? /etc /var/log /usr /bin 20 / 54 What is the purpose of the “ping” command in Linux? Send emails Test network connectivity to a host Display system logs Create a new file 21 / 54 Which command is used to add or remove users from a group in Linux? usermod groupadd useradd groupmod 22 / 54 In Linux, what does the “dd” command do? Display the contents of a text file Delete a directory copy and convert files Create a new user account 23 / 54 What does the “hostname” command do in Linux? Display the current time and date Set the hostname of the system List the IP addresses of network interfaces Print a list of connected users 24 / 54 What is the purpose of the “grep” command with the “-c” option in Linux? Count the number of lines in a text file List all files in a directory Search for a specific pattern in a file Count the occurrences of a pattern in a file 25 / 54 Which command is used to view the contents of a text file one page at a time, allowing scrolling with the spacebar in Linux ? cat less more view 26 / 54 What is the purpose of the “ifconfig” command in Linux ? Display the system's hardware information List installed software packages Configure network interfaces Check system uptime 27 / 54 Which Linux command is used to create a symbolic link (symlink)? link softlink symlink ln 28 / 54 What is the purpose of the “ps aux” command in Linux? Display user's home directory List all running processes Print system usage statistics Update system packages 29 / 54 Which directory is typically used to store user-specific configuration files in a Linux home directory? /etc /usr /home /config 30 / 54 Which Linux command is used to display the last few lines of a text file? cat head tail less 31 / 54 In Linux, what is the purpose of the “sudoers” file? Store user passwords Define system users Configure sudo access rules Manage system services 32 / 54 Which command is used to search for files and directories in a Linux system locate search find grep 33 / 54 What is the purpose of the “cron” service in Linux? Managing user accounts Automating scheduled tasks Archiving files Monitoring system logs 34 / 54 Which command is used to extract the contents of a compressed tar archive file in Linux? untar unzip decompress tar -xvf 35 / 54 Which file contains system-wide environment variables in Linux? .profile .bashrc /etc/environment .env 36 / 54 What does the “sudo” command allow a user to do in Linux? Switch to the root user Create a new user List directory contents Install software 37 / 54 What command is used to create a compressed archive file in Linux? tar zip compress gzip 38 / 54 Which directory is the root directory in the Linux file system hierarchy? /home /usr / /root 39 / 54 In Linux, what is the purpose of the “chmod” command? Change file ownership Change file permissions Change the file name Change the file size 40 / 54 Which command is used to install software packages in Debian-based Linux distributions? yum apt-get pacman dnf 41 / 54 What is the default shell in most Linux distributions? Bash Zsh Ksh Csh 42 / 54 Which command is used to display the contents of a directory in Linux? dir ls cd cat 43 / 54 Which Linux distribution is known for its use in servers and supercomputers? Ubuntu Fedora CentOS Arch Linux 44 / 54 What is the core component of a Linux operating system? Kernel Shell GUI Compiler 45 / 54 What is the purpose of the “chown” command in Linux? Change file ownership Change file permissions Change the file name Change the file size 46 / 54 Which Linux file contains system startup and shutdown scripts? /etc/init.d /usr/local/bin /var/log/messages /etc/passwd 47 / 54 What is the purpose of the “tar” command in Linux? List system hardware Archieve files and directories Create symbolic links Manage system services 48 / 54 What does the command “ps” do in Linux? List system processes Print files Perform system updates Start a new shell session 49 / 54 In Linux, what does the “mkdir” command do? Move a file Remove a directory Create a new directory List directory contents 50 / 54 Which of the following is not a text editor commonly used in Linux? Nano Vim Gedit Photoshop 51 / 54 What is the purpose of the “passwd” command in Linux? Print user's password Change a user's password Create a new user Check disk usage 52 / 54 In Linux , what is the purpose of the “df” command? Display system date and time Display disk space usage Define functions in a shell script List installed software packages 53 / 54 Which command is used to display the currently logged-in users in a Linux system? who users log list-users 54 / 54 What is the primary purpose of the “grep” command in Linux? Compress files Search and filter text Create directories Execute shell scripts Your score isThe average score is 50% 0% Restart quiz