Linux Interview Questions and Answer

Linux Interview Questions and Answer

  1. List the Permission types in Linux Like Operating Systems?

    In Linux Operating system 3 Major types of Permissions are available, these are Read, Write and Execute.

  2. List the User types in Linux Like Operating Systems?

    In Linux Operating system 3 Major types of Users are available, these are Owner, Group Owner and Others.

  3. What are 2 Types of Mount in linux?

    Temporary Mount and Permanent Mount
    Temporary Mount for removable devices such as pendrive, cd/dvd or any other.
    permanent Mounting like hard drive, lun storage etc, it will remain connected on Linux system every boot or restart.

  4. What is SWAP in Linux?

    Linux uses swap space to increase the amount of virtual memory available to a host. It can use one or more dedicated swap partitions or a swap file on a regular filesystem or logical volume.

  5. What are the Commands to use to save and exit from vi editor in Linux?

    The following commands are used to exit from vi editors. 1. :wq saves the current work and exits the VI. 2. :q! exits the VI without saving current work.

  6. How can I check which processes are running in my Linux machine?

    To check process which are running in machine, use two commands.
    TOP and PS command.

  7. What is the difference between creating a file in cat and in touch command on Linux?

    $cat command creates a file and we can save some data inside the file but touch command by default will create a blank file.

  8. How can I check if a server is up and running or not ?

    You can use ping –t command to check.
    $ping –t or .

  9. How can I list the directories and the files ?

    Using ls command.
    I can view the directories and files of the system.

  10. How can I append some lines in an existing file in linux ?

    $cat >> file name and hit enter.
    You can append lines below the existing lines of the file.

  11. How to check disk utilization of a linux server?

    Use du command to check the disk utilization.
    $du.in advance you want to see a specify partition with all the information use $df -hT to know clear details about connected hard disk information with available space as well used space..

  12. How to check the disk free of all the mount points in linux / Unix ?

    use df –h command,
    it will show the disk free of linux machine.

  13. Name some Linux Distros ?

    There are various Linux distros but the following are the most commonly used:

    • Ubuntu

    • Debian

    • CentOS

    • Fedora

    • RedHat

  14. What is the chmod command in Linux, and how do you use it?

    You can use the chmod command to change the file permissions of the directories. It offers a simple way to control the read and write permissions. For instance, if you want to change the permission of the ABC.sh script and give it the write and executable permission, you can run the below command:

    chmod u+wx ABC.sh
    
  15. What is the grep command used for in Linux?

    he grep command is used to search for specific patterns within files or input streams. It allows us to find and print lines that we give to match the pattern.

    For example: If we want to search test in a text file name “file.txt”. We use the following command

    grep "test" file.txt
    

    This command will search for the word test in the file named “file.txt” and print the matching lines.