1. What is Linux?
Linux is an open-source, Unix-like operating system kernel that powers various distributions like Ubuntu and CentOS. It supports multitasking, multi-user environments, and is widely used in servers, desktops, and embedded systems due to its flexibility and stability.
2. What is a Linux distribution?
A Linux distribution is a complete operating system built around the Linux kernel, including utilities, libraries, and desktop environments. Examples like Debian, Fedora, and Arch Linux cater to different use cases, from servers to desktops.
3. What is the difference between Linux and Unix?
Linux is an open-source Unix-like system, freely modifiable, while Unix is a proprietary system with stricter standards (POSIX). Linux is more flexible, runs on diverse hardware, and has a larger community, whereas Unix is common in enterprise systems like Solaris.
4. What is the Linux kernel?
The Linux kernel is the core of the operating system, managing hardware, processes, and memory. It acts as an interface between applications and hardware, enabling features like multitasking and device drivers.
5. What is a shell in Linux?
A shell is a command-line interface that interprets user commands for the Linux kernel, like Bash or Zsh. It allows scripting, command execution, and system interaction, serving as a bridge between users and the OS.
6. What is Bash in Linux?
Bash (Bourne Again Shell) is the default shell in many Linux distributions, enabling command execution and scripting. It supports features like piping, redirection, and variables, making it powerful for automation and system tasks.
7. What is the difference between a terminal and a shell?
A terminal is a graphical or text-based interface for user input/output, while a shell is the program (e.g., Bash) that processes commands. The terminal hosts the shell, which interprets and executes user commands.
8. What is the `ls` command in Linux?
The `ls` command lists directory contents, like files and folders, in the current directory. Options like `ls -l` provide detailed output (permissions, size), and `ls -a` shows hidden files.
9. What is the `cd` command in Linux?
The `cd` command changes the current working directory, e.g., `cd /home/user` navigates to the user’s home. It supports relative (`cd docs`) and absolute (`cd /var/log`) paths for navigation.
10. What is the `pwd` command in Linux?
The `pwd` (print working directory) command displays the full path of the current directory, e.g., `/home/user`. It’s useful for navigation and scripting to confirm the working location.
11. What is the `mkdir` command in Linux?
The `mkdir` command creates directories, e.g., `mkdir myfolder` creates a folder named `myfolder`. The `-p` option (`mkdir -p dir/subdir`) creates parent directories as needed without errors.
12. What is the `rm` command in Linux?
The `rm` command removes files or directories, e.g., `rm file.txt` deletes a file. Use `rm -r` for recursive directory deletion and `rm -f` to force removal without prompts.
13. What is the `cp` command in Linux?
The `cp` command copies files or directories, e.g., `cp file.txt /backup/`. The `-r` option (`cp -r dir /backup`) copies directories recursively, preserving structure.
14. What is the `mv` command in Linux?
The `mv` command moves or renames files/directories, e.g., `mv file.txt /newpath/` moves a file, or `mv oldname.txt newname.txt` renames it. It’s atomic, ensuring no data loss during moves.
15. What is the `touch` command in Linux?
The `touch` command creates empty files or updates file timestamps, e.g., `touch newfile.txt`. It’s useful for creating placeholder files or refreshing modification times for scripts.
16. What is the `cat` command in Linux?
The `cat` command concatenates and displays file contents, e.g., `cat file.txt` shows the file’s text. It can combine files (`cat file1.txt file2.txt > output.txt`) or pipe output to other commands.
17. What is the `more` command in Linux?
The `more` command displays file contents page by page, e.g., `more largefile.txt`, allowing navigation with the spacebar. It’s useful for reading long files without overwhelming the terminal.
18. What is the `less` command in Linux?
The `less` command displays file contents interactively, e.g., `less logfile.txt`, with scrolling and search (`/pattern`). It’s more efficient than `more`, loading only what’s needed.
19. What is the `head` command in Linux?
The `head` command displays the first few lines of a file, e.g., `head file.txt` shows the top 10 lines. Use `head -n 5` to specify a custom number of lines.
20. What is the `tail` command in Linux?
The `tail` command shows the last few lines of a file, e.g., `tail logfile.txt` displays the last 10 lines. Use `tail -f` to monitor real-time updates, like log files.
21. What is the `grep` command in Linux?
The `grep` command searches for patterns in files, e.g., `grep \"error\" log.txt` finds lines with “error”. Options like `-i` (case-insensitive) or `-r` (recursive) enhance its flexibility.
22. What is the `find` command in Linux?
The `find` command searches for files/directories, e.g., `find / -name \"file.txt\"` locates files by name. It supports filters like `-type f` (files only) or `-mtime` (modified time).
23. What is the `locate` command in Linux?
The `locate` command quickly finds files using a database, e.g., `locate file.txt`. It’s faster than `find` but relies on an updated database via `updatedb`.
24. What is the `which` command in Linux?
The `which` command shows the full path of an executable, e.g., `which python3` might output `/usr/bin/python3`. It’s useful for identifying command locations in the PATH.
25. What is the `whereis` command in Linux?
The `whereis` command locates binaries, source code, and manuals, e.g., `whereis ls` shows paths for `ls` executable and man pages. It’s broader than `which`, covering related files.
26. What is the `man` command in Linux?
The `man` command displays manual pages for commands, e.g., `man ls` shows `ls` documentation. It’s a key resource for learning command options and usage.
27. What is the `whoami` command in Linux?
The `whoami` command prints the current user’s username, e.g., `whoami` might output `user1`. It’s useful in scripts or to verify the effective user in a session.
28. What is the `id` command in Linux?
The `id` command displays user and group information, e.g., `id` shows UID, GID, and groups for the current user. Use `id username` to query a specific user.
29. What is the `uname` command in Linux?
The `uname` command provides system information, e.g., `uname -a` shows kernel version, hostname, and architecture. It’s useful for system diagnostics or compatibility checks.
30. What is the `uptime` command in Linux?
The `uptime` command shows system runtime, current time, and load averages, e.g., `uptime` might output `2 days, 3 users, load average: 0.5`. It’s used to gauge system performance.
31. What is the `free` command in Linux?
The `free` command displays memory usage, e.g., `free -h` shows total, used, and free RAM in human-readable format. It helps monitor system memory and swap usage.
32. What is the `df` command in Linux?
The `df` command reports disk space usage, e.g., `df -h` shows filesystem sizes in human-readable units. It’s used to check available space on mounted drives.
33. What is the `du` command in Linux?
The `du` command estimates file/directory disk usage, e.g., `du -sh /home` shows the total size of `/home`. Use `-h` for human-readable output and `--max-depth` for specific levels.
34. What is the `top` command in Linux?
The `top` command provides a real-time, interactive view of system processes, showing CPU, memory, and task details. Press `q` to quit or `k` to kill a process.
35. What is the `htop` command in Linux?
The `htop` command is an enhanced version of `top`, offering a colorful, user-friendly interface with mouse support. It displays processes, memory, and CPU usage, with easier navigation and filtering.
36. What is the `ps` command in Linux?
The `ps` command lists running processes, e.g., `ps aux` shows all processes with details like PID and CPU usage. It’s used for process monitoring and management.
37. What is the `kill` command in Linux?
The `kill` command terminates a process by PID, e.g., `kill 1234` sends SIGTERM to process 1234. Use `kill -9` for forceful termination (SIGKILL) when needed.
38. What is the `killall` command in Linux?
The `killall` command terminates all processes by name, e.g., `killall firefox` stops all Firefox instances. It’s convenient but risky, so use with caution to avoid unintended terminations.
39. What is the `nice` command in Linux?
The `nice` command sets the priority of a new process, e.g., `nice -n 10 myprogram` runs `myprogram` with lower priority. Values range from -20 (highest) to 19 (lowest).
40. What is the `renice` command in Linux?
The `renice` command changes the priority of a running process, e.g., `renice 10 -p 1234` adjusts process 1234’s priority. It’s used to manage CPU allocation dynamically.
41. What is a process in Linux?
A process is a running instance of a program, identified by a PID, with its own memory and resources. Linux manages processes via the kernel, supporting multitasking and inter-process communication.
42. What is a daemon in Linux?
A daemon is a background process that runs continuously, like `sshd` for SSH or `httpd` for web servers. Daemons typically end in ‘d’ and handle system services without user interaction.
43. What is the `jobs` command in Linux?
The `jobs` command lists background or suspended processes in the current shell, e.g., `jobs` shows job IDs and statuses. It’s used with `fg` or `bg` to manage them.
44. What is the `fg` command in Linux?
The `fg` command brings a background or suspended job to the foreground, e.g., `fg %1` resumes job 1. It’s used to interact with paused or background tasks.
45. What is the `bg` command in Linux?
The `bg` command resumes a suspended job in the background, e.g., `bg %1` continues job 1. It’s useful for multitasking in the shell without blocking the terminal.
46. What is the `nohup` command in Linux?
The `nohup` command runs a process immune to hangups, e.g., `nohup myprogram &` keeps it running after logout. Output is redirected to `nohup.out` by default.
47. What is the `&` operator in Linux?
The `&` operator runs a command in the background, e.g., `myprogram &` frees the terminal for other tasks. It’s combined with `nohup` for persistent background processes.
48. What is a pipe (`|`) in Linux?
A pipe (`|`) redirects the output of one command as input to another, e.g., `ls | grep txt` filters `ls` output for “txt”. It enables powerful command chaining.
49. What is redirection in Linux?
Redirection sends command output to a file or device, e.g., `ls > output.txt` writes `ls` output to a file. Use `>>` to append and `<` for input redirection.
50. What is the `tee` command in Linux?
The `tee` command reads from standard input and writes to both a file and stdout, e.g., `ls | tee output.txt`. It’s useful for logging while displaying output.
51. What is the `chmod` command in Linux?
The `chmod` command changes file permissions, e.g., `chmod 755 script.sh` sets read/write/execute for owner and read/execute for others. It uses numeric (octal) or symbolic modes (`u+x`).
52. What is the `chown` command in Linux?
The `chown` command changes file ownership, e.g., `chown user1 file.txt` assigns `file.txt` to `user1`. Use `-R` for recursive changes and `user:group` for group ownership.
53. What are Linux file permissions?
Linux file permissions define read (`r`), write (`w`), and execute (`x`) access for owner, group, and others, displayed as `rwxr-xr-x`. They’re set via `chmod` and viewed with `ls -l`.
54. What is the `umask` command in Linux?
The `umask` command sets default permissions for new files, e.g., `umask 022` ensures files are created with `644` (rw-r--r--). It subtracts permissions from the default `666` or `777`.
55. What is the `su` command in Linux?
The `su` command switches to another user, e.g., `su user1` logs in as `user1`. Use `su -` for a full login session with the target user’s environment.
56. What is the `sudo` command in Linux?
The `sudo` command runs commands as another user (usually root), e.g., `sudo apt update`. It requires user authorization via `/etc/sudoers` and enhances security by avoiding direct root logins.
57. What is the `/etc/sudoers` file in Linux?
The `/etc/sudoers` file defines `sudo` permissions, specifying which users or groups can run commands as others. It’s edited with `visudo` to ensure syntax safety and prevent lockouts.
58. What is the `useradd` command in Linux?
The `useradd` command creates a new user, e.g., `useradd -m user1` adds `user1` with a home directory. Use options like `-g` for group or `-s` for shell.
59. What is the `usermod` command in Linux?
The `usermod` command modifies user accounts, e.g., `usermod -aG sudo user1` adds `user1` to the sudo group. It adjusts properties like groups, shell, or home directory.
60. What is the `userdel` command in Linux?
The `userdel` command deletes a user, e.g., `userdel user1` removes `user1`. Use `-r` to delete the home directory and mail spool for complete cleanup.
61. What is the `passwd` command in Linux?
The `passwd` command changes a user’s password, e.g., `passwd user1` prompts for a new password. Root can use it to reset any user’s password.
62. What is the `/etc/passwd` file in Linux?
The `/etc/passwd` file stores user account information, like username, UID, home directory, and shell, in a colon-separated format. It’s readable by all but edited indirectly via `useradd` or `usermod`.
63. What is the `/etc/shadow` file in Linux?
The `/etc/shadow` file stores encrypted user passwords and account details, like expiration dates. It’s readable only by root for security, complementing `/etc/passwd`.
64. What is the `/etc/group` file in Linux?
The `/etc/group` file lists groups and their members, with fields for group name, GID, and users. It’s used for group-based permissions and managed via `groupadd` or `groupmod`.
65. What is the `groupadd` command in Linux?
The `groupadd` command creates a new group, e.g., `groupadd devteam`. Use `-g` to specify a GID, and it updates `/etc/group` for permission assignments.
66. What is the `groupmod` command in Linux?
The `groupmod` command modifies group properties, e.g., `groupmod -n newname oldname` renames a group. It can also change GID with `-g` for consistency.
67. What is the `groupdel` command in Linux?
The `groupdel` command deletes a group, e.g., `groupdel devteam`, removing it from `/etc/group`. It fails if the group is a user’s primary group to prevent orphaned accounts.
68. What is a GID in Linux?
A GID (Group ID) is a unique numeric identifier for a group in Linux, stored in `/etc/group`. It’s used for group-based permissions and access control in file systems.
69. What is a UID in Linux?
A UID (User ID) is a unique numeric identifier for a user, stored in `/etc/passwd`. It determines user permissions and ownership in Linux file systems and processes.
70. What is the `chgrp` command in Linux?
The `chgrp` command changes a file’s group ownership, e.g., `chgrp devteam file.txt`. Use `-R` for recursive changes to directories and their contents.
71. What is the `ln` command in Linux?
The `ln` command creates links between files, e.g., `ln -s source.txt link.txt` makes a symbolic link. Hard links (`ln source target`) share the same inode, while symbolic links point to paths.
72. What is the difference between a hard link and a symbolic link?
A hard link shares the same inode as the original file, updating synchronously, while a symbolic link is a pointer to the file’s path, breaking if the target moves. Hard links can’t cross filesystems; symbolic links can.
73. What is the `file` command in Linux?
The `file` command identifies a file’s type, e.g., `file image.png` might output “PNG image data”. It analyzes file headers, useful for checking formats or scripts.
74. What is the `wc` command in Linux?
The `wc` command counts lines, words, or characters, e.g., `wc -l file.txt` shows the line count. Options like `-w` (words) or `-c` (bytes) provide specific metrics.
75. What is the `cut` command in Linux?
The `cut` command extracts sections from files or input, e.g., `cut -d\':\' -f1 /etc/passwd` gets usernames. It’s used for parsing delimited data, like CSV or logs.
76. What is the `sort` command in Linux?
The `sort` command sorts lines in a file or input, e.g., `sort file.txt` sorts alphabetically. Use `-n` for numeric sorting or `-r` for reverse order.
77. What is the `uniq` command in Linux?
The `uniq` command removes duplicate consecutive lines, e.g., `sort file.txt | uniq` ensures unique lines. Use `-c` to count occurrences or `-i` for case-insensitive comparison.
78. What is the `tr` command in Linux?
The `tr` command translates or deletes characters, e.g., `echo \"HELLO\" | tr \'A-Z\' \'a-z\'` converts to lowercase. It’s used for text transformations, like replacing or squeezing characters.
79. What is the `awk` command in Linux?
The `awk` command processes text patterns, e.g., `awk \'{print $1}\' file.txt` prints the first column. It’s a powerful scripting language for data extraction and reporting.
80. What is the `sed` command in Linux?
The `sed` command performs stream editing, e.g., `sed \'s/old/new/\' file.txt` replaces “old” with “new”. It’s used for text substitutions, deletions, or transformations in files or pipes.
81. What is a shell script in Linux?
A shell script is a file containing commands executed by a shell, like Bash, e.g., `#!/bin/bash` starts a script. It automates tasks, combining commands, loops, and conditionals.
82. What is the shebang (`#!`) in Linux?
The shebang (`#!`) specifies the interpreter for a script, e.g., `#!/bin/bash` uses Bash. It’s placed at the script’s start, ensuring the correct shell runs the script.
83. What is a variable in a Linux shell?
A shell variable stores data, e.g., `MY_VAR
84. What is the `export` command in Linux?
The `export` command makes variables available to child processes, e.g., `export PATH
85. What is the `env` command in Linux?
The `env` command lists environment variables or runs a command with modified variables, e.g., `env VAR
86. What is the `PATH` variable in Linux?
The `PATH` variable lists directories searched for executables, e.g., `echo $PATH` shows `/usr/bin:/bin`. Modify it with `export PATH
87. What is the `alias` command in Linux?
The `alias` command creates shortcuts for commands, e.g., `alias ll
88. What is the `unalias` command in Linux?
The `unalias` command removes an alias, e.g., `unalias ll` deletes the `ll` alias. Use `unalias -a` to clear all aliases in the current session.
89. What is the `source` command in Linux?
The `source` command executes a script in the current shell, e.g., `source ~/.bashrc` reloads the Bash configuration. It’s equivalent to `.` and preserves the environment.
90. What is the `bash` command in Linux?
The `bash` command starts a new Bash shell or runs a script, e.g., `bash myscript.sh`. It’s used to invoke Bash explicitly or test scripts in a fresh environment.
91. What is the `sh` command in Linux?
The `sh` command invokes a POSIX-compliant shell, often a symlink to Bash, e.g., `sh script.sh`. It’s used for portable scripts but lacks Bash-specific features.
92. What is the `zsh` shell in Linux?
Zsh (Z Shell) is an advanced shell with features like enhanced tab completion and plugins, e.g., Oh My Zsh. It’s compatible with Bash but offers better customization and usability.
93. What is the `fish` shell in Linux?
Fish (Friendly Interactive Shell) is a user-friendly shell with autosuggestions and syntax highlighting. It’s not POSIX-compliant, so scripts may need adjustments, but it’s great for interactive use.
94. What is a cron job in Linux?
A cron job is a scheduled task managed by the `crond` daemon, defined in `crontab`, e.g., `0 0 * * * backup.sh` runs daily at midnight. It automates repetitive tasks like backups.
95. What is the `crontab` command in Linux?
The `crontab` command manages cron jobs, e.g., `crontab -e` edits the user’s crontab file. Use `crontab -l` to list scheduled tasks and `crontab -r` to remove them.
96. What is the format of a crontab entry?
A crontab entry has six fields: minute, hour, day of month, month, day of week, and command, e.g., `0 2 * * * /script.sh` runs at 2 AM daily. Asterisks (`*`) mean “every”.
97. What is the `at` command in Linux?
The `at` command schedules a one-time task, e.g., `at now + 1 hour` runs a command in an hour. It’s useful for ad-hoc tasks, unlike recurring `cron` jobs.
98. What is the `systemctl` command in Linux?
The `systemctl` command manages systemd services, e.g., `systemctl start apache2` starts the Apache service. Use `stop`, `restart`, or `enable` for control and `status` for details.
99. What is systemd in Linux?
Systemd is a system and service manager, replacing older init systems, handling service startup, logging, and more. It uses `systemctl` for control and supports parallel service initialization.
100. What is the `service` command in Linux?
The `service` command controls services, e.g., `service nginx restart` restarts Nginx. It’s a legacy wrapper for init or systemd, used on older or mixed systems.
101. What is the `journalctl` command in Linux?
The `journalctl` command queries systemd’s logs, e.g., `journalctl -u sshd` shows SSH service logs. Use `-f` for real-time monitoring or `--since` for time-based filtering.
102. What is the `/etc/fstab` file in Linux?
The `/etc/fstab` file defines filesystem mounts, specifying devices, mount points, and options, e.g., `/dev/sda1 / ext4 defaults 0 1`. It’s used during boot to configure filesystems.
103. What is the `mount` command in Linux?
The `mount` command attaches a filesystem to a directory, e.g., `mount /dev/sdb1 /mnt`. Use `mount -t ext4` to specify the filesystem type and `umount` to detach.
104. What is the `umount` command in Linux?
The `umount` command detaches a mounted filesystem, e.g., `umount /mnt`. It ensures safe removal of devices, failing if the filesystem is busy (e.g., open files).
105. What is the `fsck` command in Linux?
The `fsck` command checks and repairs filesystems, e.g., `fsck /dev/sda1`. It’s run on unmounted filesystems to fix errors, often automatically during boot for consistency.
106. What is the `blkid` command in Linux?
The `blkid` command displays block device attributes, like UUIDs and filesystem types, e.g., `blkid /dev/sda1`. It’s used for identifying devices in `fstab` or scripts.
107. What is the `lsblk` command in Linux?
The `lsblk` command lists block devices and their mount points, e.g., `lsblk` shows a tree of disks and partitions. It’s useful for disk management and troubleshooting.
108. What is a swap space in Linux?
Swap space is disk space used as virtual memory when RAM is full, managed by the kernel. It’s configured via `swapon`, e.g., `swapon /swapfile`, and monitored with `free`.
109. What is the `swapon` command in Linux?
The `swapon` command enables swap space, e.g., `swapon /swapfile` activates a swap file. Use `swapoff` to disable it, and add to `/etc/fstab` for persistence.
110. What is the `mkswap` command in Linux?
The `mkswap` command formats a partition or file as swap space, e.g., `mkswap /swapfile`. It’s followed by `swapon` to activate the swap area.
111. What is the `parted` command in Linux?
The `parted` command manages disk partitions, e.g., `parted /dev/sda mkpart primary ext4 1MiB 100%`. It’s interactive, supporting resizing, formatting, and partition table creation.
112. What is the `fdisk` command in Linux?
The `fdisk` command creates or modifies partition tables, e.g., `fdisk /dev/sda` enters an interactive mode. It’s used for partitioning disks before formatting filesystems.
113. What is the `mkfs` command in Linux?
The `mkfs` command formats a partition with a filesystem, e.g., `mkfs.ext4 /dev/sda1` creates an ext4 filesystem. It’s used after partitioning to prepare disks for use.
114. What is the `/proc` filesystem in Linux?
The `/proc` filesystem is a virtual filesystem providing process and kernel information, e.g., `/proc/cpuinfo` shows CPU details. It’s used for system monitoring and diagnostics.
115. What is the `/dev` directory in Linux?
The `/dev` directory contains device files representing hardware, like `/dev/sda` for a disk or `/dev/null` for a null device. It’s managed by the kernel and udev.
116. What is the `/etc` directory in Linux?
The `/etc` directory stores system configuration files, like `/etc/passwd` for users or `/etc/fstab` for mounts. It’s critical for system administration and service settings.
117. What is the `/var` directory in Linux?
The `/var` directory holds variable data, like logs (`/var/log`), spool files, and temporary files. It’s used by daemons and applications for dynamic, changing data.
118. What is the `/tmp` directory in Linux?
The `/tmp` directory stores temporary files created by applications or users, automatically cleaned on reboot. It’s writable by all but should avoid sensitive data due to accessibility.
119. What is the `/home` directory in Linux?
The `/home` directory contains user home directories, like `/home/user1`, storing personal files and configurations. Each user typically has write access only to their own directory.
120. What is the `/root` directory in Linux?
The `/root` directory is the home directory for the root user, separate from `/home`. It stores root’s configuration files and data, accessible only by root.
121. What is the `/bin` directory in Linux?
The `/bin` directory contains essential user binaries, like `ls`, `cat`, and `cp`, available in single-user mode. It’s critical for basic system operations and recovery.
122. What is the `/sbin` directory in Linux?
The `/sbin` directory holds system binaries for administration, like `fsck` or `reboot`, typically used by root. It’s essential for system maintenance and boot processes.
123. What is the `/usr` directory in Linux?
The `/usr` directory stores user-installed software and data, like `/usr/bin` for binaries and `/usr/lib` for libraries. It’s non-critical for boot but vital for applications.
124. What is the `/boot` directory in Linux?
The `/boot` directory contains boot loader files, like the kernel (`vmlinuz`) and GRUB configuration. It’s critical for system startup and kernel management.
125. What is the `dmesg` command in Linux?
The `dmesg` command displays kernel ring buffer messages, e.g., `dmesg | grep error` finds error logs. It’s used for hardware and boot issue troubleshooting.
126. What is the `sysctl` command in Linux?
The `sysctl` command configures kernel parameters, e.g., `sysctl net.ipv4.ip_forward
127. What is the `/etc/sysctl.conf` file in Linux?
The `/etc/sysctl.conf` file stores kernel parameter settings applied at boot, e.g., `vm.swappiness
128. What is the `ulimit` command in Linux?
The `ulimit` command sets or displays resource limits, e.g., `ulimit -u 1000` restricts max processes. It’s used in shells or `/etc/security/limits.conf` for user constraints.
129. What is the `netstat` command in Linux?
The `netstat` command displays network statistics, like open ports or connections, e.g., `netstat -tuln`. It’s used for network troubleshooting, though `ss` is often preferred.
130. What is the `ss` command in Linux?
The `ss` command shows socket statistics, e.g., `ss -tuln` lists listening TCP/UDP ports. It’s faster and more detailed than `netstat`, ideal for network diagnostics.
131. What is the `ping` command in Linux?
The `ping` command tests network connectivity, e.g., `ping google.com` sends ICMP packets and measures response time. Use `-c` to limit the number of pings.
132. What is the `traceroute` command in Linux?
The `traceroute` command traces the network path to a host, e.g., `traceroute google.com` shows hops and latency. It’s used to diagnose routing issues or network delays.
133. What is the `nslookup` command in Linux?
The `nslookup` command queries DNS servers, e.g., `nslookup google.com` returns IP addresses. It’s used for troubleshooting DNS resolution or verifying domain records.
134. What is the `dig` command in Linux?
The `dig` command queries DNS with detailed output, e.g., `dig google.com` shows DNS records like A or MX. It’s more powerful than `nslookup` for DNS diagnostics.
135. What is the `ifconfig` command in Linux?
The `ifconfig` command displays or configures network interfaces, e.g., `ifconfig eth0` shows IP and status. It’s legacy, replaced by `ip` in modern systems.
136. What is the `ip` command in Linux?
The `ip` command manages network interfaces, routing, and more, e.g., `ip addr show` lists interfaces. It’s the modern replacement for `ifconfig`, offering richer functionality.
137. What is the `route` command in Linux?
The `route` command displays or modifies the routing table, e.g., `route -n` shows routes. It’s used for network configuration, though `ip route` is preferred now.
138. What is the `iptables` command in Linux?
The `iptables` command configures firewall rules, e.g., `iptables -A INPUT -p tcp --dport 22 -j ACCEPT` allows SSH. It’s used for network security, though `nftables` is newer.
139. What is the `nftables` command in Linux?
The `nftables` command manages firewall and NAT rules, e.g., `nft add rule ip filter input tcp dport 22 accept`. It’s the modern replacement for `iptables`, with a unified framework.
140. What is the `firewalld` service in Linux?
Firewalld is a dynamic firewall manager, using `firewall-cmd`, e.g., `firewall-cmd --add-port
141. What is the `tcpdump` command in Linux?
The `tcpdump` command captures network packets, e.g., `tcpdump -i eth0 port 80` grabs HTTP traffic. It’s used for network debugging and security analysis.
142. What is the `wireshark` tool in Linux?
Wireshark is a GUI-based packet analyzer for capturing and inspecting network traffic, e.g., filtering by protocol. It’s used for in-depth network troubleshooting and security audits.
143. What is the `curl` command in Linux?
The `curl` command transfers data via HTTP, FTP, etc., e.g., `curl https://example.com` fetches a webpage. It supports headers, POST data, and file downloads for testing APIs.
144. What is the `wget` command in Linux?
The `wget` command downloads files from the web, e.g., `wget https://example.com/file.zip`. It supports recursive downloads and resuming, ideal for bulk or interrupted transfers.
145. What is the `ssh` command in Linux?
The `ssh` command connects to a remote server via Secure Shell, e.g., `ssh user@host`. It provides secure command execution and file transfers, using keys or passwords.
146. What is the `scp` command in Linux?
The `scp` command securely copies files between hosts, e.g., `scp file.txt user@host:/path`. It uses SSH for encryption, supporting recursive transfers with `-r`.
147. What is the `rsync` command in Linux?
The `rsync` command synchronizes files efficiently, e.g., `rsync -av source/ user@host:/dest`. It transfers only differences, supports compression, and is ideal for backups.
148. What is the `/etc/hosts` file in Linux?
The `/etc/hosts` file maps hostnames to IP addresses, e.g., `127.0.0.1 localhost`. It’s used for local DNS resolution, overriding external DNS for specific hosts.
149. What is the `/etc/resolv.conf` file in Linux?
The `/etc/resolv.conf` file lists DNS servers, e.g., `nameserver 8.8.8.8`. It’s used for domain name resolution, managed by the system or DHCP clients.
150. What is the `hostname` command in Linux?
The `hostname` command displays or sets the system’s hostname, e.g., `hostname` shows the current name. Use `hostname newname` to change it temporarily or edit `/etc/hostname` for persistence.
151. What is the `dhclient` command in Linux?
The `dhclient` command requests an IP address from a DHCP server, e.g., `dhclient eth0`. It’s used to configure network interfaces dynamically on boot or manually.
152. What is the `nmcli` command in Linux?
The `nmcli` command manages NetworkManager, e.g., `nmcli con up eth0` activates a connection. It’s used for network configuration, supporting Wi-Fi, VPNs, and Ethernet.
153. What is NetworkManager in Linux?
NetworkManager is a daemon for managing network connections, handling Wi-Fi, Ethernet, and VPNs. It provides tools like `nmcli` and `nmtui` for easy configuration.
154. What is the `ethtool` command in Linux?
The `ethtool` command displays or configures network interface settings, e.g., `ethtool eth0` shows speed and status. It’s used for low-level network diagnostics and tuning.
155. What is the `ip link` command in Linux?
The `ip link` command manages network interfaces, e.g., `ip link show` lists interfaces, or `ip link set eth0 up` enables one. It’s part of the `ip` suite for network control.
156. What is the `ip addr` command in Linux?
The `ip addr` command manages IP addresses, e.g., `ip addr show` lists interface IPs, or `ip addr add 192.168.1.2/24 dev eth0` assigns an IP. It’s used for network configuration.
157. What is the `ip route` command in Linux?
The `ip route` command manages routing tables, e.g., `ip route show` lists routes, or `ip route add default via 192.168.1.1` sets a default gateway. It’s critical for network routing.
158. What is the `arp` command in Linux?
The `arp` command manages the ARP cache, e.g., `arp -n` lists IP-to-MAC mappings. It’s used for troubleshooting network connectivity issues at the link layer.
159. What is the `nmap` command in Linux?
The `nmap` command scans networks for hosts and services, e.g., `nmap 192.168.1.0/24` discovers devices. It’s used for security audits and network mapping.
160. What is the `telnet` command in Linux?
The `telnet` command connects to a remote host on a port, e.g., `telnet 192.168.1.1 23`. It’s used for testing connectivity but is insecure compared to SSH.
161. What is the `ftp` command in Linux?
The `ftp` command connects to an FTP server for file transfers, e.g., `ftp ftp.example.com`. It’s interactive, supporting uploads/downloads, but `sftp` is preferred for security.
162. What is the `sftp` command in Linux?
The `sftp` command securely transfers files over SSH, e.g., `sftp user@host`. It’s similar to `ftp` but encrypted, used for safe file exchanges.
163. What is the `lsof` command in Linux?
The `lsof` command lists open files, including network sockets, e.g., `lsof -i :80` shows processes using port 80. It’s used for resource and network troubleshooting.
164. What is the `strace` command in Linux?
The `strace` command traces system calls made by a process, e.g., `strace ls` logs calls like `open()`. It’s used for debugging and performance analysis.
165. What is the `gdb` command in Linux?
The `gdb` command is a debugger for C/C++ programs, e.g., `gdb myprogram` starts debugging. It supports breakpoints, stepping, and variable inspection for crash analysis.
166. What is the `valgrind` tool in Linux?
Valgrind is a tool for memory debugging, e.g., `valgrind --leak-check
167. What is the `perf` command in Linux?
The `perf` command analyzes system and application performance, e.g., `perf stat ls` measures CPU usage. It’s used for profiling, identifying bottlenecks, and tuning.
168. What is the `sar` command in Linux?
The `sar` command collects and reports system activity, e.g., `sar -u 1 5` shows CPU usage every second for 5 samples. It’s part of `sysstat` for performance monitoring.
169. What is the `vmstat` command in Linux?
The `vmstat` command reports virtual memory statistics, e.g., `vmstat 1` shows memory, CPU, and I/O every second. It’s used for system performance analysis.
170. What is the `iostat` command in Linux?
The `iostat` command monitors CPU and disk I/O, e.g., `iostat -dx 1` shows detailed disk stats. It’s part of `sysstat`, used for storage performance troubleshooting.
171. What is the `mpstat` command in Linux?
The `mpstat` command reports CPU statistics, e.g., `mpstat -P ALL 1` shows per-CPU usage. It’s part of `sysstat`, used for multi-core performance analysis.
172. What is the `pidstat` command in Linux?
The `pidstat` command monitors process resource usage, e.g., `pidstat -u 1` shows CPU usage per process. It’s part of `sysstat`, ideal for process-level diagnostics.
173. What is the `dstat` command in Linux?
The `dstat` command provides real-time system resource stats, e.g., `dstat -cdngy` shows CPU, disk, network, and more. It’s customizable and more user-friendly than `vmstat`.
174. What is the `iotop` command in Linux?
The `iotop` command monitors disk I/O by process, e.g., `iotop` shows real-time read/write rates. It’s used to identify processes causing disk bottlenecks.
175. What is the `nmon` tool in Linux?
Nmon is a performance monitoring tool, e.g., `nmon` provides an interactive dashboard for CPU, memory, and disk. It’s used for system health checks and resource analysis.
176. What is the `glances` tool in Linux?
Glances is a cross-platform monitoring tool, e.g., `glances` shows CPU, memory, and network stats in a curses interface. It supports remote monitoring and web output.
177. What is the `atop` command in Linux?
The `atop` command monitors system resources and processes, e.g., `atop 1` logs every second. It tracks historical data, useful for long-term performance analysis.
178. What is the `htop` vs `top` comparison in Linux?
`htop` offers a colorful, interactive interface with mouse support and easier navigation, while `top` is simpler but less user-friendly. Both monitor processes, but `htop` is preferred for usability.
179. What is the `kill -9` command in Linux?
`kill -9` sends SIGKILL to a process, e.g., `kill -9 1234` forcefully terminates PID 1234. It’s a last resort, as it doesn’t allow cleanup, risking data loss.
180. What is a signal in Linux?
A signal is a software interrupt sent to a process, like SIGTERM (terminate) or SIGKILL (force kill). Signals are sent via `kill` or the kernel for process control.
181. What is the `pkill` command in Linux?
The `pkill` command terminates processes by name or criteria, e.g., `pkill -u user1` kills all `user1`’s processes. It’s more flexible than `kill`, supporting patterns.
182. What is the `pgrep` command in Linux?
The `pgrep` command finds process IDs by name or criteria, e.g., `pgrep firefox` lists Firefox PIDs. It’s used with `pkill` or scripts for process management.
183. What is the `top` vs `ps` comparison in Linux?
`top` provides real-time, interactive process monitoring, while `ps` offers a static snapshot, e.g., `ps aux`. Use `top` for live tracking and `ps` for scripting or filtering.
184. What is the `nice` vs `renice` comparison in Linux?
`nice` sets priority for new processes, e.g., `nice -n 10 myprogram`, while `renice` adjusts running processes, e.g., `renice 10 -p 1234`. Both manage CPU scheduling.
185. What is the `chroot` command in Linux?
The `chroot` command changes the root directory for a process, e.g., `chroot /newroot`. It’s used for testing, recovery, or isolating environments, limiting file access.
186. What is a chroot jail in Linux?
A chroot jail isolates a process to a specific directory, e.g., `chroot /jail /bin/bash`, restricting filesystem access. It’s used for security, like running untrusted applications.
187. What is the `pivot_root` command in Linux?
The `pivot_root` command changes the root filesystem during boot, e.g., `pivot_root /newroot /newroot/old`. It’s used in initramfs to transition to the final root filesystem.
188. What is the `initramfs` in Linux?
Initramfs is a temporary root filesystem loaded into memory during boot, containing tools and drivers. It initializes hardware and mounts the real root filesystem before handing off.
189. What is the `GRUB` bootloader in Linux?
GRUB (Grand Unified Bootloader) is a bootloader that loads the Linux kernel and initramfs, configured via `/etc/grub.cfg`. It supports multiple OSes and boot options.
190. What is the `update-grub` command in Linux?
The `update-grub` command regenerates the GRUB configuration, e.g., `update-grub` scans for kernels and OSes. It’s run after kernel updates or `/etc/grub.d` changes.
191. What is the `/etc/grub.cfg` file in Linux?
The `/etc/grub.cfg` file is GRUB’s main configuration, defining boot menu entries and kernel parameters. It’s generated by `update-grub` and shouldn’t be edited manually.
192. What is the `mkinitcpio` command in Linux?
The `mkinitcpio` command creates initramfs images on Arch-based systems, e.g., `mkinitcpio -P` generates for all kernels. It’s used to update boot images after kernel changes.
193. What is the `dracut` command in Linux?
The `dracut` command generates initramfs images, e.g., `dracut /boot/initramfs.img`. It’s used on Fedora-based systems, supporting modular and automatic hardware detection.
194. What is a kernel module in Linux?
A kernel module is a loadable code extending kernel functionality, like drivers, e.g., `vfat.ko` for FAT filesystems. Modules are managed with `modprobe` or `insmod`.
195. What is the `modprobe` command in Linux?
The `modprobe` command loads or unloads kernel modules, e.g., `modprobe vfat` loads the FAT driver. It handles dependencies and is safer than `insmod`.
196. What is the `insmod` command in Linux?
The `insmod` command inserts a kernel module, e.g., `insmod /path/to/module.ko`. It’s low-level, requiring manual dependency handling, unlike `modprobe`.
197. What is the `rmmod` command in Linux?
The `rmmod` command removes a kernel module, e.g., `rmmod vfat`. It’s used to unload unused modules, but `modprobe -r` is preferred for dependency management.
198. What is the `lsmod` command in Linux?
The `lsmod` command lists loaded kernel modules, e.g., `lsmod` shows module names, sizes, and dependencies. It reads `/proc/modules` for module information.
199. What is the `depmod` command in Linux?
The `depmod` command generates module dependency files, e.g., `depmod -a` updates `/lib/modules`. It’s run after installing new modules to ensure `modprobe` works correctly.
200. What is the `/etc/modules` file in Linux?
The `/etc/modules` file lists kernel modules to load at boot, e.g., `vfat` on a line. It’s used for automatic module loading, managed by the init system.
201. What is the `uname -r` command in Linux?
The `uname -r` command displays the current kernel version, e.g., `5.15.0-73-generic`. It’s used for compatibility checks or locating kernel-specific files in `/lib/modules`.
202. What is the `kmod` tool in Linux?
The `kmod` tool manages kernel modules, providing commands like `kmod load module` or `kmod list`. It’s a modern backend for `modprobe`, `lsmod`, and others.
203. What is the `sysfs` filesystem in Linux?
The `sysfs` filesystem, mounted at `/sys`, exposes kernel objects, like devices and drivers, e.g., `/sys/class/net`. It’s used for system monitoring and configuration.
204. What is the `udev` system in Linux?
Udev is a device manager that dynamically creates `/dev` entries, e.g., adding `/dev/sdb` for a USB drive. It uses rules in `/etc/udev/rules.d` for device naming and actions.
205. What is the `/etc/udev/rules.d` directory in Linux?
The `/etc/udev/rules.d` directory stores custom udev rules, e.g., `SUBSYSTEM
206. What is the `udevadm` command in Linux?
The `udevadm` command manages udev, e.g., `udevadm trigger` applies rules, or `udevadm monitor` watches device events. It’s used for debugging and testing udev configurations.
207. What is the `lscpu` command in Linux?
The `lscpu` command displays CPU information, e.g., `lscpu` shows cores, architecture, and frequency. It’s used for system profiling and performance tuning.
208. What is the `lspci` command in Linux?
The `lspci` command lists PCI devices, e.g., `lspci` shows graphics cards and network adapters. It’s used for hardware diagnostics and driver verification.
209. What is the `lsusb` command in Linux?
The `lsusb` command lists USB devices, e.g., `lsusb` shows connected keyboards or drives. It’s used for troubleshooting USB hardware and identifying device IDs.
210. What is the `dmidecode` command in Linux?
The `dmidecode` command reads hardware information from DMI/SMBIOS, e.g., `dmidecode -t memory` shows RAM details. It’s used for system inventory and compatibility checks.
211. What is the `hdparm` command in Linux?
The `hdparm` command manages disk parameters, e.g., `hdparm -tT /dev/sda` tests disk speed. It’s used for disk optimization and diagnostics, like setting power modes.
212. What is the `smartctl` command in Linux?
The `smartctl` command monitors disk health via SMART, e.g., `smartctl -a /dev/sda` shows drive status. It’s part of `smartmontools`, used for predicting disk failures.
213. What is the `lshw` command in Linux?
The `lshw` command lists hardware details, e.g., `lshw -C network` shows network adapters. It’s used for comprehensive hardware inventory and troubleshooting.
214. What is the `inotifywait` command in Linux?
The `inotifywait` command monitors filesystem events, e.g., `inotifywait -m /dir` watches for file changes. It’s used in scripts for real-time file system monitoring.
215. What is the `auditd` service in Linux?
The `auditd` service logs security-relevant events, like file access or `sudo` usage, configured via `/etc/audit/audit.rules`. It’s used for compliance and intrusion detection.
216. What is the `ausearch` command in Linux?
The `ausearch` command queries audit logs, e.g., `ausearch -m LOGIN` finds login events. It’s used with `auditd` for security analysis and forensic investigations.
217. What is the `apparmor` in Linux?
AppArmor is a security module restricting program capabilities, e.g., confining `firefox` via profiles in `/etc/apparmor.d`. It’s used for mandatory access control, enhancing system security.
218. What is the `selinux` in Linux?
SELinux (Security-Enhanced Linux) is a mandatory access control system, enforcing policies via labels, e.g., `httpd_t` for Apache. It’s used on RHEL-based systems for fine-grained security.
219. What is the `semanage` command in Linux?
The `semanage` command manages SELinux policies, e.g., `semanage fcontext -a -t httpd_sys_content_t \"/web(/.*)?\"` sets file contexts. It’s used for SELinux configuration.
220. What is the `setsebool` command in Linux?
The `setsebool` command toggles SELinux booleans, e.g., `setsebool -P httpd_can_network_connect on` allows Apache network connections. It’s used to adjust SELinux behavior.
221. What is the `getsebool` command in Linux?
The `getsebool` command lists SELinux boolean settings, e.g., `getsebool -a` shows all booleans. It’s used to verify SELinux configurations and troubleshoot permissions.
222. What is the `chcon` command in Linux?
The `chcon` command changes SELinux file contexts, e.g., `chcon -t httpd_sys_content_t file.html`. It’s used to align files with SELinux policies for access control.
223. What is the `restorecon` command in Linux?
The `restorecon` command resets SELinux file contexts to defaults, e.g., `restorecon -R /web`. It’s used to fix mislabeled files based on policy-defined contexts.
224. What is the `getenforce` command in Linux?
The `getenforce` command shows the SELinux mode, e.g., `Enforcing`, `Permissive`, or `Disabled`. It’s used to verify SELinux status and troubleshoot security issues.
225. What is the `setenforce` command in Linux?
The `setenforce` command toggles SELinux mode, e.g., `setenforce 0` sets Permissive mode. It’s used for temporary changes, with `/etc/selinux/config` for persistence.
226. What is the `/etc/selinux/config` file in Linux?
The `/etc/selinux/config` file sets SELinux mode and policy, e.g., `SELINUX
227. What is a container in Linux?
A container is a lightweight, isolated environment running on a shared kernel, using namespaces and cgroups, e.g., Docker containers. It’s used for application deployment and isolation.
228. What is Docker in Linux?
Docker is a platform for creating and managing containers, e.g., `docker run ubuntu` starts an Ubuntu container. It uses images, simplifying deployment and scalability.
229. What is the `docker run` command in Linux?
The `docker run` command starts a container from an image, e.g., `docker run -d nginx` runs Nginx in detached mode. It supports options like `-p` for port mapping.
230. What is the `docker ps` command in Linux?
The `docker ps` command lists running containers, e.g., `docker ps -a` shows all containers, including stopped ones. It displays IDs, images, and statuses.
231. What is the `docker images` command in Linux?
The `docker images` command lists local Docker images, e.g., `docker images` shows image names, tags, and sizes. It’s used to manage images for container creation.
232. What is the `docker pull` command in Linux?
The `docker pull` command downloads an image from a registry, e.g., `docker pull ubuntu:20.04`. It’s used to fetch images for running containers locally.
233. What is the `docker build` command in Linux?
The `docker build` command creates an image from a Dockerfile, e.g., `docker build -t myapp .`. It’s used to package applications with dependencies for containerization.
234. What is a Dockerfile in Linux?
A Dockerfile is a script defining steps to build a Docker image, e.g., `FROM ubuntu`, `RUN apt update`. It specifies base images, commands, and configurations.
235. What is the `docker-compose` command in Linux?
The `docker-compose` command manages multi-container applications, e.g., `docker-compose up` starts services defined in `docker-compose.yml`. It simplifies orchestration for complex apps.
236. What is Kubernetes in Linux?
Kubernetes is an orchestration platform for managing containerized applications, e.g., deploying Docker containers across clusters. It handles scaling, load balancing, and self-healing.
237. What is the `kubectl` command in Linux?
The `kubectl` command interacts with Kubernetes clusters, e.g., `kubectl get pods` lists running pods. It’s used for deploying, managing, and debugging applications.
238. What is a pod in Kubernetes?
A pod is the smallest deployable unit in Kubernetes, containing one or more containers, e.g., a web server and logger. Pods share networking and storage, managed by Kubernetes.
239. What is a namespace in Linux containers?
A namespace isolates system resources, like PID or network, e.g., creating separate process trees for containers. It’s a core Linux feature enabling containerization in Docker.
240. What is a cgroup in Linux?
A cgroup (control group) limits and monitors resource usage, like CPU or memory, for processes, e.g., in containers. It’s managed via `/sys/fs/cgroup` or tools like `systemd`.
241. What is the `systemd-cgtop` command in Linux?
The `systemd-cgtop` command monitors cgroup resource usage, e.g., `systemd-cgtop` shows CPU and memory by group. It’s used for performance analysis in containerized environments.
242. What is the `lxc` command in Linux?
The `lxc` command manages Linux containers, e.g., `lxc-create -t ubuntu` creates an Ubuntu container. It’s a lightweight alternative to Docker, focusing on system containers.
243. What is the `podman` command in Linux?
The `podman` command manages containers without a daemon, e.g., `podman run ubuntu`. It’s a Docker-compatible, rootless alternative, ideal for secure environments.
244. What is the `buildah` command in Linux?
The `buildah` command builds container images, e.g., `buildah bud -t myimage .`. It’s used with `podman`, offering fine-grained control over image creation.
245. What is the `skopeo` command in Linux?
The `skopeo` command manages container images, e.g., `skopeo copy docker://ubuntu oci:local`. It’s used for copying, inspecting, and syncing images across registries.
246. What is the `runc` command in Linux?
The `runc` command runs containers per the OCI standard, e.g., `runc run mycontainer`. It’s a low-level tool used by Docker and Podman for container execution.
247. What is the `containerd` in Linux?
Containerd is a container runtime, e.g., managing container lifecycles for Docker or Kubernetes. It handles image pulls, storage, and execution, abstracting low-level details.
248. What is the `cri-o` in Linux?
CRI-O is a lightweight container runtime for Kubernetes, e.g., running OCI-compliant containers. It’s designed for Kubernetes, replacing Docker in cluster environments.
249. What is the `ansible` tool in Linux?
Ansible is an automation tool for configuration management, e.g., `ansible-playbook playbook.yml` applies server configs. It uses SSH and YAML for agentless, idempotent operations.
250. What is the `puppet` tool in Linux?
Puppet is a configuration management tool, e.g., `puppet apply manifest.pp` configures systems. It uses a client-server model and declarative manifests for consistent setups.
251. What is the `chef` tool in Linux?
Chef is a configuration management tool, e.g., `chef-client` applies recipes to nodes. It uses Ruby-based cookbooks for automating server configurations and deployments.
252. What is the `salt` tool in Linux?
Salt is an automation platform, e.g., `salt \'*\' test.ping` checks minion status. It uses a master-minion model for configuration management and remote execution.
253. What is the `terraform` tool in Linux?
Terraform is an infrastructure-as-code tool, e.g., `terraform apply` provisions cloud resources. It uses HCL to define infrastructure, supporting AWS, Azure, and more.
254. What is the `packer` tool in Linux?
Packer is a tool for creating machine images, e.g., `packer build template.json` generates AMIs. It’s used for consistent VM or container image creation across platforms.
255. What is the `vagrant` tool in Linux?
Vagrant is a tool for managing virtual machines, e.g., `vagrant up` starts a VM from a Vagrantfile. It’s used for reproducible development environments with providers like VirtualBox.
256. What is the `qemu` tool in Linux?
QEMU is a virtualization and emulation tool, e.g., `qemu-system-x86_64 -hda disk.img` runs a VM. It supports full system emulation and is used with KVM for performance.
257. What is KVM in Linux?
KVM (Kernel-based Virtual Machine) is a Linux kernel module for virtualization, e.g., used with `qemu-kvm`. It leverages hardware virtualization for efficient VMs, managed by tools like `virt-manager`.
258. What is the `virt-manager` tool in Linux?
Virt-manager is a GUI for managing KVM/QEMU VMs, e.g., creating and monitoring virtual machines. It provides an intuitive interface for configuring CPU, memory, and storage.
259. What is the `libvirt` in Linux?
Libvirt is a virtualization API, e.g., managing KVM, QEMU, or LXC via `virsh`. It provides a unified interface for VM and container lifecycle management.
260. What is the `virsh` command in Linux?
The `virsh` command manages virtual machines via libvirt, e.g., `virsh list --all` shows VMs. It’s used for starting, stopping, or configuring virtualization resources.
261. What is the `zfs` filesystem in Linux?
ZFS is an advanced filesystem with features like snapshots and data integrity, e.g., `zfs create pool/data`. It’s used for robust storage management, though licensing limits kernel integration.
262. What is the `btrfs` filesystem in Linux?
Btrfs is a modern filesystem with snapshots, compression, and subvolumes, e.g., `btrfs subvolume create /data`. It’s used for flexible storage and data management.
263. What is the `xfs` filesystem in Linux?
XFS is a high-performance filesystem optimized for large files, e.g., `mkfs.xfs /dev/sda1`. It’s used in enterprise environments for scalability and reliability.
264. What is the `ext4` filesystem in Linux?
Ext4 is a widely used Linux filesystem, e.g., `mkfs.ext4 /dev/sda1`, supporting large partitions and journaling. It’s reliable and the default for many distributions.
265. What is LVM in Linux?
LVM (Logical Volume Manager) manages disk volumes, e.g., `lvcreate -L 10G myvg`. It allows dynamic resizing and snapshots, improving storage flexibility.
266. What is the `lvcreate` command in Linux?
The `lvcreate` command creates logical volumes, e.g., `lvcreate -L 10G -n mylv myvg`. It’s used in LVM to allocate storage from a volume group.
267. What is the `vgcreate` command in Linux?
The `vgcreate` command creates a volume group, e.g., `vgcreate myvg /dev/sda1`. It’s used in LVM to pool physical volumes for logical volume
Share this protal to share friends and complete unlimited tests here. You can also make friends on our protal also start mutual competition tests with your firends easily.