Professional Documents
Culture Documents
Practical Operating System-2
Practical Operating System-2
i) cal command
ii) cat(append)
iii) cat(concatenate)
iv)mv command
v)cp command
vi)man command
vii)date command
ii)grep command-
iv)tput (clear,highlight)-
i)clear-
ii) highlight
v)bc-
Output->
6. Write a shell script to find the factorial of a given number.
Ans-
Input->
Output->
Input->
Output->
Input->
Output->
Output->
Output->
12.Write a shell script to find the GCD (greatest common divisor) of two
numbers.
Ans-
Input->
Output->
Output->
Output->
15) Write a shell script to accept a login name. If not a valid login name
display message – “Entered login name is invalid”.
Ans-
Input->
Output->
16.Write a shell script to compare two files and if found equal asks the
user to delete the duplicate file.
Ans-
Input- >
Output->
17.Write a shell script to merge the contents of three files, sort the
contents and then display them page by page.
Ans-
Input->
Output->
18.Write a shell script to check whether the file have all the permissions
or not.
Ans-
Input->
Output->
Output->