FREE Manual Testing Batch Starts in Enroll Now | +91-8143353888 | +91-7780122379

Linux

  • Q1: What is Linux?
    A: Linux is an open-source operating system based on the Unix operating system. It is known for its stability, security, and flexibility.
  • Q2: What are the different components of Linux?
    A: The components of Linux include the kernel, shell, file system, and various system utilities.
  • Q3: What is the role of the Linux kernel?
    A: The Linux kernel is the core component of the operating system. It manages system resources, such as memory, processes, and hardware devices.
  • Q4: What is a shell in Linux?
    A: A shell is a command-line interface that allows users to interact with the operating system. It interprets user commands and executes them.
  • Q5: What is the default shell in Linux?
    A: The default shell in most Linux distributions is the Bash (Bourne Again Shell).
  • Q6: What is a file system in Linux?
    A: A file system is a method used by the operating system to organize and store files on disk. Linux supports various file systems, such as ext4, XFS, and Btrfs.
  • Q7: How do you change the permissions of a file in Linux?
    A: The "chmod" command is used to change the permissions of a file in Linux. For example, "chmod 755 filename" sets read, write, and execute permissions for the owner, and read and execute permissions for group and others.
  • Q8: What is the root user in Linux?
    A: The root user is the administrative user in Linux who has full privileges and control over the system.
  • Q9: How do you switch to the root user in Linux?
    A: You can switch to the root user by using the "su" (substitute user) command and providing the root password. For example, "su -" or "su root".
  • Q10: What is a package manager in Linux?
    A: A package manager is a tool used to install, update, and manage software packages in Linux. Examples of package managers include apt, yum, and dnf.
  • Q11: How do you install a package using apt-get in Ubuntu?
    A: You can install a package using the apt-get command in Ubuntu by running "sudo apt-get install package_name".
  • Q12: What is the difference between "apt-get" and "apt" in Ubuntu?
    A: "apt-get" is the older package management command in Ubuntu, while "apt" is a newer command that provides a more user-friendly interface and additional features.
  • Q13: How do you list files and directories in Linux?
    A: You can list files and directories in Linux using the "ls" command. For example, "ls" lists the files and directories in the current directory.
  • Q14: How do you create a new directory in Linux?
    A: You can create a new directory in Linux using the "mkdir" command. For example, "mkdir new_directory" creates a directory named "new_directory".
  • Q15: How do you copy files and directories in Linux?
    A: You can copy files and directories in Linux using the "cp" command. For example, "cp file.txt destination" copies the file "file.txt" to the specified destination.
  • Q16: How do you move files and directories in Linux?
    A: You can move files and directories in Linux using the "mv" command. For example, "mv file.txt destination" moves the file "file.txt" to the specified destination.
  • Q17: How do you delete a file in Linux?
    A: You can delete a file in Linux using the "rm" command. For example, "rm file.txt" deletes the file "file.txt".
  • Q18: How do you delete a directory in Linux?
    A: You can delete a directory in Linux using the "rm" command with the "-r" option. For example, "rm -r directory" deletes the directory and its contents.
  • Q19: What is the difference between "rm" and "rm -r" in Linux?
    A: "rm" is used to delete files, while "rm -r" is used to delete directories and their contents recursively.
  • Q20: How do you search for a file in Linux?
    A: You can search for a file in Linux using the "find" command. For example, "find / -name filename" searches for the file named "filename" starting from the root directory.
  • Q21: How do you search for a text string in files in Linux?
    A: You can search for a text string in files in Linux using the "grep" command. For example, "grep "text" file.txt" searches for the text string in the file "file.txt".
  • Q22: What is the difference between a hard link and a soft link (symbolic link) in Linux?
    A: A hard link is a direct reference to a file, while a soft link (symbolic link) is a reference to the file by its path. A hard link points to the same inode as the original file, while a soft link points to the file by its path.
  • Q23: How do you create a hard link in Linux?
    A: You can create a hard link in Linux using the "ln" command with the target file and the name of the link. For example, "ln file.txt link.txt" creates a hard link named "link.txt" to the file "file.txt".
  • Q24: How do you create a soft link (symbolic link) in Linux?
    A: You can create a soft link (symbolic link) in Linux using the "ln" command with the "-s" option. For example, "ln -s file.txt link.txt" creates a symbolic link named "link.txt" to the file "file.txt".
  • Q25: What is a process in Linux?
    A: A process is a running instance of a program in Linux. Each process has its own process ID (PID) and can perform tasks independently.
  • Q26: How do you view running processes in Linux?
    A: You can view running processes in Linux using the "ps" command. For example, "ps aux" displays all running processes.
  • Q27: How do you terminate a process in Linux?
    A: You can terminate a process in Linux using the "kill" command. You need to know the process ID (PID) of the process to be terminated. For example, "kill PID" terminates the process with the specified PID.
  • Q28: What is a daemon in Linux?
    A: A daemon is a background process that runs independently of user sessions. Daemons are often used for system services, such as web servers or database servers.
  • Q29: How do you start and stop a daemon in Linux?
    A: The exact method to start and stop a daemon depends on the specific daemon and the Linux distribution. However, common methods include using the "service" command or running the daemon as a system service.
  • Q30: What is the purpose of the "chmod" command in Linux?
    A: The "chmod" command is used to change the permissions of files and directories in Linux. It allows you to control read, write, and execute permissions for the owner, group, and others.
  • Q31: What are the three basic permissions in Linux?
    A: The three basic permissions in Linux are read (r), write (w), and execute (x). These permissions can be granted or revoked for the owner, group, and others.
  • Q32: What are the three permission levels in Linux?
    A: The three permission levels in Linux are user, group, and others. Each level can have different permissions for a file or directory.
  • Q33: How do you set the default file permissions for newly created files in Linux?
    A: The default file permissions for newly created files in Linux can be set using the "umask" command. The "umask" value specifies the permissions to be subtracted from the maximum permissions.
  • Q34: What is the purpose of the "chown" command in Linux?
    A: What is the purpose of the "chown" command in Linux?
  • Q35: What is the purpose of the "chgrp" command in Linux?
    A: The "chgrp" command is used to change the group ownership of a file or directory in Linux. It allows you to transfer ownership to another group.
  • Q36: How do you compress and decompress files in Linux?
    A: You can compress files in Linux using tools like "gzip" or "zip". For example, "gzip file.txt" compresses the file, while "gunzip file.txt.gz" decompresses the file.
  • Q37: What is the purpose of the "tar" command in Linux?
    A: The "tar" command is used to create, view, and extract archive files in Linux. It combines multiple files into a single archive file, which can be compressed or uncompressed.
  • Q38: How do you archive files using the "tar" command in Linux?
    A: You can archive files using the "tar" command in Linux by running "tar -cvf archive.tar file1 file2" to create an archive named "archive.tar" containing "file1" and "file2".
  • Q39: How do you extract files from an archive using the "tar" command in Linux?
    A: You can extract files from an archive using the "tar" command in Linux by running "tar -xvf archive.tar" to extract all files from the archive "archive.tar".
  • Q40: What is the purpose of the "dd" command in Linux?
    A: The "dd" command is used for low-level disk operations in Linux. It can be used to create disk images, clone disks, or perform data transfers.
  • Q41: How do you check disk space usage in Linux?
    A: You can check disk space usage in Linux using the "df" command. For example, "df -h" displays disk space usage in a human-readable format.
  • Q42: How do you check the memory usage in Linux?
    A: You can check memory usage in Linux using the "free" command. It displays information about available, used, and total memory.
  • Q43: What is the purpose of the "top" command in Linux?
    A: The "top" command is used to monitor system processes and resource usage in real-time. It provides a dynamic view of CPU usage, memory usage, and other system statistics.
  • Q44: How do you view the contents of a file in Linux?
    A: You can view the contents of a file in Linux using the "cat" command. For example, "cat file.txt" displays the contents of the file "file.txt".
  • Q45: How do you display the first few lines of a file in Linux?
    A: You can display the first few lines of a file in Linux using the "head" command. For example, "head -n 10 file.txt" displays the first 10 lines of the file "file.txt".
  • Q46: How do you display the last few lines of a file in Linux?
    A: You can display the last few lines of a file in Linux using the "tail" command. For example, "tail -n 10 file.txt" displays the last 10 lines of the file "file.txt".
  • Q47: What is the purpose of the "grep" command in Linux?
    A: The "grep" command is used to search for a specific pattern or text in files. It allows you to filter and display lines that match the specified pattern.
  • Q48: How do you count the number of lines, words, and characters in a file in Linux?
    A: You can count the number of lines, words, and characters in a file in Linux using the "wc" command. For example, "wc -lwc file.txt" displays the line count, word count, and character count of the file "file.txt".
  • Q49: How do you find and replace text in a file using the "sed" command in Linux?
    A: You can find and replace text in a file using the "sed" command in Linux. For example, "sed 's/old/new/g' file.txt" replaces all occurrences of "old" with "new" in the file "file.txt".
  • Q50: How do you schedule a task to run at a specific time in Linux?
    A: You can schedule a task to run at a specific time in Linux using the "cron" daemon. You can create a cron job by editing the crontab file using the "crontab -e" command.
  • Q51: What is the purpose of the "ssh" command in Linux?
    A: The "ssh" command is used to securely connect to a remote server over a network. It provides a secure encrypted connection for remote login and file transfer.
  • Q52: How do you generate SSH key pairs in Linux?
    A: You can generate SSH key pairs in Linux using the "ssh-keygen" command. For example, "ssh-keygen -t rsa" generates an RSA key pair.
  • Q53: What is the purpose of the "scp" command in Linux?
    A: The "scp" command is used to securely copy files between a local host and a remote host over a network using the SSH protocol.
  • Q54: What is the purpose of the "rsync" command in Linux?
    A: The "rsync" command is used to synchronize files and directories between a local system and a remote system. It can efficiently transfer only the differences between files.
  • Q55: How do you check the network connectivity in Linux?
    A: You can check network connectivity in Linux using the "ping" command. For example, "ping google.com" sends ICMP echo requests to google.com to check if the network connection is working.
  • Q56: How do you find the IP address of a Linux system?
    A: You can find the IP address of a Linux system using the "ifconfig" command or the newer "ip" command. For example, "ifconfig" displays network interface information, including the IP address.
  • Q57: How do you check the listening ports in Linux?
    A: You can check the listening ports in Linux using the "netstat" command. For example, "netstat -tuln" displays the listening TCP and UDP ports.
  • Q58: What is a firewall in Linux?
    A: A firewall in Linux is a network security system that monitors and controls incoming and outgoing network traffic. It acts as a barrier between the internal network and the external network.
  • Q59: What is the purpose of the "iptables" command in Linux?
    A: The "iptables" command is used to configure the firewall rules in Linux. It allows you to set up rules to filter and manipulate network traffic.
  • Q60: How do you check the system log files in Linux?
    A: You can check the system log files in Linux using the "tail" command with the "-f" option to follow the log files in real-time. For example, "tail -f /var/log/syslog" displays the system log messages.
  • Q61: How do you check the CPU usage in Linux?
    A: You can check the CPU usage in Linux using the "top" command or the "htop" command. They provide real-time information about CPU usage, processes, and system statistics.
  • Q62: How do you monitor disk I/O in Linux?
    A: You can monitor disk I/O in Linux using tools like "iostat" or "iotop". They provide information about disk read/write operations, disk utilization, and I/O performance.
  • Q63: How do you check the system uptime in Linux?
    A: You can check the system uptime in Linux using the "uptime" command. It displays the current time, the uptime of the system, and the average system load.
  • Q64: What is the purpose of the "crontab" command in Linux?
    A: The "crontab" command is used to manage cron jobs in Linux. It allows you to create, edit, and delete cron jobs that run at specified intervals.
  • Q65: How do you mount a filesystem in Linux?
    A: You can mount a filesystem in Linux using the "mount" command. For example, "mount /dev/sdb1 /mnt" mounts the filesystem on "/dev/sdb1" to the directory "/mnt".
  • Q66: How do you unmount a filesystem in Linux?
    A: You can unmount a filesystem in Linux using the "umount" command. For example, "umount /mnt" unmounts the filesystem mounted on "/mnt".
  • Q67: What is the purpose of the "lsblk" command in Linux?
    A: The "lsblk" command is used to list information about block devices, such as disks and partitions, in Linux. It provides a tree-like view of the block devices.
  • Q68: What is the purpose of the "fdisk" command in Linux?
    A: The "fdisk" command is used to manage disk partitions in Linux. It allows you to create, delete, and modify partitions on a disk.
  • Q69: How do you check the system hardware information in Linux?
    A: You can check the system hardware information in Linux using commands like "lshw", "dmidecode", or "hwinfo". They provide detailed information about the hardware components of the system.
  • Q70: How do you check the system information in Linux?
    A: You can check the system information in Linux using the "uname" command. For example, "uname -a" displays the kernel version, system architecture, and other information.
  • Q71: What is the purpose of the "lsof" command in Linux?
    A: The "lsof" command is used to list open files and the processes that have them open in Linux. It provides information about file descriptors, network connections, and other open resources.
  • Q72: How do you change the hostname of a Linux system?
    A: You can change the hostname of a Linux system by editing the "/etc/hostname" file and updating it with the new hostname. Additionally, you may need to update the "/etc/hosts" file to associate the new hostname with the IP address.
  • Q73: What is the purpose of the "chmod" command in Linux?
    A: The "chmod" command is used to change the permissions of files and directories in Linux. It allows you to control read, write, and execute permissions for the owner, group, and others.
  • Q74: How do you find the process ID (PID) of a running process in Linux?
    A: You can find the process ID (PID) of a running process in Linux using the "pidof" command or the "pgrep" command. For example, "pidof process_name" displays the PID of the process.
  • Q75: How do you check the system load average in Linux?
    A: You can check the system load average in Linux using the "uptime" command or the "top" command. They provide information about the average system load over different time intervals.
  • Q76: What is the purpose of the "kill" command in Linux?
    A: The "kill" command is used to send a signal to a process in Linux. By default, it sends the SIGTERM signal, which terminates the process. Other signals can be specified to perform different actions.
  • Q77: How do you check the running services in Linux?
    A: You can check the running services in Linux using the "systemctl" command. For example, "systemctl list-units --type=service" displays a list of running services.
  • Q78: What is the purpose of the "journalctl" command in Linux?
    A: The "journalctl" command is used to view and manipulate the logs from the systemd journal in Linux. It provides access to the system log messages and allows filtering and searching.
  • Q79: How do you check the system temperature in Linux?
    A: You can check the system temperature in Linux using tools like "lm_sensors" or "sensors". They provide information about the temperatures reported by the system's sensors.
  • Q80: What is the purpose of the "ssh-keygen" command in Linux?
    A: The "ssh-keygen" command is used to generate SSH key pairs in Linux. It creates the public and private keys used for authentication when connecting to remote systems via SSH.
  • Q81: How do you check the network interface configuration in Linux?
    A: You can check the network interface configuration in Linux using the "ifconfig" command or the newer "ip" command. They display information about network interfaces, IP addresses, and network settings.
  • Q82: What is the purpose of the "ifup" and "ifdown" commands in Linux?
    A: The "ifup" command is used to bring a network interface up, enabling network connectivity. The "ifdown" command is used to bring a network interface down, disabling network connectivity.
  • Q83: How do you check the routing table in Linux?
    A: You can check the routing table in Linux using the "route" command or the newer "ip route" command. They display the current routing entries and routing information.
  • Q84: How do you add a user in Linux?
    A: You can add a user in Linux using the "useradd" command. For example, "useradd username" creates a new user with the specified username.
  • Q85: How do you remove a user in Linux?
    A: You can remove a user in Linux using the "userdel" command. For example, "userdel username" removes the user with the specified username.
  • Q86: How do you change the password for a user in Linux?
    A: You can change the password for a user in Linux using the "passwd" command. For example, "passwd username" allows you to change the password for the specified username.
  • Q87: How do you switch to another user in Linux?
    A: You can switch to another user in Linux using the "su" command. For example, "su username" allows you to switch to the user with the specified username.
  • Q88: How do you create a new group in Linux?
    A: You can create a new group in Linux using the "groupadd" command. For example, "groupadd groupname" creates a new group with the specified groupname.
  • Q89: How do you add a user to a group in Linux?
    A: You can add a user to a group in Linux using the "usermod" command. For example, "usermod -aG groupname username" adds the user to the specified group.
  • Q90: How do you change the ownership of a file or directory in Linux?
    A: You can change the ownership of a file or directory in Linux using the "chown" command. For example, "chown newowner file.txt" changes the owner of the file to the specified newowner.
  • Q91: How do you change the group ownership of a file or directory in Linux?
    A: You can change the group ownership of a file or directory in Linux using the "chgrp" command. For example, "chgrp newgroup file.txt" changes the group ownership of the file to the specified newgroup.
  • Q92: How do you find files in a directory based on their name in Linux?
    A: You can find files in a directory based on their name in Linux using the "find" command. For example, "find /path/to/directory -name filename" searches for files with the specified filename in the specified directory.
  • Q93: How do you find files in a directory based on their type in Linux?
    A: You can find files in a directory based on their type in Linux using the "find" command. For example, "find /path/to/directory -type f" searches for regular files in the specified directory.
  • Q94: What is the purpose of the "du" command in Linux?
    A: The "du" command is used to estimate file and directory space usage in Linux. It provides information about the disk space occupied by files and directories.
  • Q95: How do you compress files and directories into a ZIP archive in Linux?
    A: You can compress files and directories into a ZIP archive in Linux using the "zip" command. For example, "zip archive.zip file1 file2" creates a ZIP archive named "archive.zip" containing "file1" and "file2".
  • Q96: How do you extract files from a ZIP archive in Linux?
    A: You can extract files from a ZIP archive in Linux using the "unzip" command. For example, "unzip archive.zip" extracts all files from the ZIP archive "archive.zip".
  • Q97: How do you compress files and directories into a tarball in Linux?
    A: You can compress files and directories into a tarball in Linux using the "tar" command with the appropriate compression option. For example, "tar -czvf archive.tar.gz file1 file2" creates a compressed tarball named "archive.tar.gz" containing "file1" and "file2".
  • Q98: How do you extract files from a tarball in Linux?
    A: You can extract files from a tarball in Linux using the "tar" command. For example, "tar -xzvf archive.tar.gz" extracts all files from the compressed tarball "archive.tar.gz".
  • Q99: What is the purpose of the "nohup" command in Linux?
    A: The "nohup" command is used to run a command or a script immune to hangups. It allows the command to continue running even if the user logs out or the terminal is closed.
  • Q100: How do you check the system process tree in Linux?
    A: You can check the system process tree in Linux using the "pstree" command. It displays the hierarchical structure of processes running on the system.