Linux Interview Questions: Part 4

 Linux Interview Questions : PART 4




1.Commands used to install/list/remove modules from kernel

Answer: 

    
        Installing/adding a module:

                  insmod mod_name
                  modprobe mod_name

        List installed modules :  lsmod

        Removing a module      : modprobe -r mod_name



2.What vmstat shows ?

Answer :

 vmstat (virtual memory statistics) is a computer system monitoring tool that collects
 and displays summary information about operating system memory, processes, interrupts, paging and block I/O.



3. What is tmpfs File System


Answer:

 tmpfs is a common name for a temporary file storage facility on many Unix-like operating systems.
 It is intended to appear as a mounted file system, but stored in volatile memory instead of a persistent storage device.
 A similar construction is a RAM disk, which appears as a virtual disk drive and hosts a disk file system.

 Everything stored in tmpfs is temporary in the sense that no files will be created on the hard drive;
 however, swap space is used as backing store in case of low memory situations. On reboot, everything in tmpfs will be lost.
 The memory used by tmpfs grows and shrinks to accommodate the files it contains and can be swapped out to swap space.



4.How can we check disk/device status/failure/errors using smartctl utility?

Answer:  Try following commands to check:

        Enable/Disable SMART on device/disk : smartctl -s on /dev/sda
        Check device SMART health : smartctl -H /dev/sda
        Check device SMART capabilities : smartctl -c /dev/sda
        Enable/Disable automatic offline testing on device : smartctl -o on/off /dev/sda
        Show device SMART vendor-specific Attributes and values : smartctl -A /dev/sda
        Show device log [TYPE : error, selftest, selective, directory,background,
                                     scttemp[sts,hist]] : smartctl -l TYPE /dev/sda
        Run test on device [TEST: offline short long conveyance select,M-N pending,N
                                     afterselect,[on|off] scttempint,N[,p] : smartctl -t /dev/sda



 


5.Default Port numbers used by  ssh,ftp,http,https,telnet,smtp,pop3,pop3s,imap,imaps

Answer:  SSH 22
         ftp 20/21
         http 80
         https 443,
         SMTP/SMPTS 25/465
         POP3/POP3S 110/995
         IMAP/IMAPS 143/993

 

6.What is the command to check open ports at remote machine

Answer:  nmap


7.How to setup never expired user password

Answer: chage -E never username


 


8.How can we change speed and duplex settings for network card?

Ans We can do this with below given 2 methods:

ethtool -s eth0 speed 100 duplex full
ethtool -s eth0 speed 10 duplex half

OR

mii-tool -F 100baseTx-HD
mii-tool -F 10baseT-HD


 


9. Which file defines the attributes like UID, PASSWORD expiry, HOME Dir create or not while adding user ?

Answer: /etc/login.defs

 


10. What is the command  for changing authentication of linux system? (Like LDAP/NIS/SMB/KERBOS)

Answer: authconfig




Linux Interview Questions : PART 1 , PART2 , PART3 , PART4


0 comments:

Post a Comment

Blogger Tips and TricksLatest Tips And TricksBlogger Tricks