You are on page 1of 41

EXPERIMENT NO:- 01

Aim: Install ubuntu 14.04.02 LTS

Step:- 01 Using a DVD

It’s easy to install Ubuntu from a DVD. Here’s what you need to do:Put the Ubuntu DVD into the
DVD-drive.Restart your computer. You should see a welcome screen prompting you to choose your
language and giving you the option to install Ubuntu or try it from the DVD.

Install Ubuntu. Your computer will need at least 4.5 GB of free space. You will want more than this
if you want to install programs and create files. If you are installing on a laptop, make sure that it is
connected to a power source, as installing can drain the battery faster than normal.

Step:-02 Prepare to install Ubuntu


Check the “Download updates automatically” box, as well as the “Install this third-party software”
box. The third-party software will allow you to play MP3 files as well as watch Flash video (such as
YouTube).

Step:-03 Set up wireless


Set up the wireless connection. If your computer is not connected to the internet via Ethernet, you
can configure your wireless connection in the next step.

 If you didn’t have an internet connection in the previous step, hit the Back button after setting up the
wireless connection so that you can enable automatic updates.

Step:-04 Allocate drive space

Choose what to do with your existing operating system. If you have Windows installed on your
system, you will be given a couple options on how you’d like to install Ubuntu. You can either
install it alongside your previous Windows installation, or you can replace your Windows
installation with Ubuntu.

If you install it alongside your old version of Windows, you will be given the option to choose your
operating system each time you reboot your computer. Your Windows files and programs will
remain untouched.

Step:- 05 Begin the installation

If you replace your installation of Windows with Ubuntu all of your Windows files, documents, and
programs will be deleted.
Set your partition size. If you are installing Ubuntu alongside Windows, you can use the slider to
adjust how much space you would like to designate for Ubuntu. Remember that Ubuntu will take up
about 4.5 GB when it is installed, so be sure to leave some extra space for programs and files.

 You can also change the size of the Ubuntu installation. A larger installation will give your Linux
operating system more space to install programs and add files, but this will take away from the free
space that Windows has access to.Once you are satisfied with your settings, click Install Now.
Step:-06 Select your location

Choose your location. If you are connected to the internet, this should be done automatically. Verify
that the timezone displayed is correct, and then click the Continue button.

Enter your login information. Enter your name, the name of the computer (which will be displayed
on the network), choose a username, and come up with a password. You can choose to have Ubuntu
automatically log you in, or require your username and password when it starts.
Step:- 07 Select your preferred keyboard layout

Wait for the installation process to complete. Once you choose your login info, the installation
will begin. During setup, various tips for usingUbuntu will be displayed on the screen. Once it is
finished, you will be prompted to restart the computer and Ubuntu will load.

Method 2 of 2: Using the Windows Installer

Download the installer from the Ubuntu website. If your browser prompts you, select Run, Save,
or Open. The Windows installer is not compatible with Windows 8. You must use the method in the
previous section.

The Windows installer will install Ubuntu alongside Windows. Your files and programs will not be
affected. When you reboot your computer, you will be able to choose which operating system you
would like to load.

Step:- 08 Enter your login and password details

Choose your username and password. Once you run the installer, you will be presented with the
configuration menu. Choose your new Ubuntu username and password.
Learn more about Ubuntu while the system installs…
Click Install to start. The installer will begin downloading the files necessary to install Ubuntu on
your computer. Installation will happen automatically.

Step:- 09 Installation Complete

Restart your computer. Once the installation is complete, you will be given the option to reboot
now or later. When you reboot, you will see a new menu before Windows starts that allows you to
choose between Windows and Ubuntu.
EXPERIMENT NO:- 02

Aim : Install VMware Workstation

VMware is a virtualization platform where you can install multiple Operating Systems (OS) on your
desktop or laptop computer.

For example, if your computer is running Windows Vista but you want to
experiment with Windows 7 for development or certification, you can
install a guest OS of Windows 7. In fact, you can install an entire virtual
domain on a single computer.

With VMware Workstation, you no longer need to purchase multiple


physical computers to meet your development or certification needs. A
desktop or laptop with good processing power and plenty of available
memory is all that you will need to unlock your desktop from a single OS
to multiple OS’s.

For example, my current configuration is a 64-Bit computer with a quad-


processor and 8GB of RAM. It allows me to run up to 10 virtual machines
simultaneously. If your computer is 32-bit with 2-4 GB of RAM, you can
run 1-4 virtual machines simultaneously. You can experiment with the memory settings depending
on the specifications of the computer you own.

.VMware Workstation System Requirements

The hardware requirements are as follows:

 Standard x86?compatible or x86?64?compatible personal computer


 1.3GHz or faster CPU minimum
 Multiprocessor systems are supported
 Support for 64?bit guest operating systems is available with Intel VT or AMD?V CPUs
 Operating system installation media (disk or disk image) for virtual machines
 For Windows 7 Aero Graphics Support:
o Intel Dual Core, 2.2GHz and above or AMD Athlon 4200+ and above
o nVidia GeForce 8800GT and above or ATI Radeon HD 2600 and above
o At least 3GB of host system memory
When you run the executable, follow the simple wizard to install the software. You may be prompted
to reboot your computer after the installation of VMware Workstation.

Creating a Virtual Machine


Step:- 01
Let’s begin by opening VMware Workstation from the Start menu. Alternatively, you can type,
“VMware” in the instant search field and select VMware Workstation from the list of programs
(Figure 1).

Figure 1: VMware Workstation Main Window

Next, click File | New | Virtual Machine.

A wizard
appears to create a new virtual machine as shown in Figure
Step:- 02

Figure 2: New Virtual Machine Wizard

Click “Next” and choose how you want to load Windows 7. You can load it from installation media
(DVD) or you can use an ISO image. For the purposes of this article, we will use an ISO image
(Figure 3)
Step:- 03
.

Figure 3: Loading Windows 7 from an ISO Image.

Next, select “Installer disc image file (ISO)” and browse to where your Windows 7 ISO image
resides. Click “Next” and enter the Windows 7 product key (Figure 4).

Step:- 04

Figure 4: Entering a Windows 7 Product Key

Click “Next”, and enter a virtual machine name and choose a location for your virtual machine to
reside. You can simply accept the defaults and move forward in the installation (Figure 5).

Step:- 05
Figure 5: Entering a Virtual Machine Name and Location

Click “Next” and accept (Figure 6) the default disk size of 40 GB. You can increase or decrease this
size as you see .

Step:- 06

Figure 6: Specify the Disk Capacity

Click “Next” and you can customize your virtual machine hardware prior to beginning the Windows
7 virtual machine Operating System (OS) load (Figure 7).

For example, you can add disks, serial ports, and printers. You can also remove unnecessary
hardware such as floppy drives and sound cards (Figure 8).

Step:- 07

Figure 7: Customizing Virtual Machine Hardware

Step:- 08
Figure 8: Add/Remove Hardware

Click OK and Finish and Windows 7 begins to load (Figure 9). Since you entered the product key,
VMware Workstation enters an “Easy Install” mode. Just sit back, relax, and a Windows 7 virtual
machine is installed.

Step:- 09

Figure 9: Windows 7 “Easy Install”

VMware Tools
In the current version of VMware Workstation (VMware Workstation 7), the VMware Tools are
automatically installed so you no longer have to worry about whether you remembered to install the
VMware Tools or not. The VMware Tools install the following components:

 VMware Tools service


 VMware user process
 VMware Tools control panel
 VMware device drivers
Working with a Virtual Machine
Now that your virtual machine (Figure 10) is ready, you can use it like it was a physical computer. If
you choose View | Full Screen, you can work with your virtual machine a full-screen mode. Other
options you have when working with virtual machines is the following:

 Power On a Virtual Machine


 Suspend a Virtual Machine into Memory
 Power Off a Virtual Machine
 Snapshot a Virtual Machine

