Linux Lab Manual (cs-505)
Linux Lab Manual (cs-505)
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.
OBJECTIVE:
To understand the basics of Unix/Linux.
THEORY INVOLVED:
NAME OF FACULTY:
SIGNATURE:
DATE:
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
Unit/Topic: 2/ Basic commands
PROBLEM DEFINITION:
To Study basic & User status Unix/Linux Commands.
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:
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
Unit/Topic: 3/ File commands
PROBLEM DEFINITION:
Create a file called wlcc.txt with some lines and display how many lines, words and characters are
present in that file.
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
Unit/Topic: 3/File commands
PROBLEM DEFINITION:
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?
.
OBJECTIVE:
To understand the concept to splitting file.
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:
DATE:
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: