r
r
CERTIFICATE
Page 1 of 50
Table of Contents
From To
1.
Demonstration of Basic Linux
commands.
2.
Executing C program using gcc
compiler
3.
Demonstration of gprof
command using linux
4. Create and Edit documents using
Google Docs.
5.
Create Presentations using
Google Slides.
6.
Demonstration of different
Arithmetic and Logical Formulas
using google sheets.
7.
Use of HTML to create simple
webpage.
8.
Demonstration of MathML a
markup language for
describing mathematical notation.
9.
Demonstration of virtualization
using Docker Container
10.
Demonstration GitHub Facility.
Page 2 of 50
FACULTY OF ENGINEERING AND TECHNOLOGY
BACHELOR OF TECHNOLOGY
Ist – SEMESTER
(OPEN-SOURCE SOFTWARE LABORATORY)
Computer Science & Engineering
Department
LABORATARY MANUAL
Page 3 of 50
PRACTICAL NO:1
∙ BashisashellwrittenasafreereplacementtothestandardBourneS
hell(/bin/sh)originally written by Steve Bournefor UNIX
systems.
∙
IthasallofthefeaturesoftheoriginalBourneShell,plusadditionsthat
makeiteasiertoprogr amwith and use from the command line.
1. p
wd
Pri
nt
Page 4 of 50
or
ki
ng
Di
rec
tor
yD
ES
RI
PT
IO
N:
SYNTAX:
pwd
EXAMPLE:
$pwd
/home/directory_name
Page 5 of 50
2. cd: Change
Di
re
cto
ry
ES
RI
PT
IO
N:
It allows you to change your working directory.You use it to move around within
hierarchy yourf
1
Filesystem.
SYNTAX:
cddirectory_name
EXAMPLE:
Page 6 of 50
Input:$cd/documents/work
3. cd..
DESCRIPTION:
Moveup onedirectory.
SYNTAX:
cd..
EXAMPLE:
Youwillendupin/documents.
4. ls
list
all
Page 7 of 50
the
files
and
dire
ctor
ies
DE
SC
RIP
TI
ON
Listallfilesandfoldersinthecurrentdirectoryinthecolumn format.
SYNTAX:
ls[options]
∙ Lists the total files in the directory and subdirectories, the names
of the files in the
currentdirectory, their permissions, the number of subdirectories in
directories listed, thesize of the file,and the date last modification.
ls-l
Page 8 of 50
∙ List All Files Including Hidden Files
ls-a
you can see the whole list of files, including the hidden files.
5. cat DESCRIPTION:
Page 9 of 50
catstandsfor"catenate".Itreadsdatafromfiles,andoutputstheirco
ntents.Itisthesimplestwa yto display the contents of a file at the
command line.
SYNTAX:
cat filename
EXAMPLES:
commandcat/proc/cpuinfo
Information
Using Cat
Command
cat/proc/meminf
Page 10 of 50
6. Head DESCRIPTION:
IfnoFILEisspecified,orwhenFILEisspecifiedasadash("-
hea
d[o
ptio
n]
…[f
ile/
dire
ctor
y]
EXAMPLE:
Display firsttenlinesofmyfile.txt.
hea
dmy
file.t
xt
Page 11 of 50
7. tail
4
DESCRIPTION:
tail is a command which prints the last few number of lines (10
lines by default) of acertain file,then terminates.
SYNTAX:
tail[option]…[file/directory]
EXAMPLE:
Output the
last
100
line
s of
the
file
my
file
.txt
.tai
lm
yfil
e.tx
t-n
100
Page 12 of 50
8. mv
:Moving
(andRen
aming)Fi
les
DESCRI
PTION:
Themvcommandletsyoumoveafilefromonedirectorylocationtoanother. It
Also Lets You
Rename a file(there is no separate rename command).
SYNTAX:
mv[option]sourcedirectory
EXAMPLE:
to the directory
destination
directory.mvmyfil
e.txt
destination_direct
ory
Page 13 of 50
∙ Movethefilemyfile
.txtintoth
eparentdi
rectory.
mvmyfil
e.txt../
mvjoe_expensesJOE1_expenses
9. m
di
Page 14 of 50
r
ir
ec
to
5
Ifthespecifieddirectorydoesnotalreadyexist, mkdir creates it.Morethannone
Page 15 of 50
Directory May beSpecified when calling mkdir.
SYNTAX:
mkdir[option]directory
EXAMPLE:
Page 16 of 50
y
o
Page 17 of 50
r
10. c
s
Page 18 of 50
D
Thecpcommandisusedtomakecopyoffilesanddirectories.
SYNTAX:
cp[option]sourcedirectory
EXAMPLE:
Page 19 of 50
11. r
di
ir
ec
to
Page 20 of 50
R
Thermdircommandisusedtoremoveadirectorythatcontainsotherfilesordirect
ories
. SYNTAX:
rmdirectory_name
EXAMPLE:
Page 21 of 50
Practical 2
gedithello.c
#include <stdio.h>
main()
{
printf("Hello World\n");
}
Page 22 of 50
Step 3. Compile the program.
Type the command
This command will invoke the GNU C compiler to compile the file hello.cand output (-o)
the result to an executable called hello.
Page 23 of 50
Step 4. Execute the program.
./hello
Page 24 of 50
PRACTICAL :03
To enable profiling while compiling, simply add the -pg option in the compilation step.
The pg flag generates extra code for profiling that is used by the gprof command. The
following command illustrates how we can compile profiling information:
The binary file generated above can be executed to generate profile information. The
following line executes the code:
$./program
This will also generate a file gmon.out in the current working directory. To see what files are
generated via execution of the above command, simply type ls as follows:
$ls
PROGRAM CODE:
main.c file
Page 26 of 50
foo.c file:
Foo.h file
Page 27 of 50
OUTPUT:
Page 28 of 50
Page 29 of 50
Practical 4
AIM: Create and Edit documents using Google Docs.
2. In the top left, under "Start a new document," click Blank New.
You can also create new documents from the URL docs.google.com/create.
Page 30 of 50
Step 2: Edit and format
To edit a document:
2. To select a word, double-click it or use your cursor to select the text you want to change.
Page 31 of 50
3. Start editing.
4. To undo or redo an action, at the top, click Undo Undo or Redo Redo.
Page 32 of 50
Format paragraphs or font
Page 33 of 50
Step 3: Share & work with others
Page 34 of 50
Practical 5
Go to Google's home page and click on the grid in the upper right hand corner.
click on the Drive icon. You will be redirected to a log in page if you are signed out, if not you
will be taken to your Drive.
You can also just type in https://slides.google.com, log in if you haven't already, and will be
taken to the Slides page.
From your Drive, click the blue New button on the left side of the page. Select "Google Slides"
from the drop-down menu.
For more options, hover over the arrow on the right edge of the Google Slides option, where a
smaller drop-down menu will appear. From here you can select to create a presentation from a
template or a blank slide.
Page 35 of 50
If you are on the slides page, select an option from the top of the page to create a new slide.
You can press the white square with a plus sign for a blank slide, or click one of the templates.
Click on the Template Gallery option, where more templates will show up.
Page 36 of 50
Add new slides.
Insert images.
Page 37 of 50
Add text.
Animate.
Page 38 of 50
When you are done editing, press the share button to edit permissions for your presentation.
View the finished product by clicking "Present" on the upper right hand corner.
Page 39 of 50
Page 40 of 50
Practical 6
OpenOffice Calc formulas for basic number crunching, such as addition or subtraction, as well
as more complex calculations such as payroll deductions or averaging a student's test results.
In addition, if you change the data, Calc will automatically recalculate the answer without you
having to re-enter the formula.
The following step Create and use a basic formula in OpenOffice Calc.
The steps used to create this formula are the same ones to follow when writing more complex
formulas. The formula will add the numbers 3 + 2. The final formula will look like this:
= C1 + C2
Page 41 of 50
Select the cell C1 and enter 3, then press Enter.
Now select cell C3. This is where we'll enter the basic addition formula.
Page 42 of 50
When creating formulas in Open Office Calc, you always start by typing the equals sign. Type it in the
cell where you want the answer to appear.
Following the equals sign, we add in the cell references of the cells containing our data.
By using the cell references of our data in the formula, the formula will automatically update the
answer if the data in cells C1 and C2 changes.
Page 43 of 50
Practical 7
<!DOCTYPE html>
<html>
<head>
<title>Your Title Here</title>
</head>
<body>
Your content here.
</body>
</html>
Save the html page by pressing CTRL + S or click on file option then save option. Ensure that you
name the file in the following format: “name” then “.html” examples index.html, cooking.html.
this.
Page 44 of 50
Step 3: Add the Text Content
Add the content between the body tags.
Refresh the webpage on the browser. It will look like a blob of text with no paragraphs or headings
shown below.
Headings
First, we shall tackle the headings. Check which part or the text was the main heading. In our
example it is “Insect eating: The ultimate guide to eating crickets”.
Page 45 of 50
Paragraphs
For the paragraphs of text, place each paragraph of text between the <p></p> html tags. Example:
<p>
When you hear about eating insects most people gross out. However, Insects are
concidered a delicacy in many parts of the world. Most of the insects eaten
are farm grown but in some places, they don' shy away from eating insects
collected from the wild.
</p>
<p>Eating insects is concidered:</p>
healthy since insects have less fat content. enviromentally friendly: It takes
less amount of food/plants to rear insects compared to cows. people who don't
eat milk and meat products can try out insects as protein substitute.
View the result on the browser.
Page 46 of 50
Step 6: Add a List
Lists make reading a group of things easier on our eyes and brain. Lets add a bullet points type list:
<ul>
<li>healthy since insects have less fat content.</li>
<li>
enviromentally friendly: It takes less amount of food/plants to rear insects
compared to cows.
</li>
<li>
people who don't eat milk and meat products can try out insects as protein
substitute.
</li>
</ul>
Refresh and view the result on the browser.
Page 47 of 50
Step 7: Add Images
We are going to use the HTML’s img tag <img src="URL" alt="Shown when image cannot load"> to add
your images on the webpage.
<img
src="https://avicndugu.github.io/practice-projects-html/cricket-eating/final/img/fried-crickets.jpg"
alt="Fried crickets on display"
/>
Page 48 of 50
Step 8: Embed a Youtube Video
Search for relevant video on youtube. Once you have found it, click on share button/ link. You
will get a popup. Click on embed option.
<iframe
Page 49 of 50
width="310"
height="160"
src="https://www.youtube.com/embed/BwC4WRKi5QY"
frameborder="0"
allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture"
allowfullscreen
></iframe>
Page 50 of 50