X hits on this document

177 views

0 shares

0 downloads

0 comments

35 / 93

Page 35 of 93

JAWAHARLAL NEHRU TECHNOLOGICAL UNIVERSITY

HYDERABAD

II Year B.Tech. IT I-SemT P C

032

UNIX AND SHELL PROGRAMMING LAB

Objectives:

To teach students various unix utilities and shell scripting

Recommended Systems/Software Requirements:

Intel based desktop PC with minimum of 166 MHZ or faster processor with atleast 64 MB RAM and 100 MB free disk space LAN Connected

Any flavour of Unix / Linux

Week1

Session-1

a)Log into the system

b)Use vi editor to create a file called myfile.txt which contains some

           text.

c)correct typing errors during creation.

d)Save the file

e)logout of the system

Session-2

a)Log into the system

b)open the file created in session 1

c)Add some text

d)Change some text

e)Delete some text

f)Save the Changes

g)Logout of the system

Week2

a)Log into the system

b)Use the cat command to create a file containing the following data. Call it mytable use tabs to separate the fields.

1425Ravi15.65

4320Ramu26.27

6830Sita36.15

1450Raju21.86

c)Use the cat command to display the file, mytable.

d)Use the vi command to correct any errors in the file, mytable.

e)Use the sort command to sort the file mytable according to the first field. Call the sorted file my table (same name)

f)Print the file mytable

g)Use the cut and paste commands to swap fields 2 and 3 of mytable. Call it my table (same name)

h)Print the new file, mytable

i)Logout of the system.

Week3

1) a)Login to the system

b)Use the appropriate command to determine your login shell

c)Use the /etc/passwd file to verify the result of step b.

d)Use the who command and redirect the result to a file called myfile1. Use the more command to see the contents of myfile1.

e)Use the date and who commands in sequence (in one line) such that the output of date will display on the screen and the output of who will be redirected to a file called myfile2. Use the more command to check the contents of myfile2.

2)a)Write a sed command that deletes the first character in each line in a

             file.

Document info
Document views177
Page views177
Page last viewedFri Oct 28 23:42:18 UTC 2016
Pages93
Paragraphs3102
Words29541

Comments