Now that you are familiar with VMware Workstation, experiment with the different settings, test
new drivers and software on Windows 7. Additionally, you can use VMware Workstation to prepare
for any certification programs you wish to achieve.

EXPERIMENT NO:- 03

Aim : Install ubuntu 14.04.02 LTS in VMware Workstation

Ubuntu 14.04 LTS  long-term support will be the next version of the Ubuntu operating system ,
"Trusty Tahr" is the code name for Ubuntu 14.04, scheduled for release 17 April 2014.

What is new in Ubuntu


 What is new in UbuntuThere will be few changes to the desktop as 14.04 will use the existing
mature Unity 7 interface. Ubuntu 14.04 will include the ability to turn off the global menu
system for individual applications.
 Retention of Xorg 
 Unity 8 Desktop preview
 Mobile applications
 USB Start-Up Disk Creator tool
 Unity Control Centre
 SSD TRIM support
first Download Ubuntu 14.04 LTS and VMware Workstation 10 or Virtual Box 4.3.

Step:- 01
Open VMware Workstation 10 & click on File-> New Virtual Machine –> Select Custom
(advanced) option as shown below.
Step:- 02  
Choose hardware compatibility and press next key

Step:- 03
Select Linux as guest operating system and version as Ubuntu 64-bit.
Step:- 04
This is my Ubuntu 14.04 Virtual machine summary. I am using 4GB of memory with two
processor. If you want you can use more memory & CPU as per requirement.  Also I am using
20GB of Hard Disk.

 
Step:- 05 Allocate the memory

 
Step:- 06
Virtual machine wills we created with the following setting and then press finish key
 

Step:- 07 In next step I have mounted my Ubuntu ISO file & stared my Virtual machine. Here
is the booting screen of Ubuntu,

 
Step:08  ubuntu withoutinstallation

Step:09  specifies the language you want to choose


Step:10 ready to install ubuntu

Step:- 11 installation type

Step:12 click on install key to install ubuntu


v Step:- 13 ubuntu install

Experiment:-04

AIM:- To study and execute ls, cd, pwd .

ls command is one of the most frequently used command in Linux. ls command is the first command
you may use when you get into the command prompt of Linux Box. We use ls command daily basis
and frequently even though we may not aware and never use all the option available..

1. List Files using ls with no option

ls with no option list files and directories in bare format where we won’t be able to view details like
file types, size, modified date and time, permission and links etc.

2 List Files With option –l

Here, ls -l (-l is character not one) shows file or directory, size, modified date and time, file or folder
name and owner of file and it’s permission.
3. View Hidden Files

List all files including hidden file starting with ‘.‘.

4. List Files with Human Readable Format with option -lh

With combination of -lh option, shows sizes in human readable format.

5. List Files and Directories with ‘/’ Character at the end

Using -F option with ls command, will add the ‘/’ Character at the end each directory.


6. List Files in Reverse Order

The following command with ls -r option display files and directories in reverse order.

7. Recursively list Sub-Directories

ls -R option will list very long listing directory trees. See an example of output of the command.
8. Reverse Output Order

With combination of -ltr will shows latest modification file or directory date as last.

9. Sort Files by File Size

With combination of -lS displays file size in order, will display big in size first.

10. Display Inode number of File or Directory

We can see some number printed before file / directory name. With -i options list file / directory with
inode number

11. Shows version of ls command

Check version of ls command.


12. Show Help Page

List help page of ls command with their option.

13. List Directory Information

With ls -l command list files under directory /tmp. Wherein with -ld parameters displays information
of /tmp directory.

In Linux ‘cd‘ (Change Directory) command is one of the most important and most widely used
command for newbies as well as system administrators. For admins on a headless server, ‘cd‘ is the
only way to navigate to a directory to check log, execute a program/application/script and for every
other task.
1. Change from current directory to /usr/local.

