Showing posts with label Linux System Admin Interview Questions. Show all posts
Showing posts with label Linux System Admin Interview Questions. Show all posts

Thursday, September 20, 2012

How to view system log messages in unix?

Q. where are the log files are  located under redhat or  Debian or Cento OS Linux server? How do I open or view log files? 

 Almost all log files are located under /var/log directory (and subdirectory). You can change to this directory using cd command. You can use less, more, cat or tail command to see the logs.  To Go to /var/logs directory:

# cd  /var/log/

# ls

To View common log file /var/log/messages using any one of the following command: 


# tail -f /var/log/messages, used in real time, it will show last 10 logs

# less /var/log/messages


# more /var/log/messages, we can see page page, press Tab to toggle between pages.


# vi /var/log/messages , to see in vi editor



# cat /var/log/messages


 Q. what is the use of log messages?

  • logs are used to see the status of your system. which provides the error messages and services return messages
  • with the help of logs we can trouble shoot the system erors
Linux Log files and usage

/var/log/dmesg  --> used for kernel boot messages

/var/log/messages  --> stores the standard system error messages

/var/log/maillog  --> mail system messages


/var/log/secure -->  security , authentication messages

/var/log/audit/audit.log -->  kernel auditing messages

var/log/debug -->Debugging log messages


 /var/log/faillog --> User failed login log file
/var/log/kern.log --> Kernel log file
 /var/log/lpr.log -->Printer log file
 /var/log/mail.* : All mail server message log files
 /var/log/mysql.* : MySQL server log file
 /var/log/user.log : All userlevel logs
 /var/log/xorg.0.log : X.org log file
