This article provides Linux technical interview questions with answers.
Due to power fluctuation, your system starts up from a powered off state. You receive a warning error stating that the machine was not shut down properly, and fsck will be run. What is the cause of this message?
If your hard drive file systems are not unmounted properly, the fsck utility will automatically run the next time the system is started to fix any inconsistencies before they are mounted again. If they are not fixed, the file system can quickly become corrupt.
A junior system administrator is trying to read through a large log file using the cat command. Because it is so large, the cat command scrolls the file right to the end without allowing the start of the file to be read. What command can he be used to more easily read the file?
He can use less command instead of using cat command, which allows him to scroll through the file.
When you try to boot a Linux system, you receive a message stating that it canot mount the /home partition because of errors. While debugging , you found that it occur due to data error. What can you do to fix the problem?
You can use fsck utility that enable you to recover from the errors.
During the bootup of a Linux system, there is no output on the monitor, the machine beeps, and then halts the boot-up process. What is the most likely cause of the problem?
If the system would not even get to the POST stage, the problem is most likely with the motherboard itself. You should count and compare the number of beeps to the BIOS manual in order to determine which specific component failed.
Which utility could you use to repair the corrupted file system?
You can use fsck to repair the corrupted file system.
What must you do before performing fsck on a file system?
The fsck utility can only run on a file system that is unmounted. If it were active, fsck would not be able to properly repair the drive, and may cause further corruption.
A Linux administrator wants to review the messages that scrolled up the screen during a system boot. How can this be accomplished?
The boot kernel messages are saved to the log file /var/log/dmesg. He can check this file.
A user complains you that his system was running fine, before he rebooted. When it starts up, no display appears on the screen and the system is beeping. What may this indicate?
Because the system was running fine before reboot and during the it got problem even before the operating system is loaded, the problem is hardware-based, and is most likely caused by a problem with the system board.
A user has sent an e-mail, but within minutes the e-mail is returned stating that the address could not be found. What is the most likely cause of the error?
If the e-mail was returned, all mail services are working properly, but the destination e-mail address was wrong.
Your system crashed and being restarted, but a message appears, indicating that the operating system cannot be found. What is the most likely cause of the problem ?
This kind of problem most likely to be associated with hard disk. There might be some issue with either MBR or hard disk.
A user can not access a remote server. Which command he can use to verify that remote server is up?
He can use ping command to check whatever remote server is up or not.
A newbie administrator is having tough time to locate the httpd.conf file. What command line tool he can use to find file?
He should first try with locate command. find command would be his next tool.
A user has decided to come into work overnight to get some work done. Unfortunately, he is not able to login, even though he is using his proper name and password. What is the most likely cause of the problem?
In high security environments some organizations choose to implement time restrictions on accounts, so user would not be able to login after office time.
A Linux administrator is noticing odd system behavior. Which log file should he check to find general system log messages?
The general log stored in /var/log/messages file.
Instead of properly shutting down a Linux system, an user mistakenly just turned the machine off with the on/off switch. What will happen when the system restarts?
When the system shuts down abnormally and the file systems are not properly mounted, the fsck utility will automatically check the disks for errors and inconsistencies in order to repair them.
A newbie system admin is having trouble with the options for a particular command. What is the best resource to use for information on the command?
He can use man command to get detail of the options. A quick way to get help about options is to use --help option. Most Linux command support this option and return with brief information on how to use that command.
You are tasked to examine a log file in order to find out why a particular application keep crashing. Log file is very lengthy, which command can you use to simplify the log search using a search string ?
You can use grep command to output the log file. You can specify the keyword of desired application to look for, grep command than displays all instances of that word in log file.
A user is trying to check his mail by using the pop3 protocol and port 143. But mail program could not connect to the mail server to retrieve mail. What is the most likely cause of the problem?
User is using wrong port number. Port number 143 is used for imap, he should use port 110 instead of 143.
A developer is constantly making changes in his applications source file, then running application to see if is throwing any error. Which command can he use to see the log file in real time, instead of reopening the log file each time?
He can use tail command with -f options to see a file being updated in real time. He do not need to reopen the file to see any changes.
An administrator has made changes to a daemon's configuration file. When he checks the process, it is still running with old behavior. What is the reason behind it?
He need to restart the service to process can read and implement the new configuration.
An application process has just failed on a Linux system. What should you examine first to find out the root of the problem?
When an application fails, the first thing that you should do to help troubleshoot the problem is to examine the application logs for the particular error that caused the application to fail.
During a software package installation, an error occurs warning that a certain library is missing, and the installation aborts. What is the most likely cause of the problem?
Many software packages are dependent on other programs to function properly. If these dependencies do not exist, you must install them before installing your software package.
What command should be used to show the first 10 lines of a file?
The command to show the first 10 lines of a file is head -100 filename.
What command can an administrator use to see the status of a print queue?
The lpq command can be used to see the status of a print queue.