0% found this document useful (0 votes)
6 views11 pages

Linux Chap

Diptanu

Uploaded by

diptanujhuma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views11 pages

Linux Chap

Diptanu

Uploaded by

diptanujhuma
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 11

2-Mark Questions (20 questions)

1. Differentiate between absolute and relative paths in Linux.


o Answer: Absolute paths start from the root directory (/), while relative paths
start from the current working directory .
2. What is the purpose of the /etc/hosts fi?
o Answer: It is used to map hostnames to IP addresses, acting as a local DNS .

3. What are the three types of file permissions in Linu Answer: Read, write, and execute .
4. What is the purpose of the chmod command in Linux?
o Answer: The chmod command is used to change the file permissions for read,
write, and execute access for the owner, group, and others.
5. Explain the function of the ls -l command in Linux.
o Answer: The ls -l command lists files in a directory along with detailed
information, including file permissions, owner, group, size, and modification
date.
6. What is the use of the sudo command in Linux?
o Answer: The sudo command allows a permitted user to execute a command as
the superuser or another user, as specified by the security policy.
7. Differentiate between hard and soft links in Linux.
o Answer: A hard link points directly to the file's inode and is indistinguishable
from the original file, while a soft link (or symbolic link) points to the file
name and can break if the original file is moved or deleted.
8. What is the df command used for in Linux?
o Answer: The df command displays the amount of disk space used and
available on the mounted file systems.
9. What is the significance of the /var directory in Linux?
o Answer: The /var directory contains variable files, such as logs, mail spools,
and temporary files, that frequently change during system operation.
10. What does the ps command do in Linux?

 Answer: The ps command displays the current running processes on the system,
showing details like process IDs and resource usage.

11. What is a package manager, and why is it essential in Linux?

 Answer: A package manager automates the process of installing, upgrading,


configuring, and removing software packages, ensuring that all dependencies are
handled properly.

12. Explain the purpose of the man command in Linux.

 Answer: The man command displays the user manual for any command, providing
details about its usage, options, and functionality.

13. What is the function of the /etc/passwd file in Linux?

 Answer: The /etc/passwd file stores essential information about system users,
including their usernames, user IDs, home directories, and default shells.
14. What does the top command show in Linux?

 Answer: The top command provides a real-time view of the running processes, along
with system resource usage such as CPU and memory.

15. How does Linux handle software dependencies during installation?

 Answer: Linux uses package managers like apt and yum to automatically resolve
software dependencies, installing required libraries and packages along with the main
software.

16. What is a shell in Linux, and give two examples of common shells?

 Answer: A shell is a command-line interpreter that provides the user interface to


interact with the operating system. Common examples are Bash and Zsh.

17. What is the grep command used for in Linux?

 Answer: The grep command searches for specific patterns in files and outputs the
lines that contain the matching patterns.

18. Explain the difference between the cp and mv commands in Linux.

 Answer: The cp command copies files or directories, while the mv command moves or
renames files and directories.

19. What is the crontab command used for?

 Answer: The crontab command is used to schedule tasks (cron jobs) to be run
automatically at specified times and intervals.

20. How can you check the current working directory in Linux?

 Answer: You can use the pwd command to display the current working directory.
3-Mark Qu questions)

1. Explain the significance of the root user in Linux.


o Answer: The root user, or superuser, has complete control over the system and
can execute any commands, modify any files, and change system
configurations .
2. How does Linux handle software installation?
o Answer: Linux usesnagers like apt-get in Debian-based systems and yum in
Red Hat-based systems to install, upgrade, and remove software packages .

4. Explain the significance of the /home directory in Linux.