2. Change from current directory to /usr/local/lib using absolute path.

3. Change from current working directory to /usr/local/lib using relative path.

4. (a) Move one directory back from where you are now

4. (b) Change Current directory to parent directory.

5. Show last working directory from where we moved (use ‘–‘ switch) as shown.

6. Move two directory up from where you are now.

7. Move to users home directory from anywhere.

Or

‘pwd‘ stands for ‘Print Working Directory‘. As the name states, command ‘pwd‘ prints the current
working directory or simply the directory user is, at present. It prints the current directory name with
the complete path starting from root (/). This command is built in shell command and is available on
most of the shell – bash, Bourne shell, ksh,zsh, etc.

1. Print your current working directory.


Experiment:-05

Aim : To study and execute copy Delete / Remove Directory command.

cp is one of the basic command in Unix. it is used to copy one or more files or directories from
source to destination.

The general form of copy command:

cp [option] source destination

1. Copy a file or directory from source to destination


To copy a file, you need to pass source and destination to the copy command.
2. Copy multiple files or directories
You can copy more than one file from source to destination as shown below:

Delete / Remove Directory in Linux

Delete Empty Directories in Unix?

rmdir command will delete the empty directories. i.e directory without any sub-directories or files.

rmdir DIRNAME

2. Delete Directory Which has Content (i.e Directory with Files and Sub-directories)
Some times you may want to delete directory which has contents in it. You can do it with rm
command as shown below.

Syntax: rm -rf DIRNAME


Experiment:-06

AIM:- To study and execute mv command

Linux mv command is used to move files and directories from one location to another. Apart
from moving the files, it can also rename a file or directory.
1. move a file or directory

Mv 123(file) abc(directory)
1. Rename a File
While renaming a file using mv command, it keeps the inode number same even after moving it to a
different name. If you move the file to a different file system, the inode number will be different.

2. Rename a Directory
Just like renaming a file, you can rename a directory using mv command as shown below. This also
keeps the inode number of the directory same after renaming.

If you just do ls -l dir, it will display the files in the directory. To display the directory properties, use
-d option. -i option displays the inode number of the directory.

Experiment:-07

Aim : To study and execute df command

The ‘df‘ command stand for “disk file system“, it is used to get full summary of available and used
disk space usage of file system on Linux system

1. Check File System Disk Space Usage

The “df” command displays the information of device name, total blocks, total disk space, used disk
space, available disk space and mount points on a file system.
2. Display Information of all File System Disk Space Usage

The same as above, but it also displays information of dummy file systems along with all the file
system disk usage and their memory utilization.

3. Show Disk Space Usage in Human Readable Format

Have you noticed that above commands displays information in bytes, which is not readable yet all,
because we are in a habit of reading the sizes in megabytes, gigabytes etc. as it makes very easy to
understand and remember.

The df command provides an option to display sizes in Human Readable formats by using ‘-h’


(prints the results in human readable format (e.g., 1K 2M 3G)).
4. Display Information of /home File System

To see the information of only device /home file system in human readable format use the following
command.

5. Display Information of File System in Bytes

To display all file system information and usage in 1024-byte blocks, use the option ‘-k‘ (e.g. –
block-size=1K) as follows.

6. Display Information of File System in MB

To display information of all file system usage in MB (Mega Byte) use the option as ‘-m‘.
7. Display Information of File System in GB

To display information of all file system statistics in GB (Gigabyte) use the option as ‘df -h‘.

8. Display File System Inodes

Using ‘-i‘ switch will display the information of number of used inodes and their percentage for the
file system.

9. Display File System Type


If you notice all the above commands output, you will see there is no file system type mentioned in
the results. To check the file system type of your system use the option ‘T‘. It will display file system
type along with other information.
Experiment:-08

Aim : To study and execute w,who command.

1. Get the running processes of logged-in user using w

