osy
osy
system. STEPS :
2) 1) Download the ISO file.
3) 2) Boot your system with Bootable DVD/USB drive. To start the installation click on
4) ―Install Ubuntu‖ .
5) 3) Check Install prerequisite.
6) 4) Select the Installation Type.
7) 5) Select your respective Time Zone.
8) 6) Select your respective Keyboard Layout.
9) 7) Set the Hostname of your system and User credentials that will be used after installation.
10) Installation has started. Once the installation is completed, it will ask to restart the
11) Machine. Click on ―Restart Now‖.
12) 8) Login Screen after reboot. Use the same user and its credentials that we have set during
13) the installation. We will get below screen after entering the credentials. Ubuntu
14) Installation is Completed Now.
2) Execute general purpose commands date, time, cal, clear, banner, tty, script, man.
$date it displays system date and timing
$cal displays calender of current type
$clear clear screen
$banner OSY display an argument string as a poster with max 10 char per line
$tty name of terminal
$script record login session
$man it gives mannual help for ANY COMMAND
3) Work with multiple linux terminals and basic commands: who, who am I, login, passwd, su,pwd.
$who used to displays who are users connected to our computer currently
4) Use Operating services(Editor, GUI, File handling.) b) Run commands to start, stop, and restart
the specified service in Linux.
Editor : There are many ways to edit files in Unix. Vi Editor works in Unix. This editor enables
you to edit lines in context with other lines in the file. You can also use this editor to just read a
text file. An improved version of the vi editor which is called the VIM has also been made
available now. Here, VIM stands for Vi Improved.
GUI : Linux system provides both the interface that is GUI and CLI.As per the requirement
you can decide when you should use the Linux command line interface (CLI) and when
you should use a graphical user interface (GUI).
File handling
b)
ps
Program running on the system are called as processes. For examining these
processes, users need to know about ps command.
This command is useful in producing the information for all the processes that are
running on the machine. The ps command is not easy to use as it presents number of parameters
that makes
it complicated.
2) wait
The wait is one of the built-in commands of Linux. It waits for the completion of
any running process.
Waits until all background processes are completed and then exits.
3) sleep
Sleep command is used to introduce delay for a specific time.This command helps
to pause a process for a given time.
Suffixes can be used with command to specify exact time. ―s‖ can be used for
seconds. ―m‖ can be used for minutes, ―h‖ can be used for hours and ―d‖ can be
used for days.
4) exit
Generally shell script will exit with the last command‘s exit status.
Used to quite the shell.
5) kill
Kill command is used to kill the process. User has to specify process ID for
killing the process.
Kill command sends TERMINATE signal to all the process IDs that are listed on
command line.
It may be difficult to use kill command as it uses process ID instead of its
command name.
For killing the process user should be the owner of process or must have logged in
from root user.
6) Execute file and directory manipulation commands- Is, rm, mv,cp, join, split, cat (File saving
and redirection operator), head, tail,touch,
7) Execute file and directory manipulation commands- diff, comm.,pr, chmod, mkdir, rmdir,
cd, pwd, dir, cmp. (Use wild cardcharacter).
1) mkdir Command
It is used to create a new directory in a current directory .
$ mkdir <directory Name>
Example : $ mkdir CM5I
User can create more than one directory in a single command .
$mkdir subject1 subject2
If user wants to create directory on the specific path them syntax is:
Syntax:
$mkdir path/ directory name
2) cd Command
The Cd command is used to change directory. You can use it to change to any directory
by specifying a valid absolute or relative path.
Syntax:
$cd <directory Name>
Example:
$cd Directory Name
$cd CM5I
$cd
To come out from current working directory.
Example :
$cd..
$cd/ It changes to root directory.
Example:
$cd/
3) rmdir Command
It is used to Delete/ remove directory. If the parent directory having subdirectories then
first all subdirectories will be deleted then the parent directory is deleted.
Syntax: $rmdir
4) pwd Command
Pwd stands for present working directory. This is most used linux command to see the
specific Unix directory on which the user is working on.
Syntax: $pwddiff command
This command is used to show difference between two text files . It also tells which line
in one has to be changed to make the two files identical .
Syntax:
$diff filename1 filename2
The operations of the result should be like this –
a - Added the text to file
c - changes are made in the file
d - deletion operation is performed
< - lines from the first file
> - lines from the second file
$cat file1.txt
I need to go to the shop
I need to buy some mangoes
When I get home , I‘ll wash the cat
$cat file12.txt
I need to go to the shop
I need to buy some mangoes
Oh yeah , I also need to by cheese
When I get home, I‘ll wash the cat
Use the diff command to compare both files.
$diff file1.txt file2.txt
The above command should give the result as shown below-
2a3
>oh yeah, I also need to by cheese
From the output 2a3 means ―After line 2 in the first file, a line to be added: line 3 from
the second file ―.
10) Write script for finding greatest number among given three
number. Ans.
echo "Enter number1 number : "
read n1
echo "Enter number2 number : "
read n2
echo "Enter number3 number : "
read n3if [ $n1 -gt $n2 ] && [ $n1 -gt $n3 ]
then
echo "$n1 is Greater"
elif [ $n2 -gt $n3 ]
then
echo "$n2 is Greater"
else
echo "$n3 is Greater"
fi
11) Write and execute Shell Script to display grade of student according to percentage(using if
statement)
12) Write and execute Shell Script for displaying table of given number(using for
13) Write and execute Shell Script for displaying sum of 5 digit no(using while
loop) read -n 5 -p 'Enter 5 digit number: ' no
sum1=0
while [ $no -gt 0 ]
do
i=$(( no % 10 ))
sum1=$(( sum1 + i ))
no=$(( no / 10 ))done
echo " Sum = $sum1"
14) Write Shell script to find out whether - File has read, write, and execute
permissions. echo ―Enter the File : ‖
read line
if [ -r $line ]
thenecho ―$line has all the read permissions‖
fi
if [ -x $line ]
then
echo ―$line has all the execute permissions‖
fi
if [ -w $line ]
then
echo ―$line has all the write permissions‖
fi
15) Write and execute Shell Script which accept a file name and assign it all the
8) Execute text processing tr, wc, cut, paste, spell, sort, grep, more.