InterviewSolution
This section includes InterviewSolutions, each offering curated multiple-choice questions to sharpen your knowledge and support exam preparation. Choose a topic below to get started.
| 1. |
What Are Inodes In Linux ? How To Find The Inode Associated With A File ? |
|
Answer» An inode is a data structure on a filesystem on Linux and other Unix-like operating systems that stores all the INFORMATION about a file except its name and its actual data. When a file is created, it is assigned both a name and an inode number, which is an integer that is unique within the filesystem. Both the file names and their corresponding inode numbers are stored as entries in the directory that APPEARS to the user to contain the FILES. The concept of inodes is particularly important to the recovery of DAMAGED filesystems. When parts of the inode are lost, they appear in the lost+found directory within the partition in which they once existed. The following will show the name of each object in the current directory together with its inode number: # ls -i The avialble number inodes in a filesystem can be found using the below command : # DF -i The other way we can get the inode details of a file by using the stat commmand. Usage : # stat Example : -sh-4.1$ stat note.txt File: `note.txt' Size: 4 Blocks: 8 IO Block: 4096 regular file Device: fd05h/64773d Inode: 8655235 Links: 1 Access: (0644/-rw-r--r--) Uid: (69548/nixuser) Gid: (25000/ UNKNOWN) Access: 2014-06-29 15:27:56.299214865 +0000 Modify: 2014-06-29 15:28:28.027093254 +0000 Change: 2014-06-29 15:28:28.027093254 +0000 An inode is a data structure on a filesystem on Linux and other Unix-like operating systems that stores all the information about a file except its name and its actual data. When a file is created, it is assigned both a name and an inode number, which is an integer that is unique within the filesystem. Both the file names and their corresponding inode numbers are stored as entries in the directory that appears to the user to contain the files. The concept of inodes is particularly important to the recovery of damaged filesystems. When parts of the inode are lost, they appear in the lost+found directory within the partition in which they once existed. The following will show the name of each object in the current directory together with its inode number: # ls -i The avialble number inodes in a filesystem can be found using the below command : # df -i The other way we can get the inode details of a file by using the stat commmand. Usage : # stat Example : -sh-4.1$ stat note.txt File: `note.txt' Size: 4 Blocks: 8 IO Block: 4096 regular file Device: fd05h/64773d Inode: 8655235 Links: 1 Access: (0644/-rw-r--r--) Uid: (69548/nixuser) Gid: (25000/ UNKNOWN) Access: 2014-06-29 15:27:56.299214865 +0000 Modify: 2014-06-29 15:28:28.027093254 +0000 Change: 2014-06-29 15:28:28.027093254 +0000 |
|
| 2. |
What Is Crontab And Explain The Fields In A Crontab ? |
|
Answer» The cron is a deamon that EXECUTES commands at specific dates and TIMES in linux. You can use this to schedule activities, either as one-time events or as recurring tasks. Crontab is the program used to install, deinstall or list the tables used to drive the cron daemon in a server. Each user can have their own crontab, and though these are files in /var/spool/cron/crontabs, they are not intended to be edited directly. Here are few of the command line options for crontab. crontab -e Edit your crontab file. Traditional cron format consists of six fields separated by white spaces: The format is explained in detail below. * * * * * * | | | | | | | | | | | +– Year (range: 1900-3000) | | | | +—- Day of the Week (range: 1-7, 1 standing for MONDAY) | | | +—— MONTH of the Year (range: 1-12) | | +——– Day of the Month (range: 1-31) | +———- Hour (range: 0-23) +———— MINUTE (range: 0-59) The cron is a deamon that executes commands at specific dates and times in linux. You can use this to schedule activities, either as one-time events or as recurring tasks. Crontab is the program used to install, deinstall or list the tables used to drive the cron daemon in a server. Each user can have their own crontab, and though these are files in /var/spool/cron/crontabs, they are not intended to be edited directly. Here are few of the command line options for crontab. crontab -e Edit your crontab file. Traditional cron format consists of six fields separated by white spaces: The format is explained in detail below. * * * * * * | | | | | | | | | | | +– Year (range: 1900-3000) | | | | +—- Day of the Week (range: 1-7, 1 standing for Monday) | | | +—— Month of the Year (range: 1-12) | | +——– Day of the Month (range: 1-31) | +———- Hour (range: 0-23) +———— Minute (range: 0-59) |
|
| 3. |
What Is Selinux? |
|
Answer» SELinux is an acronym for SECURITY-enhanced Linux. It is an access CONTROL implementation and security feature for the Linux KERNEL. It is designed to protect the server against misconfigurations and/or compromised daemons. It put LIMITS and instructs server daemons or programs what files they can access and what ACTIONS they can take by defining a security policy. SELinux is an acronym for Security-enhanced Linux. It is an access control implementation and security feature for the Linux kernel. It is designed to protect the server against misconfigurations and/or compromised daemons. It put limits and instructs server daemons or programs what files they can access and what actions they can take by defining a security policy. |
|
| 4. |
What Is The Functionality Of A Puppet Server? |
|
Answer» Puppet is an open-source and enterprise application for configuration management toll in UNIX like operating system. Puppet is an IT automation software used to push configuration to its CLIENTS (puppet agents) using code. Puppet code can do a variety of tasks from INSTALLING NEW software, to check FILE permissions, or UPDATING user accounts and lots of other tasks. Puppet is an open-source and enterprise application for configuration management toll in UNIX like operating system. Puppet is an IT automation software used to push configuration to its clients (puppet agents) using code. Puppet code can do a variety of tasks from installing new software, to check file permissions, or updating user accounts and lots of other tasks. |
|
| 5. |
What Are The Run Levels In Linux And How To Change Them? |
|
Answer» A run level is a state of init and the whole SYSTEM that defines what system services are operating and they are identified by numbers.There are 7 different run levels PRESENT (run level 0-6) in Linux system for different purpose. The descriptions are given below. 0: HALT System (To shutdown the system) To change the run level, edit the file “/etc/inittab” and change initdefault entry ( id:5:initdefault:). If we WANT to change the run level on the fly, it can be done using ‘init’ command. For example: when we type ‘init 3′ in the commandline , this will move the system from current runlevel to runlevl 3. Current level can be listed by typing the command ‘who -r’. A run level is a state of init and the whole system that defines what system services are operating and they are identified by numbers.There are 7 different run levels present (run level 0-6) in Linux system for different purpose. The descriptions are given below. 0: Halt System (To shutdown the system) To change the run level, edit the file “/etc/inittab” and change initdefault entry ( id:5:initdefault:). If we want to change the run level on the fly, it can be done using ‘init’ command. For example: when we type ‘init 3′ in the commandline , this will move the system from current runlevel to runlevl 3. Current level can be listed by typing the command ‘who -r’. |
|
| 6. |
What Is The Difference Between Umask And Ulimit ? |
|
Answer» umask stands for ‘User file creation mask’, which determines the settings of a mask that controls which file permissions are set for FILES and directories when they are created. While ulimit is a linux built in COMMAND which provides control over the RESOURCES available to the shell and/or to processes started by it. You can limit user to SPECIFIC range by EDITING /etc/security/limits.conf at the same time system wide settings can be updated in /etc/sysctl.conf umask stands for ‘User file creation mask’, which determines the settings of a mask that controls which file permissions are set for files and directories when they are created. While ulimit is a linux built in command which provides control over the resources available to the shell and/or to processes started by it. You can limit user to specific range by editing /etc/security/limits.conf at the same time system wide settings can be updated in /etc/sysctl.conf |
|
| 7. |
What Is Name Of First Process In Linux? |
|
Answer» ‘init’ is the first PROCESS in LINUX which is started by KERNEL and whose PID is 1. ‘init’ is the first process in linux which is started by kernel and whose pid is 1. |
|
| 8. |
How To Change The Password Of User From The Command Line? |
|
Answer» ‘passwd <User-Name>’ |
|
| 9. |
What Is The Default Uid & Gid Of Root User? |
|
Answer» Default UID & gid of root user is 0. Default uid & gid of root user is 0. |
|
| 10. |
How To Check All The Installed Kernel Modules? |
|
Answer» USING the COMMAND ‘lsmod’ we can see the installed KERNEL modules. Using the Command ‘lsmod’ we can see the installed kernel modules. |
|
| 11. |
Why Linux Is Called Opensource? |
|
Answer» Because ONE can CUSTOMIZE the EXISTING CODE and can REDISTRIBUTE it. Because One can customize the existing code and can redistribute it. |
|
| 12. |
What Is Run Level 2? |
|
Answer» RUN level 2 is the multi-user MODE WITHOUT networking. Run level 2 is the multi-user mode without networking. |
|
| 13. |
How To Create A Blank File In Linux From Command Line ? |
|
Answer» USING the COMMAND ‘TOUCH <file-name>’ Using the command ‘touch <file-name>’ |
|
| 14. |
What Is Soft Link? |
|
Answer» SOFT LINK is a method to CREATE short CUTS in linux. It is similar to windows short cut feature. Soft link is a method to create short cuts in linux. It is similar to windows short cut feature. |
|
| 15. |
How To List Hidden Files From The Command Line? |
|
Answer» ‘ls -a’ <Folder_Name> |
|
| 16. |
What Is Bootloader? |
|
Answer» Bootloader is a program that boots the OPERATING SYSTEM and decides from which KERNEL OS will boot. Bootloader is a program that boots the operating system and decides from which kernel OS will boot. |
|
| 17. |
What Is Initrd ? |
|
Answer» INITRD stands for initial ram disk , which CONTAINS the TEMPORARY root filesystem and neccessary modules which helps in MOUNTING the real root filesystem in read MODE only. Initrd stands for initial ram disk , which contains the temporary root filesystem and neccessary modules which helps in mounting the real root filesystem in read mode only. |
|
| 18. |
How To Check The Current Runlevel Of A Linux Box? |
|
Answer» ‘who -r’ and ‘runlevel’ , both of these COMMAND are USED to find CURRENT run LEVEL. ‘who -r’ and ‘runlevel’ , both of these command are used to find current run level. |
|
| 20. |
How To Check The Default Gatway? |
|
Answer» Using ‘route -n’ COMMAND we can determine the default GATEWAY in LINUX. Using ‘route -n’ command we can determine the default gateway in linux. |
|
| 21. |
How To Determine The Hostname Of A Linux Box? |
|
Answer» On typing the hostname COMMAND on TERMINAL we can DETERMINE the hostname of a LINUX server. On typing the hostname command on terminal we can determine the hostname of a linux server. |
|
| 22. |
How To Check The Ip Address Of Lan Card? |
|
Answer» Using ‘ifconfig’ & ‘ip ADDRESS’ COMMAND we can DETERMINE the ip address of LAN CARD. Using ‘ifconfig’ & ‘ip address’ command we can determine the ip address of LAN Card. |
|
| 23. |
How To Install Rpm Packages In Redhat & Centos Linux ? |
|
Answer» rpm and yum COMMAND are USED to INSTALL PACKAGES in redhat linux and CentOS. rpm and yum command are used to install packages in redhat linux and CentOS. |
|
| 24. |
How To Check Which Redhat Version Is Installed On Server? |
|
Answer» USE the command cat /etc/REDHAT-release , OUTPUT of this command will tell you the redhat version. Use the command cat /etc/redhat-release , output of this command will tell you the redhat version. |
|
| 25. |
How To Check The Uptime Of A Linux Server? |
|
Answer» USING uptime COMMAND we can DETERMINE how long a linux box has been running , ALSO uptime can be viewed by the top & w command. Using uptime command we can determine how long a linux box has been running , also uptime can be viewed by the top & w command. |
|