w command is used to show logged-in user names and what they are doing. The information will be
read from /var/run/utmp file. The output of the w command contains the following columns:
 Name of the user
 User’s machine number or tty number
 Remote machine address
 User’s Login time
 Idle time (not usable time)
 Time used by all processes attached to the tty (JCPU time)
 Time used by the current process (PCPU time)
 Command currently getting executed by the users
 
Following options can be used for the w command:
 -h Ignore the header information
 -u Display the load average (uptime output)
 -s Remove the JCPU, PCPU, and login time.

 
2. Get the user name and process of logged in user using who and users command
who command is used to get the list of the usernames who are currently logged in. Output of the
who command contains the following columns: user name, tty number, date and time, machine
address.

 
Experiment:-09

Aim : To study and execute whoami, user command.

Users Command
user command is used to print the user name who are all currently logged in the current host. It is
one of the command don’t have any option other than help and version. If the user using, ‘n’ number
of terminals, the user name will shown in ‘n’ number of time in the output.

$ users
john jason ramesh

3. Get the username you are currently logged in using whoami


whoami command is used to print the loggedin user name.

 
whoami command gives the same output as id -un as shown below:

$ id -un
john
 
who am i command will display the logged-in user name and current tty details. The output of this
command contains the following columns: logged-in user name, tty name, current time with date and
ip-address from where this users initiated the connection.

$ who mom likes

4. Get the user login history at any time


last command will give login history for a specific username. If we don’t give any argument for this
command, it will list login history for all users. By default this information will read from
/var/log/wtmp file. The output of this command contains the following columns:
 User name
 Tty device number
 Login date and time
 Logout time
 Total working time

