Linux Administration, Semester 4(2020), Model examination, July 2022
SAINTGITS COLLEGE OF APPLIED SCIENCES
PATHAMUTTOM, KOTTAYAM
Model Examination, July 2022
PG Department of Computer Applications and Artificial Intelligence, Semester 4
LINUX ADMINISTRATION
Total : 80 marks Time: 3 hours
Section A
Answer any 6 questions. Each question carries 3 marks.
(Write in not less than a paragraph)
1. What do you mean by open source?
Free and open-source software (FOSS) is software that is both free software and
open-source software where anyone is freely licensed to use, copy, study, and change the
software in any way, and the source code is openly shared so that people are encouraged to
voluntarily improve the design of the software.
2. What is rmdir command ?
rmdir command is used remove empty directories from the file system in Linux.
The rmdir command removes each and every directory specified in the command line only if
these directories are empty. So if the specified directory has some directories or files in it
then this cannot be removed by rmdir command
3. What is wc command?
The wc command stands for “word count” and has a quite simple syntax. It allows us to
count the number of lines, words, bytes, and characters in one or multiple text files. The wc
command in LINUX is a command line utility for printing newline, word and byte
counts for files. It can return the number of lines in a file, the number of characters in a
file and the number of words in a file. It can also be combine with pipes for general counting
operations.
4. Define shell keywords?
Keywords are the words whose meaning has already been explained to the shell.the
keywords cannot be used as variable names because of it is a reserved words with
containing reserved meaning.
Eg:
L E A R N . G R O W . E X C E L
echo read set unset
readonly shift export
5. What is the use of read command?
The read command reads one line from standard input and assigns the values of
each field in the input line to a shell variable using the characters in the IFS
(Internal Field Separator) variable as separators.
Example
6. Write any two file test operators.
-e: Returns true value if file exists.
-f: Return true value if file exists and regular file.
-r: Return true value if file exists and is readable.
-w: Return true value if file exists and is writable.
-x: Return true value if file exists and is executable.
-d: Return true value if exists and is a directory.
7. What is su command?
The su command switch the current user to any other user. If you need to run a command
as a different (non-root) user, use the –l [username] option to specify the user account.
Additionally, su can also be used to change to a different shell interpreter on the fly.
8. Define the term root user.
Root is the super user account in Unix and Linux. It is a user account for
administrative purposes, and typically has the highest access rights on the system. Usually,
the root user account is called root
9. Write three permission modes for user files and directories?
Files and directories can have three types of permissions: read, write, and execute:
Someone with read permission may read the contents of a file, or list the contents of a
directory. Someone with write permission may modify the contents of a file, including
adding, changing, or deleting file contents
10. What is mkfs command?
L E A R N . G R O W . E X C E L
The mkfs command stands for “make file system” is utilized to make a file system (which
is, a system for organizing a hierarchy of directories, subdirectories, and files) on a
formatted storage device usually, a partition on a hard disk drive (HDD) or it can also be a
USB drive, etc
11. What is DNS.
DNS (Domain Name System) is a fundamental facilitator of several networking
technologies such as mail servers, Internet browsing, and streaming services e.g. Netflix and
Spotify, among others. DNS(Domain Naming System) is an internet service that
translates the domain name to IP address that is understandable by the
computer. For example, the domain name www.domainsystem.com might translate to
198.105. 232.4. This process is the backbone of the internet and very important in the
server.
12. Differentiate grep and egrep.
The difference between grep and egrep is that the grep is a command that allows searching
content according to the given regular expression and displaying the matching lines while
egrep is a variant of grep that allows to search content by applying extended regular
expressions to display the machining lines
(6 x 3 = 18 Marks)
Section B
Answer any 4 questions. Each question carries 8 marks.
(Write in not less than 2 pages)
13. Write a note on Linux architecture.
Architecture of Linux system
The Linux operating system's architecture mainly contains some of the components: the
Kernel, System Library, Hardware layer, System, and Shell utility.
1. Kernel:- The kernel is one of the core section of an operating system. It is responsible
for each of the major actions of the Linux OS. This operating system contains distinct types
of modules and cooperates with underlying hardware directly. The kernel facilitates
required abstraction for hiding details of low-level hardware or application programs to the
system. There are some of the important kernel types which are mentioned below:
L E A R N . G R O W . E X C E L
o Monolithic Kernel
o Micro kernels
o Exo kernels
o Hybrid kernels
2. System Libraries:- These libraries can be specified as some special functions. These are
applied for implementing the operating system's functionality and don't need code access
rights of the modules of kernel.
3. System Utility Programs:- It is responsible for doing specialized level and individual
activities.
4. Hardware layer:- Linux operating system contains a hardware layer that consists of
several peripheral devices like CPU, HDD, and RAM.
5. Shell:- It is an interface among the kernel and user. It can afford the services of kernel. It
can take commands through the user and runs the functions of the kernel. The shell is
available in distinct types of OSes. These operating systems are categorized into two
different types, which are the graphical shells and command-line shells.
14. Explain different process scheduling commands in Linux.
L E A R N . G R O W . E X C E L
Process Scheduling is an important activity performed by the process manager of the
respective operating system. Scheduling in Linux deals with the removal of the current
process from the CPU and selecting another process for execution.
● at,batch,cron tab,kill commands with example.
15. Explain different mathematical commands in Linux.
Using expr Command
The expr command evaluates expressions and prints the value of provided
expression to standard output. We will look at different ways of using expr for doing
simple math, making comparison, incrementing the value of a variable and finding
the length of a string.
The factor command
As is clear by the name, the factor command in Linux is used to calculate the value
of factors of a number we provide.
Syntax:
$ factor number
The bc command
The bc command is very useful when performing complex operations in the bash.
This command can also make comparisons, handle Booleans, and calculate square
roots, sines, cosines, and tangents, etc. All you need to do is that you pipe the
mathematical expression to the bc command as follows:
$ echo “math_expression” | bc
The output then displays the result of the mathematical expression.
Example:
$ echo "10+10/2-(2*2)" | bc
L E A R N . G R O W . E X C E L
16. Write a program to read n numbers using array.
Program with array concept
17. Write syntax of for loop statement in Linux. Write one example program using for
loop statement.
syntax
for var in 0 1 2 3 4 5 6 7 8 9
do
echo $var
done
for a in 1 2 3 4 5 6 7 8 9 10
do
# if a is equal to 5 break the loop
if [ $a == 5 ]
then
break
fi
# Print the value
echo "Iteration no $a"
done
18. Explain different shell variables.
A shell variable is a variable that is available only to the current shell. In contrast, an
environment variable is available system wide and can be used by other applications on the
system.
Variable Types
When a shell is running, three main types of variables are present −
● Local Variables − A local variable is a variable that is present within the current
instance of the shell. It is not available to programs that are started by the shell. They
are set at the command prompt.
● Environment Variables − An environment variable is available to any child process
of the shell. Some programs need environment variables in order to function
L E A R N . G R O W . E X C E L
correctly. Usually, a shell script defines only those environment variables that are
needed by the programs that it runs.
● Shell Variables − A shell variable is a special variable that is set by the shell and is
required by the shell in order to function correctly. Some of these variables are
environment variables whereas others are local variables.
19. Write a note configuration files.
A configuration file, also known as a config file, is a local file that controls the
operations of a program, utility or process. Linux configuration files contain the
settings and instructions for different systems, utilities, applications and processes.
20. What are the roles of system administrator?
Duties of a Linux Administrator:
System Administration has become a solid criterion for an organization and institute that
requires a solid IT foundation. Hence, the need for efficient Linux administrators is the
requirement of the time. The job profile might change from each organization as there may
be added responsibilities and duties to the role. Below are some duties of a Linux
Administrator:
● Maintain all internet requests inclusive to DNS, RADIUS, Apache, MySQL, PHP.
● Taking regular back up of data, create new stored procedures and listing back-up is one
of the duties.
● Analyzing all error logs and fixing along with providing excellent customer support for
Webhosting, ISP and LAN Customers on troubleshooting increased support troubles.
● Communicating with the staff, vendors, and customers in a cultivated, professional
manner at all times has to be one of his characteristics.
● Enhance, maintain and creating the tools for the Linux environment and its users.
● Detecting and solving the service problems ranging from disaster recovery to login
problems.
● Installing the necessary systems and security tools. Working with the Data Network
Engineer and other personnel/departments to analyze hardware requirements and
makes acquiring recommendations.
● Troubleshoot, when the problem occurs in the server.
21. Write a note on Apache Server.
L E A R N . G R O W . E X C E L
● Apache HTTP Server is a free and open-source web server that delivers web
content through the internet. It is commonly referred to as Apache and after
development, it quickly became the most popular HTTP client on the web.
● Advantages and disadvantages
● Apache is considered open source software, which means the original source code is
freely available for viewing and collaboration. Being open source has made Apache
very popular with developers who have built and configured their own modules to
apply specific functionality and improve on its core features.
● One of the pros of Apache is its ability to handle large amounts of traffic with
minimal configuration. It scales with ease and with its modular functionality at its
core, you can configure Apache to do what you want, how you want it. You can also
remove unwanted modules to make Apache more lightweight and efficient.
(4 x 8 = 32 Marks)
Section C
Answer up to 3 questions carrying 15 marks each. However, total marks for this
section should not exceed 30 marks. Marks scored over 30 will be ignored
22. Explain Linux file system in detail.
A Linux file system is a structured collection of files on a disk drive or a partition. A
partition is a segment of memory and contains some specific data. In our machine,
there can be various partitions of the memory. Generally, every partition contains a
file system.
Linux file system contains two-part file system software implementation architecture.
Consider the below image:
L E A R N . G R O W . E X C E L
In Linux, the file system creates a tree structure. All the files are arranged as a tree
and its branches. The topmost directory called the root (/) directory. All other
directories in Linux can be accessed from the root directory.
o Specifying paths: Linux does not use the backslash (\) to separate the components; it
uses forward slash (/) as an alternative. For example, as in Windows, the data may
be stored in C:\ My Documents\ Work, whereas, in Linux, it would be stored in /home/
My Document/ Work.
o Partition, Directories, and Drives: Linux does not use drive letters to organize the drive
as Windows does. In Linux, we cannot tell whether we are addressing a partition, a
network device, or an "ordinary" directory and a Drive.
o Case Sensitivity: Linux file system is case sensitive. It distinguishes between
lowercase and uppercase file names. Such as, there is a difference between test.txt
and Test.txt in Linux. This rule is also applied for directories and Linux commands.
o File Extensions: In Linux, a file may have the extension '.txt,' but it is not necessary
that a file should have a file extension. While working with Shell, it creates some
problems for the beginners to differentiate between files and directories. If we use the
graphical file manager, it symbolizes the files and folders.
o Hidden files: Linux distinguishes between standard files and hidden files, mostly the
configuration files are hidden in Linux OS. Usually, we don't need to access or read
the hidden files. The hidden files in Linux are represented by a dot (.) before the file
name (e.g., .ignore). To access the files, we need to change the view in the file
manager or need to use a specific command in the shell.
L E A R N . G R O W . E X C E L
Types of Linux File System
When we install the Linux operating system, Linux offers many file systems such
as Ext, Ext2, Ext3, Ext4, JFS, ReiserFS, XFS, btrfs, and swap.
Boot block,super block,inode block,data block
23. Differentiate background and foreground processes with related commands.
1. Background processes typically run with little or no user interaction, they interact
with the system instead. Foreground processes are what the user interacts with.
2. Background processes, unless explicitly ran so, run with non-admin permissions.
This is also called batch processing.
3. A foreground process has access to the terminal (standard input and output),
while the background process does not.
4. A background process runs without being connected to your keyboard. If the
background process requires any keyboard input, it waits.
The basic advantage of background processing is that it allows the system to run
other commands; the processor does not have to wait until it completes one task to
start another. This provides the ability to have multiple applications executing at the
same time. For example, a user can play a game with one application while another
L E A R N . G R O W . E X C E L
application is playing a song. To the developer, the advantage of multitasking gives
the ability to create tools and applications which use more than one process and to
create processes that use multiple threads of execution.
24. Explain various shells and shell programming in bash.
SHELL is a program which provides the interface between the user and an
operating system. When the user logs in OS starts a shell for user.
Types of Shell:
The C Shell –
Denoted as csh
Bill Joy created it at the University of California at Berkeley. It incorporated
features such as aliases and command history. It includes helpful programming
features like built-in arithmetic and C-like expression syntax.
The Bourne Shell –
Denoted as sh
It was written by Steve Bourne at AT&T Bell Labs. It is the original UNIX
shell. It is faster and more preferred. It lacks features for interactive use like
the ability to recall previous commands. It also lacks built-in arithmetic and
logical expression handling. It is default shell for Solaris OS.
The Korn Shell
It is denoted as ksh
It Was written by David Korn at AT&T Bell LabsIt is a superset of the Bourne
shell.So it supports everything in the Bourne shell.It has interactive features.
It includes features like built-in arithmetic and C-like arrays, functions, and
string-manipulation facilities.It is faster than C shell. It is compatible with
script written for C shell.
etc
25. List out various filter commands with example.
1.Awk Command
Awk is a remarkable pattern scanning and processing language, it can be used to build useful
filters in Linux.
2. Sed Command
sed is a powerful stream editor for filtering and transforming text.
3. Grep, Egrep, Fgrep, Rgrep Commands
These filters output lines matching a given pattern. They read lines from a file or standard
input, and print all matching lines by default to standard output.
L E A R N . G R O W . E X C E L
-
4. head Command
head is used to display the first parts of a file, it outputs the first 10 lines by default. You
can use the -n num flag to specify the number of lines to be displayed:
/ Learn how to use head command with tail and cat commands for effective usage in Linux.
5. tail Command
tail outputs the last parts (10 lines by default) of a file. Use the -n num switch to specify the
number of lines to be displayed.
6. sort Command
sort is used to sort lines of a text file or from standard input.
▪
7. uniq Command
uniq command is used to report or omit repeated lines, it filters lines from standard input
and writes the outcome to standard output.
After running sort on an input stream, you can remove repeated lines with uniq
3.linuxsay.com
4.windowsmint.com
9. pr Command
pr command converts text files or standard input for printing.
10. tr Command
This tool translates or deletes characters from standard input and writes results to standard
output.
11. more Command
more command is a useful file perusal filter created basically for certificate viewing
12. less Command
L E A R N . G R O W . E X C E L
Comments
Post a Comment