Linux PastghvhjPapers Solution

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 19

Answer the following in detail.

(10 Marks Each)


1. Explain Linux File System Hierarchy (Linux Directory Structure) with diagram.
Ans.
2. Write a procedure to install Linux Operating System.
Ans. Please refer Practical No 1.
3. Explain cp, mv, ls and rm commands with options and examples.
Ans.
4. Define process. Explain any four process states.
Ans.

Answer the following in detail. (5 Marks Each)


1. Explain any three basic Linux commands with options and examples.
Ans.
2. Write a note on VIM Editor.
Ans.
3. What is the use of tar command? Explain with options and examples.
Ans.
4. Explain the working of rpm command with various options and examples.
Ans.
5. Explain useradd and userdel commands with options and examples.
Ans.
6. Write a note on init levels (run levels) in Linux.
Ans.
A run level is a state of init and the whole system defines what system services are operating. Run
levels are identified by numbers. Runlevel is a mode or state in which a Linux system operates. It
has a crucial role in the management of the Linux System.
Whenever a LINUX system boot, firstly the init process is started which is actually responsible for
running other start scripts which mainly involves initialization of your hardware, bringing up the
network, and starting the graphical interface.
Now, the init first finds the default runlevel of the system so that it can run the start scripts
corresponding to the default run level.
A runlevel can simply be thought of as the state your system enters like if a system is in a single-
user mode it will have a runlevel 1 while if the system is in a multi-user mode, it will have a
runlevel 5.
A runlevel, in other words, can be defined as a preset single-digit integer for defining the operating
state of your LINUX or UNIX-based operating system. Each runlevel designates a different system
configuration and allows access to different combinations of processes.
The standard LINUX kernel supports these seven different runlevels:
7. What is the Daemons in Linux?
Ans.
A daemon is a program with a unique purpose. They are utility programs that run silently
in the background to monitor and take care of certain subsystems to ensure that the operating
system runs properly. A printer daemon monitors and takes care of printing services. A network
daemon monitors and maintains network communications, and so on.
Daemons perform certain actions at predefined times or in response to certain events. There
are many daemons that run on a Linux system, each specifically designed to watch over its own
little piece of the system, and because they are not under the direct control of a user, they are
effectively invisible, but essential. Because daemons do the bulk of their work in the background,
they can appear a little mysterious and so, perhaps difficult to identify them and what they actually
do.
To identify a daemon, look for a process that ends with the letter d. It’s a general Linux
rule that the names of daemons end this way.
There are many ways to catch a glimpse of a running daemon. They can be seen in process
listings through ps, top, or htop. These are useful programs in their own right – they have a specific
purpose, but to see all of the daemons running on your machine, the pstree command will suit our
discussion better.
The pstree command is a handy little utility that shows the processes currently running on
your system and it show them in a tree diagram.
In Linux, there are three types of processes: interactive, batch and daemon.

8. Explain head and tail command with example.


Ans.
9. Explain su command with example.
Ans.
The su command allows you to run a shell as another user.
Syntax:
su <username>
Example:
su jtp
user account is changed to jtp.

su to root
You can change the user to root when you know the root password.
Syntax:
su root
su as root
The root user can become any existing user without knowing that user's password. Otherwise,
password is needed.
Example:
su – sssit
su -
If any user name is not mentioned then by default, it will assume root as the target user.

10. Write a procedure to create data partition in Linux?


Ans.
11. Explain the following commands with options and examples; a) df b) du
Ans.

Answer the following. (2 Marks Each)


1. State the advantages of Linux.
Ans.
There are many features of the Linux operating system that demonstrate that it is better
than other operating systems.

1. pen Source: As it is open-source, its source code is easily available. Anyone having
programming knowledge can customize the operating system. One can contribute, modify,
distribute, and enhance the code for any purpose.

2. Security: The Linux security feature is the main reason that it is the most favorable option for
developers. It is not completely safe, but it is less vulnerable than others. Each application needs
to authorize by the admin user. The virus is not executed until the administrator provides the access
password. Linux systems do not require any antivirus program.

3. Free: Certainly, the biggest advantage of the Linux system is that it is free to use. We can easily
download it, and there is no need to buy the license for it. It is distributed under GNU GPL (General
Public License). Comparatively, we have to pay a huge amount for the license of the other
operating systems.

4. Lightweight: Linux is lightweight. The requirements for running Linux are much less than other
operating systems. In Linux, the memory footprint and disk space are also lower. Generally, most
of the Linux distributions required as little as 128MB of RAM around the same amount for disk
space.

5. Stability: Linux is more stable than other operating systems. Linux does not require to reboot
the system to maintain performance levels. It rarely hangs up or slow down. It has big up-times.

6. Performance: Linux system provides high performance over different networks. It is


capable of handling a large number of users simultaneously.

7. Flexibility: Linux operating system is very flexible. It can be used for desktop applications,
embedded systems, and server applications too. It also provides various restriction options for
specific computers. We can install only necessary components for a system.

8. Software Updates: In Linux, the software updates are in user control. We can select the required
updates. There a large number of system updates are available. These updates are much faster than
other operating systems. So, the system updates can be installed easily without facing any issue.

9. Distributions/ Distros: There are many Linux distributions available in the market. It provides
various options and flavors of Linux to the users. We can choose any distros according to our
needs. Some popular distros are Ubuntu, Fedora, Debian, Linux Mint, Arch Linux, and many
more. For the beginners, Ubuntu and Linux Mint would be useful and, Debian and Fedora would
be good choices for proficient programmers.

10. Live CD/USB: Almost all Linux distributions have a Live CD/USB option. It allows us to try
or run the Linux operating system without installing it.

2. List different shells used in Linux.


Ans.
3. List different Linux flavors. (Names)
Ans.
Ubuntu
Red Hat Enterprise Linux
Fedora
openSUSE
Debian
Arch Linux

4. List special file permissions used in Linux.


Ans.
user + s
group + s
other + t
5. List different process states in Linux.
Ans.
Running
Sleeping
Sleeping uninterruptible
Zombie

6. What is the use of pipes in Linux? Explain with example.


Ans.
The pipe is used to combine two or more commands, and in this, the output of one
command acts as input to another command, and this command’s output may act as input to the
next command, and so on. It can also be visualized as a temporary connection between two or
more commands/ programs/ processes. The command line programs that do the further processing
are referred to as filters.
List all files and directories and give them as input to `grep` command using piping in Linux
ls | grep file.txt

7. What are the signals in Linux?


Ans.

8. State the purpose of swap file in Linux.


Ans.
A swap file in Linux is a file on your hard disk that the Linux kernel uses to store variable data of
the applications running on your computer. A process known as swapping is responsible for
transferring the data to a swap file when the Random Access Memory (RAM) doesn't suffice.
9. What is use of /tmp directory.
Ans.

*****************************************************************************

You might also like