/var/log/apache2/* : Apache web server log files directory
 /var/log/lighttpd/* : Lighttpd web server log files directory
/var/log/fsck/* : fsck command log
/var/log/apport.log : Application crash report 



Wednesday, April 11, 2012

Linux System Admin Interview Questions & Answers part 2

1. Which of the following below are true functionalities of Kernel?
answer: Allocates time and memory to programs

2. Which of the following below are true functionalities of shell?
Answer: Authenticates user Interprets commands

3. Which command is used to find what is in your home directory?
Correct answer: % ls

4. cd home to get back to your home-directory?
answer: False

5. Which command is used to clear the screen?
Correct Answer: Clear

6. The head command writes the first _____________ lines of a file to the screen.
answer: ten

7. What is used to search files for specified words or patterns?
answer: grep

8. > symbol is used to redirect the output of a command
answer: True

9. Pipe symbol is represented by
answer: |

10. Which character is used to match exactly one character?
answer: ?

11. Which command is used to see the online manual?
answer: man

12. A process is identified by a unique
answer: pid

13. A process can run only in the background
Answer: True

14. Which command reduces the size of a file?
answer: gzip

15. Find command can search for?
nswer: Files


16. How can we find the current value for shell variables?
answer: Set command

17. What is the difference between PATH and path?
answer: PATH and path specify directories to search for commands and programs

Both variables always represent the same directory list
Altering either automatically causes the other to be changed

18. What is the default number of shell commands saved in the history list of .cshrc file?
Correct answer: 200

19. What is the difference between linux file system and windows file system?
answer: Under Windows, the various partitions are detected at boot and assigned a drive letter whereas Under Linux, unless you mount a partition or a device, the system does not know of the existence of that partition or device.

20. What is the content of /etc directory?
answer: it contains all configuration file

21. /temp is a type of filesystem directory
answer: False

22. The basic function of ______________ is to search files for lines (or other units of text) that contain a
answer: awk

23. Which of the following below is/are true for Date command?
answer: It can work w/o arguments

Linux System Admin Interview Questions & Answers part 1


1. Every command in Linux is a

1. Text file
2. Stored variable
3. Executable program
4. None

 Answer: executable program

2. How long can a filename in Linux be?
Correct answer: 255 characters

3. What is the shortcut key to go to home directory?

1. shift + cd
2. cd + enter key
3. alt + ctrl + cd
4. ctrl + cd

Correct answer: cd

4. The hierarchy of a series of directories branching in a user home directory starts from?

Correct answer: /home

5. Saving open files, flush the system cache and other necessary system maintenance are allowed by.

1. Restarting the system
2. Rebooting the system
3. Logging off the system
4. Shutting down the system

Correct answer: logging off the system

6. Which directory contains configuration files that stores system and application setting?
1      /etc
2      /lib
3      /usr
4      /var

Correct answer: /etc

7. Which command is used to find data files, programs, directories that match the search argument?
Correct answer: locate

8. Applications written to provide a GUI shell for UNIX and Linux are called
Correct answer: x window

9. The advantage of using SAMBA rather than NFS for file sharing in Linux is?
Correct answer: compatibility with Windows file sharing

10. Which framework is provided for the programs to interchange information about Linux OS?

1. Resource Sharing Framework
2. Resource Security Framework
3. Information Sharing Framework
4. Resource Definition Framework

Correct answer: Resource Definition Framework

11. To implement new application on IBM z/10. Which of the following options need to be considered if it to be implemented in Linux?
Correct answer: Red Hat Linux does not support all the devices supported by IBM z/OS

12. Which of the following has greater market share of Linux SW/HW environment?
1. Linux on z10
2. Linux HP integrity servers
3. Linux on AS/400 servers locate
4. Linux on DELL Xeon

Correct answer: Linux HP integrity servers

13. Which of the following commands can be run to remove all the rules in an iptables table?
1. iptables -L
2. iptables -A
3. iptables -F
4. iptables –delete

Correct answer: iptables -F (F=Flush)

14. Which of the following is the BEST way to set up SSH(Secure Shell) for communicating between Systems without needing passwords?
1. Use ssh-keygen for generating public-private keys.
2. Disable passwords on specific accounts that will use SSH.
3. Both A and B
4. None of the above

Correct answer: Use ssh-keygen for generating public-private keys.

15. How much usable space is available, when a Linux system is configured with a RAID 5 array that consists of six 20 GB hard disk drives?
Correct answer: 100 GB

Formula: S*(N-1)
            here S=size
            N=number of HDD.  remember it is only for RAID5

16. Which of the following commands can be used to check for file corruption?

1. md5sum
2. checkfile
3. cat -vet
4. tar –checksum

Correct answer: md5sum

17. Which of the following allows to secure remote command line access?
Correct answer: SSH(Secure Shell)

18. Which of the following supports for creating a Linux VPN (Virtual Private Network)?
1. RC2
2.3DES
3. chap
4. NTLMv2

Correct answer: 3DES

19. Which of the following commands delete the files from the /tmp directory, issued by non-root user?
1.mdir -rf /tmp/*
2.rm -rf /tmp/* -su
3.su -c "rm -rf /tmp/*"
4.su "rm -rf /tmp/*"

Correct answer: su -c "rm -rf /tmp/*"

20. Which configuration does cardmgr read at Linux system startup?

1      PCMCIA     cards
2      PCI   cards
3      USB  cards
4      SCSI cards

Correct answer: PCMCIA cards

21. When a computer system is reported problems with inodes and blocks, which of the following are the problem and its solution to rectify it?

1. The file system has become corrupt and needs to be repaired.
2. The boot sector is corrupt and needs to be repaired.
3. The drive is configured using an improper file system and needs to be reformatted.
4. The partition table has become corrupt and needs to be replaced.

Correct answer: The file system has become corrupt and needs to be repaired. Use fsck command

22. Which Linux command will successfully mounts a USB drive?

1. mount /dev/uda1 /mnt/usb
2. mount /dev/sda1 /mnt/usb
3. mount -t usbfs /dev/usb001 /mnt/usb
4. mount /dev/hde1 /mnt/usb

Correct answer: mount /dev/sda1 /mnt/usb

23. ___________ is a common tool for determining services and ports running on a remote Linux.
1. arp
2. nmap
3. netstat
4. None of the above

Correct answer: nmap

24. For supporting new diskless client workstations, which of the following services needs to be installed on a server?

1      dhcpcd      and   rexec               
2      named       and   httpd                
3      remoted     and   dhcpd                       
4      PXE   (Preboot    eXecution   Environment)      and   tftpd

Correct answer: PXE (Preboot eXecution Environment) and tftpd


25. Which of the following Linux commands could be used to find what processor was detected on boot, when a laptop system is slow/
Correct answer: POST

26 . How to accomplish the LILO boot configuration updation for supporting a newly installed IDE hard drive?
Correct answer: Edit lilo.conf and run "lilo -v -v"