Linux Lab Manual (AD-505)
Linux Lab Manual (AD-505)
IT & AIDS
Year/Sem : III/V
5 Create a file called wlcc.txt with some lines and display how many
lines, words and characters are present in that file.
6 Append ten more simple lines to the wlcc.txt file created above and
split the appended file into 3 parts. What will be the names of these
split files? Display the contents of each of these files. How many lines
will be there on the last file?
8 Create a program to find out the inode number of any desired file.
12 Write a shell script that accepts any number of arguments and prints
them in the reverse order.
13 Write a shell script to find the smallest of three numbers that are
read from the keyboard.
4. Study & use of commands for performing arithmetic operations with Unix/Linux.
5. Create a file called wlcc.txt with some lines and display how many lines, words and
characters are present in that file.
6. Append ten more simple lines to the wlcc.txt file created above and split the appended
file into 3 parts. What will be the names of these split files? Display the contents of each
of these files. How many lines will be there on the last file?
7. Given two files each of which contains names of students. Create a program to display
only those names that are found on both the files.
8. Create a program to find out the inode number of any desired file.
10. Write a pipeline of commands, which displays on the monitor as well as saves the
information about the number of users using the system.
12. Write a shell script that accepts any number of arguments and prints them in the reverse
order
13. Write a shell script to find the smallest of three numbers that are read from the
keyboard.
EXPERIMENT NO. 1
Unit/Topic: 1/ Introduction
PROBLEM DEFINITION:
Introduction to Unix/Linux operating system
OBJECTIVE:
To understand the basics of Unix/Linux.
THEORY INVOLVED:
NAME OF FACULTY:
SIGNATURE:
DATE:
EXPERIMENT NO. 2
EXPERIMENT NO. 2
Unit/Topic: 7/ Installation
PROBLEM DEFINITION:
Installation, Configuration & Customizations of Unix/Linux.
OBJECTIVE:
To understand the Installation, Configuration & Customizations of Unix/Linux.
THEORY INVOLVED:
Q.1 How will you get the details about Ubuntu in computer?
Q.2 What do you Mean by Swap space partition and why swapping is required?
Q.3 What are the different types of OS ?
NAME OF FACULTY:
SIGNATURE:
DATE:
EXPERIMENT NO. 3
EXPERIMENT NO. 3
OBJECTIVE:
To understand the use of basic commands.
THEORY INVOLVED:
UNIX commands can often be grouped together to make even more powerful commands.
Unix General Purpose commands: date, who, who am I,cal,echo.
INPUT SET:
OUTPUT SET:
NAME OF FACULTY:
SIGNATURE:
DATE:
EXPERIMENT NO. 4
EXPERIMENT NO. 4
OBJECTIVE:
Implementation of arithmetic commands.
THEORY INVOLVED:
1. Log in to the system
2. Open Ubuntu terminal
3. Type bc
The most basic element in bc is the number. BC stands for “Basic calculator” Numbers are arbitrary
precision numbers. This precision is both in the integer part and the fractional part. All numbers are
represented
internally in decimal and all computation is done in decimal.
INPUT SET:
OUTPUT SET:
NAME OF FACULTY:
SIGNATURE:
DATE:
EXPERIMENT NO. 5
EXPERIMENT NO. 5
OBJECTIVE:
To implement commands of file system.
THEORY INVOLVED:
wc (Stands for word count) is a command in Unix-like operating systems.
The program reads either standard input or a list of files and generates one or more of the following
statistics: newline count, word count, and byte count.
Syntax:
wc <filename>
Options:
INPUT SET:
OUTPUT SET:
NAME OF FACULTY:
SIGNATURE:
DATE:
EXPERIMENT NO. 6
EXPERIMENT NO. 6
THEORY INVOLVED:
Split is a UNIX utility most commonly used to split a file into two or more smaller files.
The command-syntax is: split [option] [Input] [Prefix]
The default behavior of split is to generate output files of a fixed size, default 1000 lines. The files are
named by appending aa, ab, ac, etc. to output filename. If the output filename is not given, the default
filename of x is used, for example, xaa, xab, etc. When a hyphen (-) is used instead of input filename,
data is derived from standard input .
INPUT SET:
OUTPUT SET:
NAME OF FACULTY:
SIGNATURE:
EXPERIMENT NO. 7
DATE:
EXPERIMENT NO. 8
EXPERIMENT NO. 7
Unit/Topic: 3/ Comparing file
PROBLEM DEFINITION:
Given two files each of which contains names of students.Create a program to display only those names
that are found on both the files..
OBJECTIVE:
To understand the concept of comparing files.
THEORY INVOLVED:
Comm : Compare two sorted files line-by-line.
Syntax :Comm [option] ... File 1 file 2
Compare sorted files FILE1 and FILE2 line-by-line. With no options, comm produces three-column
output. Column one contains lines unique to FILE1, column two contains lines unique to FILE2, and
column three contains lines common to both files. Each of these columns can be suppressed
individually with options.
Options
-1 suppress column 1 (lines unique to FILE1)
-2 suppress column 2 (lines unique to FILE2)
-3 suppress column 3 (lines that appear in both files)
INPUT SET:
OUTPUT SET:
NAME OF FACULTY:
SIGNATURE:
DATE:
EXPERIMENT NO. 9
EXPERIMENT NO. 8
Unit/Topic: 1/ Introduction
PROBLEM DEFINITION:
Create a program to find out inode number of any desired file.
OBJECTIVE:
To understand the basics of Unix/Linux.
THEORY INVOLVED:
In basic words, an Inode number is just like an index number of a book. You may quickly locate the chapters
you wish to read by browsing the index page. You won’t be able to discover the proper information without an
index page, and you’ll have to go through the entire book to find a certain subject, which is a complete waste
of time. The same applies to inodes in Linux. An inode is a data structure that points refer to the individual
blocks, making the file. All of the administrative data required to read a file is included in the inode. The
metadata for each file is kept in inodes in a table structure and this data includes:
NAME OF FACULTY:
SIGNATURE:
DATE:
EXPERIMENT NO.
10
EXPERIMENT NO. 9
Unit/Topic: 1/ Introduction
PROBLEM DEFINITION:
OBJECTIVE:
THEORY INVOLVED:
Note that “r” is for read, “w” is for write, and “x” is for execute. This only changes the permissions for the
owner of the file.
Q.1 Which commad is used to find out file permission of any file.
NAME OF FACULTY:
SIGNATURE:
EXPERIMENT NO.
DATE: 11
EXPERIMENT NO. 10
Unit/Topic: 1/ Introduction
PROBLEM DEFINITION:
Write a pipeline commands which display on the monitor as well as saves the
information about number of users using the system.
OBJECTIVE:
THEORY INVOLVED:
Q.2 How can we get number of users on any system by using pipeline command.
NAME OF FACULTY:
SIGNATURE:
DATE:
EXPERIMENT NO.
12
EXPERIMENT NO. 11
Unit/Topic: 1/ Introduction
PROBLEM DEFINITION:
OBJECTIVE:
THEORY INVOLVED:
Q.2 How can we get number of users on any system by using pipeline command.
NAME OF FACULTY:
SIGNATURE:
DATE:
EXPERIMENT NO.
13
EXPERIMENT NO. 12
Unit/Topic: 1/ Introduction
PROBLEM DEFINITION:
Write a shell script that accepts any number of arguments and prints them in
reverse order.
OBJECTIVE:
THEORY INVOLVED:
NAME OF FACULTY:
SIGNATURE:
DATE:
EXPERIMENT NO.
14
EXPERIMENT NO. 13
Unit/Topic: 1/ Introduction
PROBLEM DEFINITION:
Write a shell script to find the smallest of three numbers that are read from
keyboard
. OBJECTIVE:
THEORY INVOLVED:
NAME OF FACULTY:
SIGNATURE:
DATE:
EXPERIMENT NO.
15
EXPERIMENT NO. 14
Unit/Topic: 1/ Introduction
PROBLEM DEFINITION:
OBJECTIVE:
THEORY INVOLVED:
NAME OF FACULTY:
SIGNATURE:
DATE:
EXPERIMENT NO.
16