Linux Interview Questions and Answers for 10 years experience
-
What are the differences between hard links and symbolic links?
- Answer: Hard links share the same inode as the original file, meaning they point to the same data on the disk. Deleting one hard link doesn't affect others until all are deleted. Symbolic links are separate files containing a path to the original file. Deleting a symbolic link doesn't affect the original file, and symbolic links can point to directories. Hard links cannot span across file systems, while symbolic links can.
-
Explain the concept of process states in Linux.
- Answer: Linux processes transition through various states like Running (actively using CPU), Ready (waiting for CPU), Sleeping (waiting for an event), Stopped (paused by a signal), and Zombie (finished execution but resources not yet released). The scheduler manages these transitions to efficiently utilize system resources.
-
Describe different Linux file system types and their characteristics.
- Answer: Ext4: Journaling file system, widely used, good performance and reliability. XFS: High-performance journaling file system, good for large files and high I/O. Btrfs: Copy-on-write file system with features like snapshots and data integrity checks. Other types include FAT32, NTFS (Windows), and various network file systems like NFS and SMB.
-
How do you manage users and groups in Linux?
- Answer: Using commands like `useradd`, `groupadd`, `usermod`, `groupmod`, `userdel`, `groupdel`. `passwd` is used to change passwords. `/etc/passwd` and `/etc/group` are crucial configuration files. `sudo` allows authorized users elevated privileges.
-
What are the different ways to monitor system performance in Linux?
- Answer: Tools like `top`, `htop`, `ps`, `iostat`, `vmstat`, `mpstat`, `netstat`, `iftop` provide real-time information on CPU usage, memory, disk I/O, network activity, etc. `sar` collects system statistics over time. Graphical tools like GNOME System Monitor offer user-friendly interfaces.
-
Explain the role of the init system (systemd).
- Answer: Systemd is the init system responsible for starting and managing services and processes during boot and runtime. It offers features like dependency management, parallel service startup, and sophisticated process control through units (services, targets, etc.).
-
How do you troubleshoot network connectivity issues in Linux?
- Answer: Check network interfaces with `ifconfig` or `ip addr`. Ping the gateway and external servers. Use `traceroute` to identify network path issues. Examine routing tables with `route`. Inspect firewall rules with `iptables` or `firewalld`. Check DNS resolution with `nslookup` or `dig`.
-
What are shell scripting and its uses in Linux administration?
- Answer: Shell scripting involves writing scripts using Bash (or other shells) to automate tasks, manage systems, process data, and improve administrative efficiency. It allows for complex operations to be executed sequentially or conditionally.
-
Explain the concept of kernel modules.
- Answer: Kernel modules are dynamically loadable pieces of code that extend the Linux kernel's functionality without requiring a kernel recompilation. They add support for hardware devices or new features. Commands like `modprobe` and `lsmod` are used for managing modules.
-
How do you manage storage space using LVM?
- Answer: LVM (Logical Volume Management) allows flexible partitioning and management of storage. It uses physical volumes (PVs), volume groups (VGs), and logical volumes (LVs). Commands like `pvcreate`, `vgcreate`, `lvcreate`, `lvextend`, `lvreduce`, `vgreduce`, `vgextend` are used to manage these components.
-
[Question 11]
- Answer: [Answer 11]
-
[Question 12]
- Answer: [Answer 12]
Thank you for reading our blog post on 'Linux Interview Questions and Answers for 10 years experience'.We hope you found it informative and useful.Stay tuned for more insightful content!