$ last jason
jason pts/0 dev-db-server Fri Mar 27 22:57 still logged in
jason pts/0 dev-db-server Fri Mar 27 22:09 - 22:54 (00:45)
jason pts/0 dev-db-server Wed Mar 25 19:58 - 22:26 (02:28)
jason pts/1 dev-db-server Mon Mar 16 20:10 - 21:44 (01:33)
jason pts/0 192.168.201.11 Fri Mar 13 08:35 - 16:46 (08:11)
jason pts/1 192.168.201.12 Thu Mar 12 09:03 - 09:19 (00:15)
jason pts/0 dev-db-server Wed Mar 11 20:11 - 20:50 (00:39

 
Experiment:-10

Aim : To study and execute touch command.

The touch command is a standard program for Unix/Linux operating systems, that is used to create,


change and modify timestamps of a file.

1. How to Create an Empty File

The following touch command creates an empty (zero byte) new file called sheena.

2. How to Create Multiple Files

By using touch command, you can also create more than one single file. For example the following
command will create 3 files named, sheena, meena and leena.

3. How to Change File Access and Modification Time

To change or update the last access and modification times of a file called leena, use the -a option as
follows. The following command sets the current time and date on a file. If the leena file does not
exist, it will create the new empty file with the name.

The most popular Linux commands such as find command and ls command uses timestamps for
listing and finding files.
4. How to Avoid Creating New File

Using -c option with touch command avoids creating new files. For example the following command
will not create a file called leena if it does not exists.

5. How to Change File Modification Time

If you like to change the only modification time of a file called leena, then use the -m option with
touch command. Please note it will only updates the last modification times (not the access times) of
the file.

6. How to Use the time stamp of another File

The following touch command with -r option, will update the time-stamp of file meena with the
time-stamp of leena file. So, both the file holds the same time stamp.
Experiment:-11

Aim : To study and execute calendar command.

Linux calendar – ncal and cal examples

You can also use ncal utility for the same :

You can see that complete month was displayed with highlighted current date. If you want,
highlighting can be turned off using -h option with cal utility.

display Julian calendar

display date of Easter?


For Easter date, use ncal utility with -e option.

$ ncal –e
display Julian days

For Julian days (one-based and numbered from January 1), use -j option with cal utility.

Here is an example :

display a specified month (ie a month different from current month)


. For this, use -m option followed by a decimal number representing month.
Here is an example :

$ cal -m1

You can see that by default year is assumed as current year.

display previous, requested and next month?


This can be achieved by using -3 option.

$ cal -3 -m3 1984


display date of orthodox Easter

This can be done using ncal utility with -o option.


Here is an example :

$ ncal -o5 May 2013

display week numbers : Observe that the week numbers are listed in the last

display country codes

For country codes, execute ncal utility with -p option.


Here is an example :

Display complete calendar for a year ncal –y 2011


So we see that complete calendar for year 2011 was displayed in output.
Experiment:-12

Aim : To study and execute grep command.

The name, "grep", derives from the command used to perform a similar operation, using the
Unix/Linux text editor ed:
g/re/p

The grep command syntax


The syntax is as follows:

grep'word' filename
grep'word' file1 file2 file3
grep'string1 string2' filename
cat otherfile | grep'something'
command | grep'something'
command option1 | grep'data'
grep --color 'data' fileName
 

use grep command to search a file

Search /etc/passwd file for boo user, enter:


$ grep boo /etc/passwd
Sample outputs:

foo:x:1000:1000:foo,,,:/home/foo:/bin/ksh

You can force grep to ignore word case i.e match boo, Boo, BOO and all other combination with
the -i option:
$ grep -i "boo" /etc/passwd
Experiment:-13

Aim: To study and execute ps command.

Process is a running instance of a program. Linux is a multitasking operating system, which means
that more than one process can be active at once. Use ps command to find out what processes are
running on your system.

1. List Currently Running Processes (ps -ef, ps -aux)

Its a commonly used example with a ps command to list down all the process which are currently
running in a machine. The following example shows the options of ps command to get all the
processes. $ ps -ef

Where:

 -e to display all the processes.


 -f to display full format listing.
In case of BSD machines, you can use ‘ps -aux’ will give the details about all the process as shown
above.

$ ps –aux : List the Process based on the UID and Commands (ps -u, ps -C)
Use -u option to displays the process that belongs to a specific username. When you have multiple
username, separate them using a comma. The example below displays all the process that are owned
by user wwwrun, or postfix.

$ ps -f -u wwwrun,postfix

Often ps is used with grep like “ps -aux | grep command” to get the list of process with the given
command. But ps command itself has an option to achieve the same. The following example shows
that all the processes which has tatad.pl in its command execution.

$ ps -f -C tatad.pl
3. List the processes based on PIDs or PPIDs (ps -p, ps –ppid)
Each process will be assigned with the unique Process ID (PID).

When you launch some application, it might fork number of processes and each sub process will
have its own PID. So, each process will have its own process id and parent processid.

For all the processes that a process forks will have the same PPID (parent process identifier). The
following method is used to get a list of processes with a particular PPID.

$ ps -f --ppid 9576

4. List Processes in a Hierarchy (ps –forest)

The example below display the process Id and commands in a hierarchy. –forest is an argument to ps
command which displays ASCII art of process tree. From this tree, we can identify which is the
parent process and the child processes it forked in a recursive manner.

5. List elapsed wall time for processes (ps -o pid,etime=)


If you want the get the elapsed time for the processes which are currently running ps command
provides etime which provides the elapsed time since the process was started, in the form
[[dd-]hh:]mm:ss.

The below command displays the elapsed time for the process IDs 1 (init) and process id 29675.
For example “10-22:13:29″ in the output represents the process init is running for 10days,
22hours,13 minutes and 29seconds. Since init process starts during the system startup, this time will
be same as the output of the ‘uptime’ command.

# ps -p 1,29675 -o pid,etime=

PID

1 10-22:13:29

29675 1-02:58:46

6. List all threads for a particular process (ps -L)


You can get a list of threads for the processes. When a process hangs, we might need to identify the
list of threads running for a particular process as shown below.

You might also like