Experiment - 1: What Is A Computer?
Experiment - 1: What Is A Computer?
EXPERIMENT – 1
What is a computer?
A computer is an electronic device that manipulates information, or data. It has the ability to
store, retrieve, and process data.
History of computers
In the early 1820s, it was designed by Charles Babbage who is known as "Father of Modern
Computer". It was a mechanical computer which could perform simple calculations. It was a
steam driven calculating machine designed to solve tables of numbers like logarithm tables
Modern computers can perform generic sets of operations known as programs. These
programs enable computers to perform a wide range of tasks. A computer system is a
"complete" computer that includes the hardware, operating system (main software), and
peripheral equipment needed and used for "full" operation. This term may also refer to a
group of computers that are linked and function together, such as a computer network or
computer cluster.
A broad range of industrial and consumer products use computers as control systems. Simple
special-purpose devices like microwave ovens and remote controls are included, as are
factory devices like industrial robots and computer-aided design, as well as general-purpose
devices like personal computers and mobile devices like smartphones. Computers power the
Internet, which links billions of other computers and users.
Early computers were meant to be used only for calculations. Simple manual instruments like
the abacus have aided people in doing calculations since ancient times. Early in the Industrial
Revolution, some mechanical devices were built to automate long tedious tasks, such as
guiding patterns for looms. More sophisticated electrical machines did specialized analog
calculations in the early 20th century. The first digital electronic calculating machines were
developed during World War [Link] semiconductor transistors in the late 1940s were
followed by the silicon-based MOSFET (MOS transistor) and monolithic integrated circuit
(IC) chip technologies in the late 1950s, leading to the microprocessor and the
microcomputer revolution in the 1970s. The speed, power and versatility of computers have
been increasing dramatically ever since then, with transistor counts increasing at a rapid pace
(as predicted by Moore's law), leading to the Digital Revolution during the late 20th to early
21st centuries.
Components of Computer
1. Mother Board
A motherboard (also called mainboard, main circuit board, mb, mboard, backplane board,
base board, system board, logic board (only in Apple PCs) or mobo) is the main printed
circuit board (PCB) in general-purpose computers and other expandable systems. It holds and
allows communication between many of the crucial electronic components of a system, such
as the central processing unit (CPU) and memory, and provides connectors for other
peripherals. Unlike a backplane, a motherboard usually contains significant sub-systems,
such as the central processor, the chipset's input/output and memory controllers, interface
connectors, and other components integrated for general use.
The motherboard is mounted inside the case and is securely attached via small screws
through pre-drilled holes. Motherboard contains ports to connect all of the internal
components. It provides a single socket for CPU, whereas for memory, normally one or more
slots are available. Motherboards provide ports to attach the floppy drive, hard drive, and
optical drives via ribbon cables. Motherboard carries fans and a special port designed for
power supply.
There is a peripheral card slot in front of the motherboard using which video cards, sound
cards, and other expansion cards can be connected to the motherboard.
On the left side, motherboards carry a number of ports to connect the monitor, printer, mouse,
keyboard, speaker, and network cables. Motherboards also provide USB ports, which allow
compatible devices to be connected in plug-in/plug-out fashion. For example, pen drive,
digital cameras, etc.
2. Ram Modules
3. Daughter cards
• Video Card: This is also referred to as the graphics adapter, display adapter or video
adapter.
• Sound Card: To handle sound, to insert a microphone or connect a speaker this sound card
is used.
• Network Interface Card: This is also referred as NIC. The computer can be connected to a
4. Bus slots
An expansion slot refers to any of the slots on a motherboard that can hold an expansion card
to expand the computer's functionality, like a video card, network card, or sound [Link]
expansion card is plugged directly into the expansion port so that the motherboard has direct
access to the hardware. However, since all computers have a limited number of expansion
slots, it's important to open your computer and check what's available before you buy
[Link] older systems require the use of a riser board to add additional expansion cards;
however, modern computers not only usually have enough expansion slot options, but they
also have features integrated directly into the motherboard, eliminating the need for so many
expansion cards. There are three different types of expansion slots: PCI Express, PCI, and
AGP.
PCI (Peripheral Component Interconnect) Slot: The PCI slot is the most common form of
internal expansion for a [Link] PCs have a mixture of PCI and PCI Express slots.
PCI express (PCIe) Slots: The best type of expansion slot to have in your PC is the PCI
Express. The PCI Express type of expansion slot communicates with the motherboard, and
therefore with the microprocessor, both quickly and efficiently.
AGP (Accelerated Graphics Port) Slot: This type of expansion slot was specifically
designed to deal with graphics adapters. In fact, AGP stands for Accelerated Graphics Port.
Older PCs may sport this expansion slot, but the best video cards use PCI Express.
5. SMPS
A switched-mode power supply (SMPS) is an electronic circuit that converts power using
switching devices that are turned on and off at high frequencies, and storage components
such as inductors or capacitors to supply power when the switching device is in its non
conduction state.
Switching power supplies have high efficiency and are widely used in a variety of electronic
equipment, including computers and other sensitive equipment requiring stable and efficient
power supply.
A switched-mode power supply is also known as a switch-mode power supply or switching
mode power supply.
Switched-mode power supplies are classified according to the type of input and output
voltages. The four major categories are:
•
•AC to DC
•
•DC to DC
•
•DC to AC
•
•AC to AC
Some storage devices are classed as 'internal' which means they are inside the computer case.
Most computers have some form of internal storage. The most common type of internal
storage is the hard disk. At the most basic level, internal storage is needed to hold the
operating system so that the computer is able to access the input and output devices. It will
also be used to store the applications software that you use and more than likely, the original
copies of your data files. Internal storage allows the data and applications to be loaded very
rapidly into memory, ready for use. The data can be accessed much faster than data which is
stored on an external storage device. This is because internal storage devices are connected
directly to the motherboard and its data bus whereas external devices are connected through a
hardware interface such as USB, which means they are considerably slower to access.
Internal storage also means that if the computer is moved around, it will still retain its most
commonly used data. The main disadvantage of internal storage is that when the hard disk
fails (and it will), all the data and applications may be lost. This can be avoided to some
extent by using more than one hard disk within the machine. Each hard disk has a copy of all
the data, so if one fails the other can carry on. This is called a RAID array. An alternative is
to use external drives for backup.
7. Interfacing Ports
A Computer Port is an interface or a point of connection between the computer and its
peripheral devices. Some of the common peripherals are mouse, keyboard, monitor or display
unit, printer, speaker, flash drive etc. The main function of a computer port is to act as a point
of attachment, where the cable from the peripheral can be plugged in and allows data to flow
from and to the device.
Types of ports: -
Serial Port: used for external modems and older computer mouse.
Parallel Port: used for scanners and printers.
PS/2 Port: used for old computer keyboard and mouse.
Universal Serial Bus (or USB) Port: It can connect all kinds of external USB devices such
as external hard disk, printer, scanner, mouse, keyboard, etc.
VGA Port: connects monitor to a computer's video card. It has 15 holes. Similar to the serial
port connector. However, serial port connector has pins, VGA port has holes.
Power Connector: connects to the computer's power cable that plugs into a power bar or
wall socket.
Modem Port: connects a PC's modem to the telephone network.
Ethernet Port: connects to a network and high speed Internet. Connects the network cable to
a computer.
Game Port: connect a joystick to a PC. Now replaced by USB Digital Video Interface
DVI port: connects Flat panel LCD monitor to the computer's high-end video graphic cards.
Sockets: sockets connect the microphone and speakers to the sound card of the computer.
EXPERIMENT - 2
LINUX COMMANDS
[Link] : man command in Linux is used to display the user manual of any command
that we can run on the terminal.
Syntax : $man [OPTION]... [COMMAND NAME]..
• If no option is provided it displays whole manual of the command. •
$man ls
● Options:
○ ls -t: sort the list by time of modification, with the newest at the top.
○ ls -l: list the files in long format i.e. with an index number, owner name, group
Eg : ls –l
● Options:
4 .read : The read command in the Linux system is used to read from a file
descriptor. Example:
5. more : more commands are used to view the text files in the command prompt,
displaying one screen at a time in case the file is large
● Syntax:
● Options:
▪ -f : This option does not wrap the long lines and displays
them as such
● Example:
more [Link];
6. Less : Less command is a Linux utility that can be used to read the contents of a text file
one page(one screen) at a time. It has faster access because if file is large it doesn’t
access the complete file, but accesses it page by page.
● Syntax:
less filename
● Options:
○-E : causes less to automatically exit the first time it reaches end of file.
○ -f : forces non-regular file to open.
○ -F : causes less to exit if entire file can be displayed on first screen
○ -g : highlight the string which was found by last search command
● Example:
less [Link]
10. pwd : print name of current working directory. It prints the path of the working
directory, starting from the root.
● Syntax:
11. find: The find command helps us to find a particular file within a directory. It is
used to find the list of files for the various conditions like permission, user ownership,
modification, date/time, size, and more.
Syntax: $ find [where to start searching from] [expression determines what to find] [-
options] [what to find]
12. mv: mv stands for move. mv is used to move one or more files or directories from
one place to another in a file system like UNIX. It has two distinct functions:
(i) It renames a file or folder.
(ii) It moves a group of files to a different directory.
Syntax:
mv [Option] source destination
Example:
mv [Option] source destination
13. cp: cp stands for copy. This command is used to copy files or group of files or
directory. It creates an exact image of a file on a disk with different file name.
cp command require at least two filenames in its arguments.
Syntax:
cp [OPTION] Source Destination
● Example:
14. rm: rm stands for remove here. rm command is used to remove objects such as
files, directories.
Syntax: rm[OPTION]... FILE...
15. tar : The Linux ‘tar’ stands for tape archive, is used to create Archive and extract the
archive files. tar command in Linux is one of the important command which
provides archiving functionality in Linux. We can use Linux tar command to
create compressed or uncompressed Archive files and also maintain and modify
them.
Syntax:
tar [options] [archive-file] [file or directory to be archived]
● Options:
○ -c : Creates Archive
○ -x : Extract the archive
○ -f : creates archive with given filename
○ -t : displays or lists files in archived file
16. wc : wc stands for word count. As the name implies, it is mainly used for counting
purpose. It is used to find out number of lines, word count, byte and characters
count in the files specified in the file arguments
17. cut : The cut command in UNIX is a command for cutting out the sections
from each line of files and writing the result to standard output
Syntax:
cut OPTION... [FILE]...
● Options:
○ -b(byte): To extract the specific bytes, you need to follow -b option
with the list of byte numbers separated by comma.
○ -c (column): To cut by character use the -c option.
○ -f (field): -c option is useful for fixed-length lines.
18. paste: It is used to join files horizontally (parallel merging) by outputting lines
consisting of lines from each file specified, separated by tab as delimiter, to the
standard output
Syntax:paste [OPTION]... [FILES]...
● Options:
○ -d (delimiter): Paste command uses the tab delimiter by default for
merging the files.
○ -s (serial): We can merge the files in sequentially manner using the -s
option.
19. head: The head command, as the name implies, print the top N number of data of the
given input. By default, it prints the first 10 lines of the specified files.
Syntax: head [OPTION]... [FILE]...
● Options:
○ -n num: Prints the first ‘num’ lines instead of first 10 lines
○ -c num: Prints the first ‘num’ bytes from the file specified.
○ -q: It is used if more than 1 file is given.
○ -v: By using this option, data from the specified file is always preceded
by its file name.
20. tail: The tail command, as the name implies, print the last N number of data of the
given input. By default it prints the last 10 lines of the specified files.
Syntax: tail [OPTION]... [FILE]...
Options:
● -n num: Prints the last ‘num’ lines instead of last 10 lines.
● -c num: Prints the last ‘num’ bytes from the file specified.
● -q: It is used if more than 1 file is given.
● -v: By using this option, data from the specified file is always preceded by
its file name.
21. grep: The grep filter searches a file for a particular pattern of characters, and displays
all lines that contain that pattern.
Syntax: grep [options] pattern [files]
● -i : Ignores, case for matching
● -l : Displays list of a filenames only.
● -n : Display the matched lines and their line numbers.
● -c : This prints only a count of the lines that match a pattern
● -w : Match whole word
● -o : Print only the matched parts of a matching line,
● with each such part on a separate output line.
22. expr: The expr command in Unix evaluates a given expression and displays its
corresponding output. It is used for:
○ Basic operations like addition, subtraction, multiplication, division, and
modulus on integers.
○ Evaluating regular expressions, string operations like substring, length of
strings etc.
Options:
○ –version : It is used to show the version information.
23. chmod: In Unix-like operating systems, the chmod command is used to change the
access mode of a [Link] name is an abbreviation of change mode.
Syntax: chmod [reference][operator][mode] file...
The references are used to distinguish the users to whom the permissions apply i.e.
they are list of letters that specifies whom to give permissions. The references are
represented by one or more of the following letters:
24. Chown: Different users in the operating system have ownership and permission to
ensure that the files are secure and put restrictions on who can modify the
contents of the files. In Linux, there are different users who use the system:
● Root User: It is a superuser who has access to all the directories and
files in our system and it can perform any operation. An important
thing to note is that only the root user can perform changing of
permissions or ownerships of the files that are not owned by them.
● Regular User: These users have limited access to files and directories
and can only modify the file that they own.
Each user has some properties associated with them, such as a user ID and a home
directory. We can add users to a group to make the process of managing users easier.
A group can have zero or more users. A specified user can be associated with a
“default group”. It can also be a member of other groups on the system as well.
Ownership and Permissions: To protect and secure files and directories in Linux we
use permissions to control what a user can do with a file or directory. Linux uses three
types of permissions:
● Read: This permission allows the user to read files in directories, it
lets the user read directories and subdirectories stored in it.
● Write: This permission allows a user to modify and delete a file. Also,
it allows a user to modify its contents (create, delete, and rename files
in it) for the directories. Unless the execution permission is given to
directories changes do affect them.
● Execute: This permission on a file allows it to get executed. For
example, if we have a file named [Link] so unless we don’t give it
execute permission it won’t run.
25. Redirection and piping: Pipes and redirection are two different kinds of mechanisms
used in Linux. Sometimes, we need the output of a command to be passed as input of
another command and do some operation. There we use the pipe operator. The operator
is “|”. It’s found on top of the “Enter” key. Sometimes, we redirect or pass all the output
of a command to a file for storing purposes. Also, we take a file’s content as input for a
command. This is called redirection and operators are used like “>”, “>>” and “<”.
● Redirection:
● Piping
26. useradd: useradd is a command in Linux that is used to add user accounts to your
system. It is just a symbolic link to adduser command in Linux and the difference
between both of them is that useradd is a native binary compiled with system
whereas adduser is a Perl script which uses useradd binary in the background. It
make changes to the following files:
/etc/passwd /etc/shadow
/etc/group /etc/gshadow
27. usermod: usermod command or modify user is a command in Linux that is used to
change the properties of a user in Linux through the command line. After creating a user
we have to sometimes change their attributes like password or login directory etc. so in
order to do that we use the Usermod command. The information of a user is stored in
the following files:
/etc/passwd
/etc/group
/etc/shadow
/etc/[Link]
/etc/gshadow
/etc/[Link]
28. userdel:userdel command in Linux system is used to delete a user account and related
files. This command basically modifies the system account files, deleting all the
entries which refer to the username LOGIN. It is a low-level utility for removing
the users.
Syntax : userdel [options] LOGIN
29. Passwd:passwd command in Linux is used to change the user account passwords. The
root user reserves the privilege to change the password for any user on the
system, while a normal user can only change the account password for his or her
own account.
Syntax: passwd [options] [username]
30. df: The df command (short for disk free), is used to display information related to file
systems about total space and available space.
Syntax : df [OPTION]... [FILE]...
● Example:
31. top: top command is used to show the Linux processes. It provides a dynamic real-time
view of the running system. Usually, this command shows the summary information of
the system and the list of processes or threads which are currently managed by the Linux
Kernel. As soon as you will run this command it will open an interactive command
mode where the top half portion will contain the statistics of processes and resource
usage. And Lower half contains a list of the currently running processes.
● Example:
[Link]: Linux provides us a utility called ps for viewing information related with the
used to list the currently running processes and their PIDs along with some other
information depends on different options. It reads the process information from the
virtual files in /proc file-system. /proc contains virtual files, this is the reason it’s referred
Syntax: ps [options]
Example:
EXPERIMENT - 3
It makes sense to explore the Linux filesystem from a terminal window, In fact, that is
the name of the first tool you’ll install to help you on the way: tree. If you are using
Ubuntu or Debian, you can do: sudo apt install tree
Once installed, stay in your terminal window and run tree like this: $ tree /
The / in the instruction above refers to the root directory. The root directory is the one
from which all other directories branch off from. When you run tree and tell it to start
with /, you will see the whole directory tree, all directories and all the subdirectories in
the whole system, with all their files, fly by.
If you have been using your system for some time, this may take a while, because, even
if you haven’t generated many files yourself, a Linux system and its apps are always
logging, caching, and storing temporary files. The number of entries in the file system
can grow quite quickly. Instead, try this: tree -L 1 /
Most Linux distributions will show you the same or a very similar layout to what you can see
in the image above. This means that even if you feel confused now, master this and you will
have a handle on most, if not all, Linux installations in the whole wide world.
Now, let’s look at what each directory is used for. While we go through each, you can
peek at their contents using ls.
/bin
/bin is the directory that contains binaries, that is, some of the applications and
programs you can run. You will find the ls program mentioned above in this directory,
as well as other basic tools for making and removing files and directories, moving
them around, and so on. There are more bin directories in other parts of the file system
tree, but we’ll be talking about those in a minute.
/boot
The /boot directory contains files required for starting your system. If you mess up
one of the files in here, you may not be able to run your Linux and it is a pain to repair.
On the other hand, don’t worry too much about destroying your system by accident:
you have to have superuser privileges to do that.
/dev
/dev contains device files. Many of these are generated at boot time or even on the fly.
For example, if you plug in a new webcam or a USB pendrive into your machine, a
new device entry will automatically pop up here.
/etc
/etc is the directory where names start to get confusing. /etc gets its name from the
earliest Unixes and it was literally “et cetera” because it was the dumping ground for
system files administrators were not sure where else to put.
Nowadays, it would be more appropriate to say that etc stands for “Everything to
configure,” as it contains most, if not all system-wide configuration files.
For example, the files that contain the name of your system, the users and their passwords,
the
names of machines on your network and when and where the partitions on your hard
disks should be mounted are all in here. Again, if you are new to Linux, it may be best
if you don’t touch too much in here until you have a better understanding of how
things work.
/home
/home is where you will find your users’ personal directories. In my case, under /home
there are two directories: /home/paul, which contains all my stuff; and /home/guest, in
case anybody needs to borrow my computer.
/lib
/lib is where libraries live. Libraries are files containing code that your applications
can use. They contain snippets of code that applications use to draw windows on your
desktop, control peripherals, or send files to your hard disk.
There are more lib directories scattered around the file system, but this one, the one
hanging directly off of / is special in that, among other things, it contains the all
important kernel modules. The kernel modules are drivers that make things like your
video card, sound card, WiFi, printer, and so on, work.
/media
The /media directory is where external storage will be automatically mounted when
you plug it in and try to access it. As opposed to most of the other items on this list,
/media does not hail back to 1970s, mainly because inserting and detecting storage
(pendrives, USB hard disks, SD cards, external SSDs, etc) on the fly, while a computer
is running, is a relatively new thing.
/mnt
The /mnt directory, however, is a bit of remnant from days gone by. This is where you
would manually mount storage devices or partitions. It is not used very often
nowadays.
/opt
The /opt directory is often where software you compile (that is, you build yourself
from source code and do not install from your distribution repositories) sometimes
lands. Applications will end up in the /opt/bin directory and libraries in the /opt/lib directory.
/proc
/proc, like /dev is a virtual directory. It contains information about your computer,
such as information about your CPU and the kernel your Linux system is running. As with
/dev, the files and directories are generated when your computer starts, or on the
fly, as your system is running and things change.
/root
/root is the home directory of the superuser (also known as the “Administrator”) of the
system. It is separate from the rest of the users’ home directories because you
are not meant to touch it. Keep your own stuff in you own directories, people.
/run
/run is another new directory. System processes use it to store temporary data for their
own nefarious reasons.
/sbin
/sbin is similar to /bin, but it contains applications that only the superuser (hence the
initial s) will need. You can use these applications with the sudo command that
temporarily concedes you superuser powers on many distributions. /sbin typically
contains tools that can install stuff, delete stuff and format stuff. As you can imagine,
some of these instructions are lethal if you use them improperly, so handle with care.
/usr
The /usr directory was where users’ home directories were originally kept back in the
early days of UNIX. However, now /home is where users kept their stuff as we saw
above. These days, /usr contains a mish-mash of directories which in turn contain
applications, libraries, documentation, wallpapers, icons and a long list of other stuff
You will also find bin, sbin and lib directories in /usr. What is the difference with their
root-hanging cousins? Not much nowadays. Originally, the /bin directory (hanging off
of root) would contain very basic commands, like ls, mv and rm; the kind of
commands that would come pre-installed in all UNIX/Linux installations, the bare
minimum to run and maintain a system. /usr/bin on the other hand would contain stuff
the users would install and run to use the system as a work station, things like word
But many modern Linux distributions just put everything into /usr/bin and have /bin
point to /usr/bin just in case erasing it completely would break something. So, while Debian,
Ubuntu and Mint still keep /bin and /usr/bin (and /sbin and /usr/sbin) separate; others,
like Arch and its derivatives just have one “real” directory for binaries, /usr/bin, and
/srv
The /srv directory contains data for servers. If you are running a web server from your
Linux box, your HTML files for your sites would go into /srv/http (or /srv/www). If
you were running an FTP server, your files would go into /srv/ftp.
/sys
/sys is another virtual directory like /proc and /dev and also contains information from
In some cases you can also manipulate those devices. I can, for example, change the
1/intel_backlight/brightness file (on your machine you will probably have a different
file). But to do that you have to become superuser. The reason for that is, as with so
many other virtual directories, messing with the contents and files in /sys can be
dangerous and you can trash your system. DO NOT TOUCH until you are sure you
/tmp
/tmp contains temporary files, usually placed there by applications that you are
running. The files and directories often (not always) contain data that an application
You can also use /tmp to store your own temporary files — /tmp is one of the few
directories hanging off / that you can actually interact with without becoming
superuser.
/var
/var was originally given its name because its contents was deemed variable, in that it
changed frequently. Today it is a bit of a misnomer because there are many other
directories that also contain data that changes frequently, especially the virtual
directories we saw [Link] that as it may, /var contains things like logs in the /var/log
subdirectories. Logs are files that register events that happen on the system. If something fails
in the kernel, it will be logged in a file in /var/log; if someone tries to break into your
computer from outside, your firewall will also log the attempt here. It also contains spools for
tasks.
These “tasks” can be the jobs you send to a shared printer when you have to wait
Your system may have some more directories we haven’t mentioned above. In the
screenshot, for example, there is a /snap directory. That’s because the shot was
way of distributing software. The /snap directory contains all the files and the software
command: cd
will take you to the directory of your choice (cd stands for change
pwd
cd with no options or parameters, will take you back to your own home directory, where
things are safe and cosy. Finally, cd .. will take you up one level, getting you one level closer
to the / root directory. If you are in /usr/share/wallpapers and run cd .., you will move up to
/usr/share To see what a directory contains, use ls or simply ls to list the contents of the
directory you
are in right now. And, of course, you always have tree to get an overview of what lays within
you know them all. And the best way to know the filesystem is to explore it. So go forth
You cannot damage your filesystem just by looking at it, so move from one directory to
EXPERIMENT – 4
LINUX COMMANDS EXPERIMENTS
Exercise 1
1. Create the above directory tree and enter necessary data into the [Link]
perform the following operations using linux utilities.
developer@ccfl6-pc18:~/MCA46/nsa/Project34/Sales/RegionB$ cd ../../Payroll
developer@ccfl6-pc18:~/MCA46/nsa/Project34/Payroll$ cp [Link]
../Sales/RegionA
developer@ccfl6-pc18:~/MCA46/nsa/Project34/Payroll$ cp [Link]
../Sales/RegionB
developer@ccfl6-pc18:~/MCA46/nsa/Project34/Payroll$ cd ../Sales/RegionB
developer@ccfl6-pc18:~/MCA46/nsa/Project34/ Sales/RegionB$ touch ../RegionA/[Link]
developer@ccfl6-pc18:~/MCA46/nsa/Project34/ Sales/RegionB $ cp [Link] .. / RegionA
/[Link]
c) Combine the contents of [Link] and [Link] into a new file [Link]
under payroll.
developer@ccfl6-pc18:~/MCA46/nsa/Project34/Sales/RegionB$ cd ../../Payroll
developer@ccfl6-pc18:~/MCA46/nsa/Project34/Payroll$ touch [Link]
developer@ccfl6-pc18:~/MCA46/nsa/Project34/Payroll$ cat > [Link]
Hello
How are you
Welcome to Linux
developer@ccfl6-pc18:~/MCA_B16MCA46/nsa/Project34/Payroll$ cat > [Link]
Linux can perform the following:
Display
Copy
Create
View
developer@ccfl6-pc18:~/MCA46/nsa/Project34/Payroll$ cat [Link] [Link] >
[Link]
developer@ccfl6-pc18:~/MCA46/nsa/Project34$ cd Sales
developer@ccfl6-pc18:~/MCA46/nsa/Project34/Sales$ find -type f | tr '[:lower:]' '[:upper:]'
./REGIONB/[Link]
./REGIONB/[Link]
./REGIONB/[Link]
./REGIONB/[Link]
./REGIONA/[Link]
./REGIONA/[Link]
./REGIONA/[Link]
developer@ccfl6-pc18:~/MCA46/nsa/Project34$ cd Sales
developer@ccfl6-pc18:~/MCA46/nsa/Project34/Sales $ rm -r RegionB
Exercise 2
->developer@ccfl6-pc46:~/Aromal$ cat>employee
Arun,12000,Manager
Varun,18000,Sales
Abhay,20000,Driver
Aromal,19000,Assistant
[Link] the largest file in the current directory. The final output should contain only the
filenames and the respective file sizes
3. From the output of a long directory listing display only the file permissions. Then
pipe this output to filter out any double lines & count the different permission types in
this directory.
[Link] Find with –exec option to rename all .htm files to .html
[Link] tr filter to encrypt using ROT13.(Every character should be replaced with the 13th chr in
the alphabetical order)
[Link] Find command to print the list of all files in the current directory containing the
[Link] grep filter and wc filter to get the count of ordinary files in the current
directory
12
EXERCISE – 3
Question 1
Enter the Linux command to create both a parent directory called ' NSA_lab' and it's
child directory called 'work' at the same time. Assume that directory ' NSA_lab' will
branch-off your home directory and that you are in your home directory to start.
Question 2
Enter a Linux command to create the empty file called 'labtest1' in the directory
'NSA_lab' (you are still in your home directory).
Question 3
Assume that your current directory contains the files 'labtest', 'labtest1', 'labtest2',
'labtest2a', 'labtest3', and 'labtest4'.
Issue a command to delete only the files 'labtest1' and 'labtest2'
Question 4
Assume that you are NOT currently in your home directory. Enter a command to copy all
files inyour home directory beginning with the letter 'a' to the current directory.
Question 5
Enter a command to delete all files that have filenames starting with 'labtest', except
'labtest' itself (Delete all files starting with 'labtest' followed by one or more characters).
Question 6
Enter a Linux command to remove a directory called 'assignments' and all of it's contents,
and allow the system to prompt the user to remove each file or directory.
Assume you are in the home directory, which happens to be the parent directory of
'assignments' directory.
Question 7
Here are two inverted-tree diagrams. Issue a command to change the left diagram to the
right diagram. Assume that you are in your home directory and use relative pathnames.
[home] is your home directory:
Question 8
Issue a command to delete all files in your current directory with 2-character names.
EXPERIMENT – 5
SHELL SCRIPT
1)Write a shell script to find the sum, the average and the product of the four
integers entered.
ALGORITHM
Step 1:Prompt the user to enter four numbers (a, b, c, and d).
Step2:Read and store the four numbers in variables 'a', 'b', 'c', and 'd'.
Step 3:Calculate the sum of the four numbers: 'Sum = a + b + c + d'.
Step 4:Display the sum: "Sum is: [Sum]".
Step 5:Calculate the average of the four numbers: 'Avg = Sum / 4'.
Step 6:Display the average: "Average is: [Avg]"
Step 7:Calculate the product of the four numbers: 'Prd = a * b * c * d'.
Step 8:Display the product: "Product of the four numbers: [Prd]".
PROGRAM CODE
#!/bin/bash
echo "enter the number:";
read a
echo "Enter the number : ";
read b
echo "Enter the number : ";
read c
echo "Enter the number : ";
read d
Sum=`expr $a + $b + $c + $d `
echo "sum is:" $Sum
Avg=`expr $Sum / 4 `
echo "avg is : " $Avg
Prd=`expr $a \* $b \* $c \* $d `
echo "product of 4 numbers: " $Prd
OUTPUT
$ bash [Link]
Enter four integers:
5367
Sum: 21
Average: 5
Product: 630
2)
a) Write a program to check whether a number entered is odd or even.
b) Write a shell script to print given number in reverse order
c) Write a shell script to print sum of all digits of a given number
a)
ALGORITHM
Step 1: Prompt the user to enter a number and store it in the variable 'a'.
Step 2: Check if 'a' is even or odd:
If 'a' is even (i.e., 'a % 2 == 0'), display "[a] is even".
If 'a' is odd (i.e., 'a % 2 != 0'), display "[a] is odd".
PROGRAM CODE
#!/bin/bash
echo "enter the number:";
read a
if [ `expr $a % 2` == 0 ]
then
echo "$a is even"
else
echo "$a is odd"
fi
OUTPUT
$ bash [Link]
Enter a number: 422
422 is Even
b)
ALGORITHM
Step1. Prompt the user to enter a number and store it in the variable 'number'.
Step 2. Initialize a variable 'temp' with the value 0. This variable will be used to store the
reverse
of the input number.
Step 3. Enter a while loop that continues as long as 'number' is greater than 0.
Step 4. Within the loop:
- Get the last digit of 'number' by finding the remainder when 'number' is divided by 10.
- Append the last digit to the 'temp' variable by multiplying 'temp' by 10 and then adding the
last digit.
- Remove the last digit from 'number' by dividing it by 10.
Step 5. Once the loop is complete, the 'temp' variable will contain the reversed number.
Step 6. Display the message "Reverse of the given number is [temp]".
PROGRAM CODE
OUTPUT
$ bash [Link]
Enter a number: 566
Reversed number is: 665
c)
ALGORITHM
Step 1. Prompt the user to enter a number using the `echo` command and store it in the
variable
`num`.
Step 2. Initialize the variable `sum` to 0, which will be used to accumulate the sum of digits.
Step 3. Use a `while` loop with the condition `[ $num -gt 0 ]` to iterate as long as the value of
`num` is greater than 0.
Step 4. Inside the loop:
a. Calculate the last digit of the number by taking the modulus (`mod`) of `num` with 10.
b. Add the last digit (`mod`) to the `sum` variable.
c. Update the value of `num` by removing the last digit using integer division (`num=$((num
/ 10))`).
Step 5. After the `while` loop ends (when `num` becomes zero), print the value of `sum`,
which
represents the sum of the digits of the original number.
PROGRAM CODE
#!/bin/bash
echo "Enter a Number:"
read num
sum=0
while [ $num -gt 0 ]
do
mod=$((num % 10))
sum=$((sum + mod))
num=$((num / 10))
done
echo $sum
OUTPUT
$ bash [Link]
Enter a number:
777
Sum of digits: 21
3) Write a shell script that accepts any year from the keyboard and determine
whether the year is a leap year or not.
ALGORITHM
Step [Link] the user to enter a year using the `echo` command and store it in the variable
`year`.
Step 2. Use the expression ``expr $year % 4`` to calculate the remainder when the year is
divided by 4.
Step 3. Use the conditional `if` statement to check if the remainder is equal to 0. If it is, then
the year is divisible by 4, and we proceed to the `then` block.
Step 4. Inside the `then` block, print "`$year is a leap year`" using the `echo` command,
indicating that the entered year is a leap year.
Step 5. If the remainder is not equal to 0 (i.e., the year is not divisible by 4), the `else` block
is
executed.
Step 6. Inside the `else` block, print "`$year is not a leap year`" using the `echo` command,
indicating that the entered year is not a leap year.
PROGRAM CODE
#!/bin/bash
echo "Enter a year:"
read year
if [ `expr $year % 4` == 0 ]
then
echo "$year is a leap year"
else
echo "$year is not a leap year"
fi
OUTPUT
$ bash [Link]
Enter a year:
2023
2023 is not a leap year
$ bash [Link]
Enter a year:
2024
2024 is a leap year
ALGORITHM
Step 1. Prompt the user to enter a number and read the input into the variable `num`.
Step 2. Initialize the variable `fact` to 1.
Step 3. Use a `while` loop with the condition `[ $num -gt 1 ]` to calculate the factorial. The
loop will continue as long as `num` is greater than 1.
Step 4. Inside the loop, multiply the current value of `fact` with `num` and store the result
back
in the `fact` variable.
Step 5. Decrement the value of `num` by 1.
Step 6. After the `while` loop ends (when `num` becomes 1), print the value of `fact`, which
represents the factorial of the original number.
PROGRAM CODE
#!/bin/bash
echo "Enter a number:"
read num
fact=1
while [ $num -gt 1 ]
do
fact=$((fact * num))
num=$((num - 1))
done
echo "Factorial is:"$fact
OUTPUT
$ bash [Link]
Enter a number:
5
Factorial is : 120
ALGORITHM
Step 1. Use a `for` loop to iterate through numbers from 2 to 100, stored in the variable
`num`.
Step 2. Initialize the variable `is_prime` to `true`.
Step 3. Use a nested `for` loop with the variable `i` to check for factors of `num` from 2 to
`num/2` (integer division). The loop will continue as long as `i` is less than `num/2`
Step 4. Inside the nested loop:
a. Check if `num` is divisible by `i` using the expression `expr $num % $i -eq 0`.
b. If `num` is divisible by `i`, set `is_prime` to `false`, indicating that it is not a prime number.
c. Break out of the loop since we have already determined that the number is not prime.
Step 5. After the nested loop, check if `is_prime` is still `true`.
a. If `is_prime` is `true`, then `num` is a prime number since it had no factors other than 1
and itself.
b. In this case, print the value of `num` using the `echo` command.
Step 6. The outer `for` loop will continue to the next number until all numbers from 2 to 100
have been checked.
PROGRAM CODE
#!/bin/bash
for num in {2..100}
do
is_prime=true
for ((
i=2;
i<num/
2; i++
)) do
if [ `expr
$num % $i
` -eq 0 ]
then
is_prime=false
break
fi
done
if $is_prime
then
echo $num
fi
done
OUTPUT
$ bash [Link]
Prime numbers from 1 to 100:
2
3
5
7
11
13
17
19
23
29
31
37
41
43
47
53
59
61
67
71
73
79
83
89
97
ALGORITHM
Step 1. Display the list of numbers: Use the `echo` command to print the list of numbers
separated by spaces.
Step 2. Print a message: Use the `echo` command to print a message indicating that the
following numbers will be displayed in ascending order.
Step 3. Use a `for` loop to iterate over each number in the list: The numbers in the list are
hardcoded, with `i` taking one value at a time from the list `45 -12 60 12 0`.
Step 4. Inside the loop, print the value of the current number (`i`) to the terminal using the
`echo` command.
Step 5. Use a pipeline (`|`) to send the output of the loop (the list of numbers) to the `sort`
command with the `-n` option: The `sort -n` command performs a numeric sort, ensuring that
the numbers are sorted correctly.
Step 6. The sorted numbers will be displayed on the terminal.
PROGRAM CODE
#!/bin/bash
echo "The number is : 45 -12 60 12 0 "
echo "In ascending order:"
for i in 45 -12 60 12 0;
do
echo "$i";
done |sort -n
OUTPUT
$ bash [Link]
The number is : 45 -12 60 12 0
In ascending order:
-12
0
12
45
60
7) Write a shell script which displays a list of files in the current directory to
which we have read, write and execute permissions.
ALGORITHM
Step1. Print the message "files which have read, write, and execution permissions."
Step 2. Start iterating through each item in the current directory using the wildcard `*`.
Step 3. For each item, check if it is a regular file.
Step 4. If it is a regular file, check if it has read, write, and execute permissions.
Step 5. If the file has all three permissions, then print its details using `ls -l`.
Step [Link] the loop until all items in the directory have been processed.
PROGRAM CODE
echo "files which have read ,write,and execution permissions" for file in *
do
if [ -f $file ]
then
if [ -r $file -a -w $file -a -x $file ]
then
ls -l $file
fi
fi
done
OUTPUT
$ bash [Link]
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
[Link]
ALGORITHM
Step1. Initialize a counter variable `c` to zero.
Step 2. Prompt the user to enter a number and store it in the variable `num`.
Step 3. Prompt the user to enter the digit whose occurrence needs to be found and store it in
the variable `digit`.
Step 4. Enter into a loop that continues until `num` becomes zero.
Step 5. In each iteration of the loop, extract the last digit of `num` using modulo (`%`) and
store it in the variable `rem`.
Step 6. Check if the extracted digit `rem` is equal to the specified `digit`.
Step 7. If the extracted digit matches the specified digit, increment the counter `c`.
Step 8. Divide `num` by 10 to remove the last digit, effectively moving to the next digit for
the next iteration.
Step 9. Continue the loop until all digits of `num` have been processed.
Step 10. After the loop, print the total number of occurrences of the specified digit.
PROGRAM CODE
#!/bin/bash
read num
read digit
count=0
do
i=$(( num % 10 ))
(( count++ ))
fi
num=$(( num / 10 ))
done
OUTPUT
$ bash [Link]
Enter a number:
644564
Enter the digit to find:
4
4 appears 3 times
9) Write shell script to print alternate digits when a 7 digit number is passed as
input. (Eg: Input: 1234567, Ans: 1,3,5,7)
ALGORITHM
Step1. Prompt the user to enter a 7-digit number and store it in the variable `number`.
Step 2. Initialize a variable `n` to 1, which will be used to keep track of the position of the
digit
to extract.
Step 3. Enter into a loop that continues until `n` is greater than 7 (the total number of digits in
the input number).
Step 4. In each iteration of the loop, extract the `n`-th digit from the input number using the
`cut` command and store it in the variable `a`.
Step 5. Print the extracted digit without a newline character (using `echo -n` to avoid
newlines).
Step 6. Increment `n` by 2 to move to the next position for the next iteration.
Step 7. Continue the loop until every second digit has been extracted and printed.
Step 8. Print a newline character to move to the next line after the loop.
PROGRAM CODE
#!/bin/bash
echo "enter 7 digit number"
read number
n=1
echo "ANS:"
while((n<=7))
do
a=`echo $number | cut -c $n`
echo -n " $a"
n=`expr $n + 2`
done
echo "
OUTPUT
$ bash [Link]
Enter a 7 digit number:
6472915
Alternate numbers are :
6795
10) Write a shell script that takes a command line argument and displays the details
depending on whether the argument is a directory, a file, or something else.
ALGORITHM
Step 1. Prompt the user to enter a file name and store it in the variable `file`.
Step 2. Check if the entered `file` name corresponds to a regular file using the `-f` test.
Step 3. If the entered `file` is a regular file, print the message "`file` is a file."
Step 4. If the entered `file` is not a regular file, check if it corresponds to a directory using the
`-d` test.
Step 5. If the entered `file` is a directory, print the message "`file` is a directory."
Step 6. If the entered `file` is neither a regular file nor a directory, print the message "`file` is
something else."
PROGRAM CODE
11) Write a shell script that accepts a filename, starting line number and ending
line number as arguments and displays all the lines between the given line
numbers.
ALGORITHM
Step1. Prompt the user to enter a file name and store it in the variable `file`.
Step 2. Prompt the user to enter the starting line number and store it in the variable `s`.
Step 3. Prompt the user to enter the ending line number and store it in the variable `e`.
Step 4. Use the `sed` command to print the lines within the range from `s` to `e` (both
inclusive)
from the file specified by `file`.
Step 5. The `-n` option in `sed` tells it not to print the lines by default. The `$s,$e\p` specifies
the range of lines to be printed (`$s` is the starting line number, `$e` is the ending line
number,
and `\p` is used to print the lines within that range).
Step 6. The output displays the lines from the specified file within the specified range.
PROGRAM CODE
OUTPUT
$ cat [Link]
Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9
Line 10
12)Write a shell script that deletes all lines containing a specified word in one or
more files supplied as arguments to it.
ALGORITHM
Step 1: Read the first command-line argument and store it in the variable word.
Step 2: Shift the positional parameters so that $@ now contains only the list of files.
Step 3: For each file in the list:
PROGRAM CODE
#!/bin/bash
word=$1
shift
if [ -f "$file" ]; then
else
fi
done
OUTPUT
$ cat >[Link]
apple pie
banana pie
cherry pie
apple tart
$ cat >[Link]
apple strudel
blueberry pie
apple crumble
$ cat [Link]
banana pie
cherry pie
$ cat [Link]
blueberry pie
13) Write a shell script that computes the gross salary of an employee according
to the following:
a. if basic salary is <1500 then HRA 10% of the basic salary and DA =90% of the basic
salary
b. if basic salary is >1500 then HRA 500 and DA =98% of the basic salary (The basic salary
is entered interactively through the keyboard)
ALGORITHM
Step 1. Prompt the user to enter the basic salary and read the input into the variable `bsal`.
Step 2. Check if the `bsal` is less than 1500. If it is, calculate the gross salary using the
formula:
`gsal = bsal + (bsal/100)*10 + (bsal/100)*90`.
Step 3. If `bsal` is greater than or equal to 1500, calculate the gross salary using the formula:
`gsal = (bsal + 500) + (bsal/100)*98`.
Step 4. Display the calculated gross salary to the user.
PROGRAM CODE
OUTPUT
$ bash [Link]
Enter the basic salary: 30000
14) Write a shell script to prepare a marklist of the students along with their grade.
(Inputs: Name, RegNo, Marks in 5 subjects)
ALGORITHM
Step 1: Prompt the user to enter the student's name and read it into the variable name.
Step 2: Prompt the user to enter the student's register number and store it in regno.
Step 3: Prompt the user to enter marks for 5 subjects and store them in variables m1, m2, m3,
m4, and m5.
Step 4: Calculate the total marks by adding all 5 subject marks and store the result in the
variable total.
Step 5: Calculate the average marks by dividing the total by 5 and store it in average.
Step 6: Determine the grade based on the average marks using conditional checks:
PROGRAM CODE
#!/bin/bash
echo "Enter Student Name:"
read name
echo "Enter Register Number:"
read regno
echo "Enter marks for 5 subjects:"
read m1
read m2
read m3
read m4
read m5
total=$((m1 + m2 + m3 + m4 + m5))
average=$((total / 5))
if [ $average -ge 90 ]; then
grade="A+"
elif [ $average -ge 80 ]; then
grade="A"
elif [ $average -ge 70 ]; then
grade="B"
elif [ $average -ge 60 ]; then
grade="C"
elif [ $average -ge 50 ]; then
grade="D"
else
grade="Fail"
fi
echo "---------------------------"
echo "Student Marklist"
echo "Name: $name"
echo "Register Number: $regno"
echo "Total Marks: $total"
echo "Average Marks: $average"
echo "Grade: $grade"
echo "---------------------------"
Output
$ bash [Link]
Enter Student Name:
Sreya P
Enter Register Number:
412106
Enter marks for 5 subjects:
87
85
91
92
86
---------------------------
Student Marklist
Name: Sreya P
Register Number: 412106
Total Marks: 441
Average Marks: 88
Grade: A
15)Write a shell script to update bank account details using case construct.
(Menu options are Deposit and Withdraw).
ALGORITHM
1. Deposit
2. Withdrawal
3. Display
4. Exit
PROGRAM CODE
bal=10000
echo "Bank Operation"
echo "1. Deposit"
echo "2. Withdrawal"
echo "3. Display"
echo "4. Exit"
while true; do
echo -n "Enter your choice: "
read ch
case $ch in
1) echo -n "Enter deposit amount: "
read dep
bal=$((bal + dep))
echo "Balance Updated <3"
echo ""
;;
2) echo -n "Enter withdrawal amount: "
read with
if [ $with -gt $bal ]; then
echo "Insufficient Balance!!!"
echo ""
continue
fi
bal=$((bal - with))
echo "Balance Updated <3"
echo ""
;;
3) echo "Balance = $bal"
echo ""
;;
4) echo "Thank you!"
echo ""
exit
;;
*) echo "Invalid Option!"
echo ""
;;
esac
done
OUTPUT
$ bash [Link]
Bank Operation
1. Deposit
2. Withdrawal
3. Display
4. Exit
Enter your choice: 3
Balance = 10000
EXPERIMENT-6
<?php
Echo “ test php ”;
?>
3. Press CTRL + X to save and close the file. Press y and ENTER to confirm.
4. Then check the code are run currectly in [Link] the browser enter the
Ip address (localhost/[Link]).
It show the below image
2. Then it’s asking us for a root password . enter the password . Again we get to
repeat it
Step 7: Check the Mysql server
1. To check Mysql server, run the following command
$ mysql -u root -p
• Enter the root password and press enter
EXPERIMENT-7
Let’s open up a Terminal and do first thing first update your package list using
Sudo apt update command.
$ sudo apt update
After updating your package list install apache webserver
$ sudo apt install apache2 $ systemctl status apache2
If the Apache server not running then use the following command to start apache
serve and add to boot startup.
$ systemctl start apache2
$ systemctl enable apache2
Open browser, goto localhost and check if default apache server page is available or
Not
To install Laravel 8.x, at least you must have PHP >= 7.3 on your system. And by
default, the official Ubuntu 20.04 repository provides PHP 7.4 packages. Install
PHP 7.4 packages using the apt command below.
Now go ahead and make tweak changes in PHP ini file and set cgi.fix_pathinfo set to
be 0. If this number is kept as a 1, the php interpreter will do its best to process the file
that is as near to the requested file as possible. This is a possible security risk. If this
number is set to 0, conversely, the interpreter will only process the exact file path—a
much safer alternative.
$ cd /etc/php/7.4/apache2
$ sudo nano [Link]
Press ctrl+w and search for the word “[Link]” the uncomment the line and set it to 0.
.cgi.fix_pathinfo=0
Install the composer package manager go ahead and download and install
Composer. and move the composer .phar file to usr/local/bin/composer directory.
$ sudo apt install curl
$ curl -sS [Link] | php
$ sudo mv [Link] /usr/local/bin/composer
Now install Laravel Framework using composer, just type composer global require
Laravel/installer It will take a while to complete download its dependencies.
As you had seen above image, all packages have been installed on the
‘~/.config/composer’ directory. Next, we need to add the ‘bin’ directory to the
PATH environment through the ~/.bashrc configuration. So Now Edit the ~/.bashrc
configuration using nano command.
$ nano ~/.bashrc
And add the following line at the end of the file.
..export PATH="$HOME/.config/composer/vendor/bin:$PATH"
The ‘bin’ directory for the composer packages has been added to the $PATH
environment variable. And as a result, you can use the command ‘laravel’ to start
and create a new project. Now go ahead and type Laravel new then your project name
to start a new Laravel project.
$ laravel new myapp1
This will take a while to download all dependencies required by Laravel.
Here you can see the installation of my new project myapp1 finished. You can also
see inside my home directory a new directory has been created with my project name.
$ cd /etc/apache2/sites
available/ $ sudo nano
[Link]
And paste the following line inside the file.
<VirtualHost *:80>
ServerName [Link]
ServerAdmin admin@[Link]
DocumentRoot /home/ebin/myapp1/public
<Directory /home/ebin/myapp1>
Options Indexes MultiViews
AllowOverride None
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/[Link]
CustomLog ${APACHE_LOG_DIR}/[Link] combined
</VirtualHost>
As you are in a local environment you need a local dns resolver for your site. Go
ahead and edit /etc/hosts file, add a dns record for your site then save the file.
$ sudo nano /etc/hosts
...[Link] [Link]
Now get back to the web browser and open a tab then type your project hostname.
And here it is it’s working. Here you can see the Laravel version and PHP version.
EXPERIMENT-8
PING COMMAND
PING (Packet Internet Groper) command is used to check the network connectivity between
host and server/host. This command takes as input the IP address or the URL and sends a data
packet to the specified address with the message “PING” and get a response from the
server/host this time is recorded which is called latency. Fast ping low latency means faster
connection. Ping uses ICMP(Internet Control Message Protocol) to send an ICMP echo
message to the specified host if that host is available then it sends ICMP reply message.
Ping is generally measured in millisecond every modern operating system has this ping pre-
installed.
Syntax: ping [OPTIONS] DESTINATION
TRACEROUTE COMMAND
Traceroute command in Linux prints the route that a packet takes to reach the host.
This command is useful when you want to know about the route and about all the hops
that a packet takes. Below image depicts how traceroute command is used to reach the
Google ([Link]) host from the local machine and it also prints detail about all
the hops that it visits in between.
Syntax: traceroute [options] host_Address[pathlength]
ROUTE COMMAND
route command in Linux is used when you want to work with the IP/kernel routing
table. It is mainly used to set up static routes to specific hosts or networks via an
interface. It is used for showing or update the IP/kernel routing table.
Syntax: route
NSLOOKUP COMMAND
nslookup (stands for “Name Server Lookup”) is a useful command for getting
information from DNS server. It is a network administration tool for querying the
Domain Name System (DNS) to obtain domain name or IP address mapping or any
other specific DNS record. It is also used to troubleshoot DNS related problems.
Syntax: nslookup [option]
IFCONFIG COMMAND
ifconfig(interface configuration) command is used to configure the kernel-resident
network interfaces. It is used at the boot time to set up the interfaces as necessary.
After that, it is usually used when needed during debugging or when you need system
tuning. Also, this command is used to assign the IP address and netmask to an interface
or to enable or disable a given interface.
Syntax:
ifconfig [... OPTIONS] [INTERFACE]
EXPERIMENT- 9
INTRODUCTION TO WIRESHARK
Your Wireshark window should look similar to the window shown in below
EXPERIMENT-10
1. Install VirtualBox .
If you don't already have VirtualBox installed on your Windows or Mac computer,
you'll need to install it before proceeding.
Following are the steps required to install VirtualBox(Oracle VM VirtualBox):
You can download the latest version of VirtualBox from the Virtual Box website:
[Link] according to the version of your
operating system Windows, Mac or Linux.
1.1. Click Next
2. Open VirtualBox. Double-click (or click once on a Mac) the VirtualBox app icon.
3. Click New. It's a blue badge in the upper-left corner of the VirtualBox window.
4. Enter a name for your virtual machine. Type whatever you want to name your
virtual machine (e.g., Ubuntu) into the "Name" text field that's near the top of the
pop-up menu.
5) For Operating System Type, select the OS that you want to install.
8. Select an amount of RAM to use. Click and drag the slider left or right to decrease
or increase the amount of RAM that VirtualBox will have available for your virtual
machine.
The ideal amount of RAM will automatically be selected when you get to this page.
Make sure not to increase the RAM into the red section of the slider; try to keep the
slider in the green.
[Link] your virtual machine's virtual hard drive. The virtual hard drive is a
section of your computer's hard drive space which will be used to store your virtual
machine's files and programs:
Click Create, to create your new virtual machine. The virtual machine is displayed
in the list on the left side of the VirtualBox Manager window, with the name that you
entered initially.
VMs can run multiple operating system environments on a single physical
computer, saving physical space, time and management costs.