Wednesday, August 3, 2016

Linux Interview Question - Part 1

1. what is backup utility?

Backup software are computer programs used to perform backup; they create supplementary exact copies of files, databases or entire computers. These programs may later use the supplementary copies to restore the original contents in the event of data loss.

2. How do I know if I'm working on a Virtual Machine or not?

On Windows, from CMD:
Systeminfo | findstr /i model

Returns something like:
System Model: VMware Virtual Platform
[01]: Intel64 Family 6 Model 26 Stepping 5 GenuineInt

On Linux, run this:
$ dmesg |grep -i hypervisor
Hypervisor detected: KVM

3. what is boot loader?

Boot loader a program that loads an operating system when a computer is turned on.
"Linux's GRUB bootloader can be used to select which operating system you'd like to boot into"

For Linux, the two most common boot loaders are known as LILO (LInux LOader) and LOADLIN (LOAD LINux). An alternative boot loader, called GRUB (GRand Unified Bootloader), is used with Red Hat Linux. LILO is the most popular boot loader among computer users that employ Linux as the main, or only, operating system. The primary advantage of LILO is the fact that it allows for fast boot-up. LOADLIN is preferred by some users whose computers have multiple operating systems, and who spend relatively little time in Linux. LOADLIN is sometimes used as a backup boot loader for Linux in case LILO fails. GRUB is preferred by many users of Red Hat Linux, because it is the default boot loader for that distribution.

4. how to extend lvm?

To extend a logical volume you simply tell the lvextend command how much you want to increase the size. You can specify how much to grow the volume, or how large you want it to grow to:


5. what is mx record?

A mail exchanger record (MX record) is a type of resource record in the Domain Name System that specifies a mail server responsible for accepting email messages on behalf of a recipient's domain, and a preference value used to prioritize mail delivery if multiple mail servers are available

6. 
what command should you use to check the number of files and disk space used and each user's defined quotas?

repquota


7. how to extract tar file?

tar -xvf file.tar
tar -xzvf file.tar.gz
tar -xjvf file.tar.bz2


8. how to check newly attached disk?
fdisk -l

9. what is the port number of apache?

Port : 80

10. port number of https?

Port : 80

11. how to check number of disk available in linux system?

fdisk -l

12. what is ssh port number?

port : 22

13. Users are not able to login using ssh tell me the reasons.

1) port hardening
2) check user shell
3) ssh block
4) check user permission 
5) check user created or not

14. samba service installed on linux sytem with all permission still user is not able to login from windows machine what will be the reason?



15. what is dns service name linux and what is the configuration file?

BIND stands for Berkley Internet Naming Daemon. BIND is the most common program used for maintaining a name server on Linux

main configuration file for dns server is named.conf. By default this file is not created in /var/named/chroot/etc/ directory. Instead of named.conf a sample file /var/named/chroot/etc/named.caching-nameserver.conf is created. This file is use to make a caching only name server. You can also do editing in this file after changing its name to named.conf to configure master dns server or you can manually create a new named.conf file.

16. 
what is 'inode'?

All UNIX files have its description stored in a structure called 'inode'. The inode contains info about the file-size, its location, time of last access, time of last modification, permission and so on. Directories are also represented as files and have an associated inode.

17. 
what are the process states in UNIX?

As a process executes it changes state according to its circumstances. Unix processes have the following states:

Running: The process is either running or it is ready to run .
Waiting: The process is waiting for an event or for a resource.
Stopped: The process has been stopped, usually by receiving a signal.
Zombie: The processes are dead but have not been removed from the process table


18. How to unlock user?

[root@localhost ~]# passwd -u sharad 
Unlocking password for user sharad.
 passwd: Success 
[root@localhost ~]#

19. what command is used to remove the password assigned to a group?

gpasswd –r


20. what can you type at a command line to determine which shell you are using?

echo $SHELL


21. write a command to find all of the files which have been accessed within the last 30 days.

find / -type f -atime -30 > filename.txt


22. what is a zombie?

Zombie is a process state when the child dies before the parent process. In this case the structural information of the process is still in the process table.


23. what daemon is responsible for tracking events on your system?

The udev demon used to create and remove all these device nodes or files in /dev/ directory


24. what kind of files or nodes /dev/ directory contains and how do I access or see device files?

Block Device Files:-
Block device files talks to devices block by block [1 block at a time (1 block = 512 bytes to 32KB)].
Examples: - USB disk, CDROM, Hard Disk

# ls /dev/sd*
brw-rw----
1 root    
root      
8,
0 Mar 15  2009 sda
brw-rw----   
1 root    
root      
8,  
1 Mar 15  2009 sda1
brw-rw----   
1 root    
root      
8,  
2 Mar 15  2009 sda2
brw-rw----   
1 root    
root      
8,  
3 Mar 15  2009 sda3
brw-rw----   
1 root    
root      
8,  
4 Mar 15  2009 sda4
brw-rw----   
1 root    
root      
8,  
16 Mar 15  2009 sdb
Character Device Files:-
Character device files talk to devices character by character.
Examples: - Virtual terminals, terminals, serial modems, random numbers

#ls /dev/tty*
crw-rw----   
1 root    
root      
4,
64 Mar 15  2009 ttyS0
crw-rw----   
1 root    
root      
4,
65 Mar 15  2009 ttyS1
crw-rw----   
1 root    
root      
4,
66 Mar 15  2009 ttyS2
crw-rw----   
1 root    
root      
4,
67 Mar 15  2009 ttyS3


25. tell me the name of device file for PS/2 mouse connection.

/dev/psaux


26.tell me the name of device file for parallel port (Printers).

/dev/lp0

No comments:

Post a Comment