Вы находитесь на странице: 1из 7

Second Year B. Tech.

(Information Technology) Semester I A


Practical Examination, 2015-16
Shell Programming Lab (IT 212)

Time : 3 Hr
1. Explain Unix Operating system and its features. 10
2. Write a shell script to print the Fibonacci series. 10
3. Write a C program to print the following pattern : 10

* *
* *
* * * *
* * * *
* * * * *
* * * *
* * * *
* *
* *

4. Write and execute the shell commands to do the following:


(i) Create a file named F1. Create a symbolic to F1. Now forcefully change the 2
owner and group of symbolic link to F1 to root and root.
(ii) Open a terminal. Now disable the write permission on that terminal. 2
(iii) To group and display the files in Home Directory with same extension together. 2
(iv) To determine the present operating state of OS. 2
(v) Create 3 files test1, test2 and test3. Insert some data in them. Now redirect the 2
contents of file test1 and test2 into test3 such that content of test3 doesn't get
overwritten.

5. Create a directory CTAE and make three files in it named: CSE, IT and ECE. 10
Now create another directory named DCE and make two files in it named CSE
and IT. Now copy the contents of file CSE in CTAE into file named CSE in
DCE such that user can restore the contents of CSE in DCE later if he/she
wants.
Second Year B. Tech. (Information Technology) Semester I B
Practical Examination, 2015-16
Shell Programming Lab (IT 212)

Time : 3 Hr
1. Explain Unix Operating system and its features. 10
2. Write a shell script to print the following pattern: 10

*
**
***
****
*****
****
***
**
*
3. Write a C program to reverse a string without using standard library functions. 10
4. Write and execute the shell commands to do the following:
(i) Change owner only if a file is owned by a particular user. 2
(ii) Create a directory named Dir. Create three files in it named A, B and C. 2
Now change the group of Dir and its contents to root.
(iii) Create a file named f1. Now insert 10 lines of data into it. Now display all but not 2
the last 4 lines.
(iv) Create a file named f2 and f3. Insert 10 lines into both f2 and f3. Now redirect 2
last five lines from f2 into f3 such that the contents of f3 does not get overwritten.
(v) To display all contents of a directory including hidden files/directories. 2

5. Create a directory University and make three files in it named CS_Students, 10


IT_Students and ECE_Students. Now copy these files into a Directory named
College. Now update the contents of file CS_Students and IT_Students in
University directory. Create one more file in University named Newfile.
Now copy only new/updated files from University to College directory.
Second Year B. Tech. (Information Technology) Semester I C
Practical Examination, 2015-16
Shell Programming Lab (IT 212)

Time : 3 Hr
1. Explain Unix Operating system and its features. 10
2. Write a shell script to check whether a given number is an Armstrong number or not. 10
3. Write a C program to print the following pattern: 10

* * * * * * * * *
* * * * * * * *
* * * * * *
* * * *
* *
* * * *
* * * * * *
* * * * * * * *
* * * * * * * * *

4. Write and execute the shell commands to do the following:


(i) Open G editor from terminal. Now determine the process id of this G editor without 2
using System Monitor. Now forcefully kill this G editor process.
(ii) Send some message from a user's terminal on another (or can be the same user )user's 2
terminal.
(iii) Create a file named list. Now redirect the contents of current working directory 2
into list in reverse alphabetical order.
(iv) Change the owner and group of all files in a directory recursively. 2
(v) To print the inode number of files. 2

5. Create a directory India and make two Sub-directories State and Territory in it. 10
Now create three files in State named Delhi, Chandigarh and Rajasthan and
create one file named Delhi in Territory. Now move the file Chandigarh and
Delhi from State to Territory such that if user wants, then he/she can later on
restore the file affected due to previous operation in Territory.
Second Year B. Tech. (Information Technology) Semester I D
Practical Examination, 2015-16
Shell Programming Lab (IT 212)

Time : 3 Hr
1. Explain Unix Operating system and its features. 10
2. Write a shell script to print the following pattern: 10
*
**
***
****
*****
****
***
**
*.
3. Write a C program to print a file page-wise: 10
4. Write and execute the shell commands to do the following:
(i) Create a file named F1. Create a symbolic to F1. Now forcefully change the 2
owner and group of symbolic link to F1 to root and root.
(ii) Open a terminal. Now disable the write permission on that terminal. 2
(iii) To group and display the files in Home Directory with same extension together. 2
(iv) To determine the present operating state of OS. 2
(v) Create 3 files test1, test2 and test3. Insert some data in them. Now redirect the 2
contents of file test1 and test2 into test3 such that content of test3 doesn't get
overwritten.

5. Create a directory CTAE and make three files in it named: CSE, IT and ECE. 10
Now create another directory named DCE and make two files in it named CSE
and IT. Now copy the contents of file CSE in CTAE into file named CSE in
DCE such that user can restore the contents of CSE in DCE later if he/she
wants.
Second Year B. Tech. (Information Technology) Semester I E
Practical Examination, 2015-16
Shell Programming Lab (IT 212)

Time : 3 Hr
1. Explain Unix Operating system and its features. 10
2. Write a shell script to check whether a given number is palindrome. 10
3. Write a C program to print the following pattern: 10

12344321
123**321
12****21
1******1

4. Write and execute the shell commands to do the following:


(i) Change owner only if a file is owned by a particular user. 2
(ii) Create a directory named Dir. Create three files in it named A, B and C. 2
Now change the group of Dir and its contents to root.
(iii) Create a file named f1. Now insert 10 lines of data into it. Now display all but not 2
the last 4 lines.
(iv) Create a file named f2 and f3. Insert 10 lines into both f2 and f3. Now redirect 2
last five lines from f2 into f3 such that the contents of f3 does not get overwritten.
(v) To display all contents of a directory including hidden files/directories. 2

5. Create a directory University and make three files in it named CS_Students, 10


IT_Students and ECE_Students. Now copy these files into a Directory named
College. Now update the contents of file CS_Students and IT_Students in
University directory. Create one more file in University named Newfile.
Now copy only new/updated files from University to College directory.
Second Year B. Tech. (Information Technology) Semester I F
Practical Examination, 2015-16
Shell Programming Lab (IT 212)

Time : 3 Hr
F1. Explain Unix Operating system and its features. 10
2. Write a shell script to print the following pattern: 10

* * * * *
* * * *
* * *
* *
*
* *
* * *
* * * *
* * * * *

3. Write C programs to : 10
a) Find the smallest and the largest element in an array.
b) To find whether given number is prime or not.

4. Write and execute the shell commands to do the following:


(i) Open G editor from terminal. Now determine the process id of this G editor without 2
using System Monitor. Now forcefully kill this G editor process.
(ii) Send some message from a user's terminal on another (or can be the same user )user's 2
terminal.
(iii) Create a file named list. Now redirect the contents of current working directory 2
into list in reverse alphabetical order.
(iv) Change the owner and group of all files in a directory recursively. 2
(v) To print the inode number of files. 2

5. Create a directory India and make two Sub-directories State and Territory in it. 10
Now create three files in State named Delhi, Chandigarh and Rajasthan and
create one file named Delhi in Territory. Now move the file Chandigarh and
Delhi from State to Territory such that if user wants, then he/she can later on
restore the file affected due to previous operation in Territory.

Вам также может понравиться