Professional Documents
Culture Documents
& Marks
Step 1: Download the ISO file using the following links. Download ubuntu 15.04
(64-bit) Download ubuntu 15.04 (32bit). Once the iso file has been downloaded,
burn it into DVD or USB drive and make it bootable.
Step 2: Once you get the bootable USB working follow the screens below to install
USB: pick your language
Step: 3 Download Updates while Installing and Install This Third-Party Software.
Either way Ubuntu will download the bulk of the operating system from the
internet
Step 4: Select Installation Type
Clock on Continue
……………………………………………………………………………………….
……………………………………………………………………………………….
……………………………………………………………………………………….
Questions
15. echo Echo “hello” Used to print any string like printf
in c
Conclusion:
………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………
Questions
1. What is the description for Kernel?
2. What is a single user system?
3. What are the main features of UNIX?
4. Describe the term directory in UNIX?
5. Specify the difference between absolute path and related path?
6. Describe fork() system call?
7. What is mean by Super User?
EXPERIMENT NO: 3
Theory
ifconfig
One of the most basic networking commands is ifconfig. It will tell you about your
network interfaces, the state that they're in, your assigned IP address(es), and even
provide some counts of packets that have crossed the interface since the system
was last booted. These days, you may see both ipv4 and ipv6 addresses.
Notice the RX (receive) and TX (transmit) packets counts as well as the same basic
statistics shown in bytes. These numbers may seem huge but the system was being
running for roughly a year. The uptime command shows you this along with the
load averages that indicate how hard this system is working to keep up with the
load. In this case, the system isn't breaking a sweat. The 0.10 one-minute load
basically tells you that every 10th time the system checks, there is one process
having to wait for access to the CPU. The 0.01 fifteen minute numbers tell you
we're seeing something waiting only one time in a hundred.
$ uptime
09:56:19 up 325 days, 18:16, 1 user, load average: 0.10, 0.06, 0.01
ping
Ping is one of the most basic networking troubleshooting commands. It might tell
you that you can reach a remote system, but you can't assume a system is down if
you don't get a response -- especially if it belongs to some other company as the
ping command and, often, all members of ths icmp protocol family may be blocked
somewhere along the route. If you get a response, you know the system you're
pinging is up, but you also know that your network connection is good. I often ping
a system somewhere else in the US (one on which I had an account many years
ago) as a test of my network connection. If I can get a response from a system
several states up the coast, I must be doing OK. If I'm not OK, then it's time to do a
little troubleshooting.
The ping command generally behaves in one of two ways. It runs four times in
succession and then tells you how many of the requests got through or it runs until
you type ^c to stop it and then gives you the statistics. You can also provide the
command with a -c option to specify how many times you want to ask. If I'm trying
to verify that the systems that I'm expecting to find on a particular subnet are
indeed up, I generally don't want to send each more than one ping. It takes too
long. Sending one ping per system in a for sys in `cat syslist`; do ping -c 1 $sys;
done or, even better, maybe for sys in `cat syslist`; do echo -n "$sys: "; ping -c 1
$sys | grep loss; done.
traceroute
The traceroute command will attempt to provide a list of all the routers your
connections cross when reaching out to a remote system. The output also provides
some information on how long each segment of the path takes, thus giving you
some notion of the quality of a connection.
$ traceroute fermion
traceroute to fermion (10.10.10.10), 30 hops max, 40 byte packets
1 coresys (10.10.10.2) 0.965 ms 1.010 ms 1.006 ms
2 rtr2 (10.10.8.10) 0.613 ms 0.627 ms 0.642 ms
3 10.210.1.14 (10.20.1.11) 78.226 ms 77.779 ms 77.734 ms
4 fermion (10.1.2.3) 77.257 ms !X 81.914 ms !X 73.626 ms !X
netstat
The netstat command can tell you about ongoing connections on the local system
and ports (i.e., services) that are listening, indicating that services are waiting for
requests to come through. By itself, netstat gives you a *lot* information. With a -a
option, it gives you even more.
nslookup
The nslookup command will do a DNS query for you. Assuming the system, you
are working on has a proper /etc/resolv.conf to let it know where to go to ask this
type of question, it can help you find the IP addresses for particular systems and,
often, the system names that go along with particular IP addresses. I've found that
companies are often lax in setting up the reverse lookup (PTR) records that tie IP
addresses back to hostnames, but they are wonderfully useful. By the time you are
watching over hundreds or even thousands of servers, you're going to occasionally
ask yourself something like "What system is 10.94.1.7?" and having an easy way
to get an answer can be very helpful.
whois
You can often find a lot more information about a domain using the whois
command, the output below is truncated. Here I'm picking on my local gas station.
Let's see what I can find out about Valero.
$ whois valero.com
whois valero.com
[Querying whois.verisign-grs.com]
[Redirected to whois.networksolutions.com]
[Querying whois.networksolutions.com]
[whois.networksolutions.com]
hostname
Generally, you know the name of the system you're logged into. After all, you just
logged into it and, often, server names are set up as the system's command line
prompt. But you might be logged into several systems at once or you may want to
know just a bit more information. Here are some hostname command options that
you might not be using.
$ hostname
boson.particles.org
$ hostname -d
particles.org
$ hostname -i
10.20.30.40
The -i option provides and easy way to grab the system's IP address without having
to separate it from ifconfig output.
tcpdump
The tcpdump command can print out the headers of network packets as they reach
your server or can be used with various filters to select just the packets you want to
see. You can also save packets for later analysis.
Conclusion:
………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………
Questions:
What is inode?
Program:
Conclusion:
………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………
EXPERIMENT NO: 5
Program 1:
echo "Hello World"
Program 2:
Conclusion:
………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………
EXPERIMENT NO: 6
Theory:
top
The top command is the traditional way to view your system’s resource usage and
see the processes that are taking up the most system resources. Top displays a list
of processes, with the ones using the most CPU at the top.
ps
The ps command lists running processes. The following command lists all
processes running on your system:
ps -A
Kill
The kill command can kill a process, given its process ID. You can get this
information from the ps -A, top or pgrep commands.
kill PID
2. Memory management commands
free
The free command is the most simple and easy to use command to check memory
usage on Linux. Here is a quick example
$ free -m
/proc/meminfo
The next way to check memory usage is to read the /proc/meminfo file. Know that
the /proc file system does not contain real files. They are rather virtual files that
contain dynamic information about the kernel and the system.
vmstat
The vmstat command with the s option, lays out the memory usage statistics much
like the proc command. Here is an example
3. File system management
fdisk
The "fdisk" file system management tool is a text-based interface that lets you
divide a hard disk into partitions, which are contiguous regions of disk space on
which you can make file systems. The process of dividing a hard disk space is
called disk partitioning.
To list out the current available hard disks and their layout, you can use "fdisk -l"
as shown below.
Mount
4. User management
To add a new user you can use any two of the following User management
commands.
Syntax
adduser <username> useradd <username>
Example
[root@linuxhelp ~]# useradd user1
passwd <username>
It will change the specific user's password and it won’t ask the old password, since
it’s a root.
Example
[user1@linuxhelp ~]$ passwd
New password:
Syntax
userdel -r [username]
Example
[root@linuxhelp ~]# userdel -r user1
Conclusion:
………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………
EXPERIMENT NO:7
Aim: Write a grep/egrep script to find the number of words characters, words and
lines in a file.
Theory
The wc (word count) command in Unix/Linux operating systems is used to find out
number of newline count, word count, byte and characters count in a files specified
by the file arguments. The syntax of wc command as shown below.
# wc [options] filenames
The following are the options and usage provided by the command.
So, let’s see how we can use the ‘wc’ command with their few available
Program
Program:
> for(i=0;i<=10;i++)
> {
> if (i <=1 )
> {
> x=0;
> y=1;
> print i;
> }
> else
> {
> z=x+y;
> print z;
> x=y;
> y=z;
> }
> }
> }'
Output:
13
21
34
55
Conclusion:
………………………………………………………………………………………
………………………………………………………………………………………
………………………………………………………………………………………