Tuesday, June 27, 2023

Linux Frequently asked interview questions as DevOps Point of View

 Linux Frequently asked interview questions as DevOps Point of View:

1. What is Linux?

Linux is an open-source operating system kernel that serves as the foundation for many different distributions, known as Linux distributions or simply Linux distros.


2. What are the flavours of Linux?

Ubuntu, 

CentOS,

Suse,

RedHat,

Debian.


3. What is the difference between UNIX and Linux?

UNIX is an older operating system that served as the inspiration for Linux. Linux is a Unix-like operating system that was developed independently but shares many similarities with UNIX.


4. What is the difference between a process and a thread in Linux?

A process is an instance of a program that is running on a system, while a thread is a lightweight process that shares the resources of a process.


5. What is the difference between a hard link and a soft link in Linux?

A hard link is a link to a file that points to the same inode as the original file, while a soft link (also known as a symbolic link) is a link to a file that points to the file's path.


6. What is a shell in Linux?

The shell is a command-line interpreter that allows users to interact with the operating system. It provides a way to execute commands and run programs.


7. What is a process in Linux?

A process is an instance of a running program. It represents the execution of a program in memory and includes information such as the program's code, data, and resources.


8. How can you check the memory usage of a Linux system?

The "free" command displays information about the system's memory usage, including total memory, used memory, free memory, and swap usage.


9. How do you find the IP address of a Linux system?

The "ifconfig" command displays network interface information, including IP addresses assigned to the system.


10. How do you find the list of running processes in Linux?

The "ps" command can be used to display a list of running processes. Adding options like "-ef" or "-aux" provides more detailed information.


11. How do you kill a process in Linux?

The "kill" command is used to terminate a process. It requires the process ID (PID) of the process to be killed. The PID can be obtained using the "ps" command.


12. What is the purpose of the "chmod" command in Linux?

The "chmod" command is used to change the permissions of files and directories in Linux. It can be used to grant or revoke read, write, and execute permissions.


13. How do you search for a file in Linux?

The "find" command allows you to search for files based on various criteria, such as name, size, or modification time. For example, "find / -name myfile.txt" searches for a file named "myfile.txt" starting from the root directory.


14. What is SSH?

SSH (Secure Shell) is a network protocol that provides a secure way to access and manage remote systems. It allows encrypted communication between a client and a server.


15. How do you connect to a remote Linux server using SSH?

You can connect to a remote Linux server using SSH by running the command "ssh username@hostname" in a terminal. Replace "username" with your username and "hostname" with the server's IP address or domain name.


16. What is the purpose of the "grep" command?

The "grep" command is used to search for specific patterns within files. It is commonly used for text searching and pattern matching.


17. How do you check the disk usage in Linux?

The "df" command displays information about disk space usage on file systems. Adding the "-h" option provides human-readable output.


18. How can you compress and decompress files in Linux?

The "gzip" command is used to compress files, creating a ".gz" file. To decompress a compressed file, you can use the "gunzip" command.


19. How do you check the disk space usage of a specific directory in Linux?

The "du" command is used to estimate the disk space usage of a directory and its subdirectories. Adding the "-h" option provides a more readable output.


20. How do you monitor system performance in Linux?

The "top" command is commonly used to monitor system performance in real-time. It displays information about CPU usage, memory usage, running processes, and more.


21. What is a package manager in Linux?

A package manager is a tool used to manage software packages in a Linux distribution. It handles package installation, updates, and removal. Examples of package managers are "apt" for Debian-based distributions and "yum" for Red Hat-based distributions.


22. How do you install software in Linux?

The method of installing software in Linux depends on the distribution. For Debian-based distributions like Ubuntu, you can use the "apt" or "apt-get" command. For Red Hat-based distributions like CentOS, you can use the "yum" or "dnf" command.


23. How do you add a user in Linux?

The "useradd" command is used to add a user in Linux. For example, "useradd username" creates a new user with the username specified.


24. How do you change the password for a user in Linux?

The "passwd" command is used to change the password for a user in Linux. Running "passwd username" prompts you to enter a new password for the specified user.


25. What is the purpose of the "cron" daemon in Linux?

The "cron" daemon is a time-based job scheduler in Linux. It allows users to schedule and automate the execution of commands or scripts at specified intervals or times.


26. How do you schedule a cron job in Linux?

To schedule a cron job, you can use the "crontab" command. Running "crontab -e" opens the user's crontab file, where you can specify the command or script to be executed and the schedule.


27. What is the difference between SSH and SSL?

SSH (Secure Shell) is a network protocol used for secure remote access and management of systems. SSL (Secure Sockets Layer) is a security protocol used to establish secure encrypted connections between clients and servers, commonly used for secure web communication (HTTPS).


28. How do you check the network connectivity in Linux?

The "ping" command is used to check network connectivity between your machine and a remote host. Running "ping hostname" sends ICMP echo requests to the specified hostname or IP address and displays the response time.


29. What is a firewall in Linux?

A firewall is a network security tool that filters incoming and outgoing network traffic based on predefined rules. It helps protect systems from unauthorized access and network-based attacks.


30. What is a RAID in Linux?

RAID (Redundant Array of Independent Disks) is a technology used to combine multiple physical disk drives into a single logical unit. It provides improved performance, data redundancy, or a combination of both, depending on the RAID level used.


31. How do you create a partition in Linux?

The "fdisk" command is commonly used to create partitions in Linux.

security header validate

  HTTP Security Headers Check Tool - Security Headers Response (serpworx.com)