UNIX-Operating-System
Question 1 |
Which of the following commands or sequences of commands will rename a file x to file y in a unix system?
I. mv y,x II. mv x,y III. cp y, x(rm x) IV. cp x, y (rm x)
II and III | |
II and IV | |
I and III | |
II only |
Question 2 |
A user level process in Unix traps the signal sent on a Ctrl-C input, and has a signal handling routine that saves appropriate files before terminating the process. When a Ctrl-C input is given to this process, what is the mode in which the signal handling routine executes?
kernel mode | |
superuser mode | |
privileged mode | |
user mode |
Question 3 |
A student wishes to create symbolic links in a computer system running Unix. Three text files named "file 1", "file 2" and "file 3" exist in her current working directory, and the student has read and write permissions for all three files. Assume that file 1 contains information about her hobbies, file 2 contains information about her friends and file 3 contains information about her courses. The student executes the following sequence of commands from her current working directory
ln -s file 1 file 2 ln -s file 2 file 3
Which of the following types of information would be lost from her file system?
(I) Hobbies (II) Friends (III) Courses
(I) and (II) only | |
(II) and (III) only | |
(II) only | |
(I) and (III) only |
Question 4 |
The contents of the text file t1.txt containing four lines are as follows:
a1 b1 a2 b2 a3 b2 a4 b1
The contents of the text file t2.txt containing five lines are as follows:
a1 c1 a2 c2 a3 c3 a4 c3 a5 c4
Consider the following Bourne shell script:
awk - F''' {Print S1, S2} ' t1.txt | while read a b ; do awk -v aV = Sa - v bV = Sb - F'' 'aV = = S1 (print aV, bV, S2 )'t2.txt done
Which one of the following strings will NOT be present in the output generated when the above script in run? (Note that the given strings may be substrings of a printed line.)
"b1 c1" | |
"b2 c3" | |
"b1 c2" | |
"b1 c3" |
Question 5 |
Edits file1 and stores the contents of file1 in file2 | |
Both files i.e. file1 and file2 can be edited using 'ex' command to travel between the files | |
Both files can be edited using 'mv' command to move between the files | |
Edits file1 first, saves it and then edits file2 |
Question 6 |
Regular file | |
Directory file | |
Device file | |
Any one of the above |
Directory File: A directory file contains an entry for all files or subdirectories that it contains.
Special(device) file: It contains information about all the devices connected to the system.
Question 7 |
(a)-(iii), (b)-(iv), (c)-(i), (d)-(ii) | |
(a)-(iv), (b)-(iii), (c)-(i), (d)-(ii) | |
(a)-(iv), (b)-(iii), (c)-(ii), (d)-(i) | |
(a)-(iii), (b)-(iv), (c)-(ii), (d)-(i) |
In UNIX Fork() system call is equivalent to windows system call is Create-process().
In UNIX Create() system call is equivalent to windows system call is CreateFile().
In UNIX Close() system call is equivalent to windows system call is CloseHandle()
Question 8 |
(a) UNIX provides three types of permissions
* Read
* Write
* Execute
(b) UNIX provides three sets of permissions
* permission for owner
* permission for group
* permission for others
Which of the above statement/s is/are true ?
only (a) | |
only (b) | |
Both (a) and (b) | |
Neither (a) nor (b) |
1. Read(R or 4)
2. Write(W or 2)
3. Execute(X or 1)
→ UNIX provides three sets of permissions. Each set of permission we are having 3 types of permissions.
1. Permission for owner(RWX or 421)
2. Permission for group(RWX or 421)
3. Permission for others(RWX or 421)
→ We can change/modify permissions using chmod, chown,etc.., commands
→ We can see the permissions for every file using ls -l command
Question 9 |
cmp file 1 file 2 | |
comm. File 1 file 2 | |
diff file 1 file 2 | |
comp file 1 file 2 |
Question 10 |
cmp file 1 file 2 | |
comm. File 1 file 2 | |
diff file 1 file 2 | |
comp file 1 file 2 |
Question 11 |
chmod u–w,o+x file 1 | |
chmod u-w,o-w file 1 | |
cheperum u-w, o+e file 1 | |
chmod u-w,o+e file 1 |