Experiment No 1
Experiment No 1
AIM:
To study about the basics of UNIX
UNIX:
It is a multi-user operating system. Developed at AT & T Bell Industries, USA in 1969.
LINUX:
It is similar to UNIX, which is created by Linus Torualds. All UNIX commands
works in Linux. Linux is a open source software. The main feature of Linux is
coexisting with other OS such as windows and UNIX.
STRUCTURE OF A LINUXSYSTEM:
It consists of three parts.
a) UNIX kernel
b) Shells
c) Tools and Applications
UNIX KERNEL:
Kernel is the core of the UNIX OS. It controls all tasks, schedule all
Processes and carries out all the functions of OS.
SHELL:
Shell is the command interpreter in the UNIX OS. It accepts command from
the user and analyses and interprets them
1|Page
Note: Syn->Syntax
a) date
–used to check
the date and time Syn:
$date
b) cal
–used to
display the
calendar Syn:
$cal 2 2009
c)echo
–used to print the message on the screen.
Syn:$echo “text”
d) ls
–used to list the files. Your files are kept in a directory.
ls[a-m]*List all the files whose name begin with alphabets From „a‟
to „m‟ ls[a]*List all the files whose name begins with „a‟ or „A‟
Eg:$ls>my list Output of „ls‟ command is stored to disk file named „my list‟
e)lp
–used
to take
printouts
Syn:$lp
filename
f)man
–used to provide manual help on every UNIX commands.
Syn:$man unix command
$man cat
h) uptime
–tells you how long the computer has been running since its last reboot or power-off.
Syn:$uptime
i)uname
–it displays the system information such as hardware platform, system name and
processor, OS type.
Syn:$uname–a 2|Page
j) hostname
–displays and set
system host name
Syn:$ hostname
Viewing:
Syn:$cat filename
Add text to an existing file:
Syn:$cat>>filename
Concatenate:
Syn:$catfile1file2>file3
$catfile1file2>>file3 (no over writing of file3)
e) cp–copies the
files or directories
Syn:$cpsource file
destination file Eg:
$cp student stud
Sync : :$head-2student
a) tail–displays last 10
lines of the file Syn:
$tail filename
Eg:$tail student
To display the bottom two lines;
Syn:$ tail -2 student
Features of vi:
It is easy to learn and has more powerful features.
Itworksgreatspeedandiscasesensitive.vihaspowerfulundofunctionsandhas3modes:
1. Command mode
2. Insert mode
3. Escape or ex mode
In command mode, no text is displayed on the screen.
In Insert mode, it permits user to edit insert
or replace text. In escape mode, it displays
commands at command line.
Moving the cursor with the help of h, l, k, j, I, etc
Motion Commands:
M-> Move to end of file
M-< Move to beginning of file
C-v Move forward a
screen M –v Move
backward a screen C –n
Move to next line C-p
Move to previous line
C-a Move to the
beginning of the line
C-e Move to the end 4|Page
of the line
C-f Move
forward a
character C-b
Move backward
a character M-f
Move forward a
word
M-b Move backward a word
5|Page