o Answer: The /home directory contains user-specific directories, where each
user's personal files, configurations, and data are stored. It isolates user
environments and allows for personalized settings and privacy.
5. Describe the process of changing file ownership in Linux.
o Answer: File ownership in Linux can be changed using the chown command.
The syntax is chown <owner>:<group> <file_name>. The owner and group
can be changed together or separately. Only root or the file's owner can
change ownership.
6. How does the tar command work, and when would you use it?
o Answer: The tar command is used to archive multiple files into a single file
(often with .tar extension). It can also compress archives with the -z option
for gzip or -j for bzip2. This is useful for creating backups or transferring
multiple files.
7. Explain the role of the /etc/fstab file in Linux.
o Answer: The /etc/fstab file contains static information about file systems. It
defines how disk partitions, devices, and network shares are automatically
mounted at boot time. It also specifies mount options like read-only or read-
write.
8. Describe the difference between the apt-get update and apt-get upgrade
commands in Linux.
o Answer: apt-get update updates the package lists from repositories but does
not install any updates, while apt-get upgrade actually upgrades the
installed packages to their latest versions based on the updated lists.
9. What are environment variables, and how are they used in Linux?
o Answer: Environment variables store information that can affect the behavior
of processes and applications. They are used to pass configuration details like
the user path ($PATH), home directory ($HOME), and language settings. They
can be viewed using printenv and modified with export.
10. Explain the steps involved in partitioning a disk using the fdisk command.

 Answer: The fdisk command is used to create, delete, or modify partitions on a hard
disk. Steps include:

1. Start fdisk with the disk name (e.g., fdisk /dev/sda).


2. Use the n command to create a new partition.
3. Define the partition type (primary or extended).
4. Save changes with the w command and exit.
5. How does the rsync command function in Linux?

 Answer: The rsync command is used for fast and efficient file synchronization
between directories or across networked systems. It transfers only the changed parts
of files, reducing the amount of data transferred. It’s commonly used for backups and
file transfers.

12. What is a runlevel in Linux, and how is it managed?

 Answer: Runlevels define the state of the machine, such as whether the system is
running in single-user mode, multi-user mode, or graphical mode. They are managed
by systemctl in modern systems (replacing init) and can be set using commands
like systemctl set-default.

13. Describe the process of configuring a static IP address in Linux.

 Answer: To configure a static IP, edit the network configuration file, such as
/etc/network/interfaces (Debian) or
/etc/sysconfig/network-scripts/ifcfg-<interface> (RHEL). Specify
parameters like IP address, subnet mask, gateway, and DNS, then restart the network
service for changes to take effect.

14. Explain the function of the /var/log directory in Linux.

 Answer: The /var/log directory stores log files for various system and application
processes. It includes important logs like syslog for system events, auth.log for
authentication attempts, and dmesg for kernel messages, which are crucial for
troubleshooting.

15. What are the key differences between the Bash and Zsh shells?

 Answer: Bash is the default shell for most Linux distributions and is widely
supported. Zsh includes many features like advanced tab completion, spell-checking,
and theme support, making it more customizable and user-friendly. Zsh also supports
better scripting capabilities.

16. Explain the function of the crontab file and how you can use it to schedule tasks.

 Answer: The crontab file is used to schedule recurring tasks in Linux. Each line in
crontab specifies a command and the time it should run (minute, hour, day of the
month, month, day of the week). Crontab can be edited using crontab -e, and
scheduled jobs are executed by the cron daemon.

17. What is the significance of the /boot directory in Linux?

 Answer: The /boot directory contains the files required to boot the Linux operating
system, such as the kernel, initial RAM disk image (initrd), and bootloader files
(e.g., GRUB). It is essential for system startup.

18. How do file permissions affect security in Linux?

 Answer: File permissions in Linux determine who can read, write, or execute a file.
Properly configured permissions limit access to sensitive data, reducing the risk of
accidental or malicious changes. The three permission sets—owner, group, and others
—allow for granular control.

19. Describe the process of creating a user in Linux using the useradd command.

 Answer: To create a user in Linux, use the useradd <username> command. You can
specify additional options like home directory (-d), shell (-s), and user ID (-u). After
creating the user, use passwd <username> to set the user’s password.

20. What is the role of the sudoers file in Linux?

 Answer: The /etc/sudoers file configures which users or groups are allowed to
execute commands with elevated privileges (sudo). It defines specific commands that
users can run as root or another user. Editing this file requires using visudo to prevent
syntax errors.

4 marks(10 questions ) from unit 3 with answers


4-Mark Questions (10 questioncribe the Linux file system structure and its
key components.**

 Answer: Linux uses a hierarchical file structure with the root directory ("/") at the top.
Key directories include /bin for binaries, /etc for configuration files, /home for user
directories, and /var for logs .

2. What is the role of file permissions in Linux, and how are they assigned?
o Answer: Fions in Linux control the actions users can perform on files and
directories. They are assigned using the chmod command, and are typically
divided into read (r), write (w), and execute (x) permissions .

You might also like