Unix
Unix
TYBCA – Semester 5
502 UNIX and Shell Programming
Practical -1
Patel Jigisha
Rollno 29
2. Change to mydir
4. Using the cat command to create a file “student” containing the following data.
1425 ravi 15.65
4320 ramu 26.27
6830 sita 36.15
1450 raju 21.86
6 .Display login information about the user who issued this command.
ROLLNO:-29 1
502:-UNIX AND SHELL PROGRAMMING
7.List the files. Check the ls command with all the options.
1st
ROLLNO:-29 2
502:-UNIX AND SHELL PROGRAMMING
Practical 2
b. 29 06/29/95 12:01:11
ROLLNO:-29 3
502:-UNIX AND SHELL PROGRAMMING
ROLLNO:-29 4
502:-UNIX AND SHELL PROGRAMMING
8. Make a banner with the content "welcome to KBS and Natraj Science College".
9. Displays the information about the co-users with the column headings.
10. Display login information about the user who issued this command.
ROLLNO:-29 5
502:-UNIX AND SHELL PROGRAMMING
ROLLNO:-29 6
502:-UNIX AND SHELL PROGRAMMING
b. Divide 2 nos. While division Change the scale and check the result
ROLLNO:-29 7
502:-UNIX AND SHELL PROGRAMMING
ROLLNO:-29 8
502:-UNIX AND SHELL PROGRAMMING
Practical 3
1. Create your own file student.
2. Change the permissions of the file student to add execute privilege using relative
manner.
ROLLNO:-29 9
502:-UNIX AND SHELL PROGRAMMING
7. How do you move a file from one directory to another using Linux commands?
8. Count the number of lines, words and characters of the file “student”.
10. What is the command to change the ownership of a file or directory in Linux?
11. How do you check the contents of a file without opening it in Linux?
ROLLNO:-29 10
502:-UNIX AND SHELL PROGRAMMING
Practical -4
1. Which is the command to check currently login in Linux?
Output:
2. What command can you use to show running processes on a Linux system?
Output:
3. What command can you use to show detail processes information on a linux?
Output:
ROLLNO:-29 11
502:-UNIX AND SHELL PROGRAMMING
ROLLNO:-29 12
502:-UNIX AND SHELL PROGRAMMING
9. Create two files a1.txt and b1.txt. Then compare both files using cmp command
ROLLNO:-29 13
502:-UNIX AND SHELL PROGRAMMING
10.Use command and diff commands on these files and check the result.
ROLLNO:-29 14
502:-UNIX AND SHELL PROGRAMMING
PRACTICAL 5
1. Create a file using vi editor and navigate within the file.save the file.
ROLLNO:-29 15
502:-UNIX AND SHELL PROGRAMMING
4. Create a shell script to accept and check the highest no from two nos.
ROLLNO:-29 16
502:-UNIX AND SHELL PROGRAMMING
ROLLNO:-29 17
502:-UNIX AND SHELL PROGRAMMING
6. Write a shell script to text two strings which are equal or not
ROLLNO:-29 18
502:-UNIX AND SHELL PROGRAMMING
8. Write a shell script to count files, directories and symbolic link files drom
current directory.
ROLLNO:-29 19
502:-UNIX AND SHELL PROGRAMMING
Practical 6
1. Create a shell script to perform mathematical operations using case.
ROLLNO:-29 20
502:-UNIX AND SHELL PROGRAMMING
ROLLNO:-29 21
502:-UNIX AND SHELL PROGRAMMING
3. Write a shell script to check the highest no. from three inputted nos.
ROLLNO:-29 22
502:-UNIX AND SHELL PROGRAMMING
5. VNSGU ……
ROLLNO:-29 23
502:-UNIX AND SHELL PROGRAMMING
6. Write a shell script that computes the gross salary of employee according
to the following
1) if basic salary is <15000 then HRA 15% of the basic and DA =90% of
the basic
2) if basic salary is >15000 then HRA 500 and DA =98% of the basic
The basic salary is entered interactively through the key board.
ROLLNO:-29 24
502:-UNIX AND SHELL PROGRAMMING
Practical 7
1. Use “grep” command.
1. Find all lines in a file named records.txt that contain the word "KBS".
ROLLNO:-29 25
502:-UNIX AND SHELL PROGRAMMING
6. Search recursively for the word "Hello" in all files within the tybca
directory.
7. Display only the filenames that contain the word "password" in the /etcc directory.
ROLLNO:-29 26
502:-UNIX AND SHELL PROGRAMMING
Practical -8
ROLLNO:-29 27
502:-UNIX AND SHELL PROGRAMMING
ROLLNO:-29 28
502:-UNIX AND SHELL PROGRAMMING
PRACTICAL 9
• Use “sed” command.
1. Which one of the following command will be used for quitting after selecting 3 line
from file emp.lst?
5. Display the line 5, 10 and last line from the file emp.lst
ROLLNO:-29 29
502:-UNIX AND SHELL PROGRAMMING
7. Display data only even line number from the file emp.lst
10.To display permanently delete empty line from the file emp.lst
ROLLNO:-29 30