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 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 3 |
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 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 |
Sleeping processes | |
Stopped processes | |
Zombie processes | |
Orphan processes |
→ A zombie process or defunct process is a process that has completed execution but still has an entry in the process table.
→ A process enters a Sleeping state when it needs resources that are not currently available. At that point, it either goes voluntarily into Sleep state or the kernel puts it into Sleep state. Going into Sleep state means the process immediately gives up its access to the CPU.
→ A stopped process is a stochastic process that is forced to assume the same value after a prescribed (possibly random) time.
Question 6 |
Heap | |
Stack | |
Shared memory segments | |
Both Heap and Stack |
Question 7 |
Super block contains the number of i-nodes, the number of disk blocks, and the start of the list of free disk blocks. | |
An i-node contains accounting information as well as enough information to locate all the disk blocks that holds the file’s data. | |
Each i-node is 256-bytes long. | |
All the files and directories are stored in data blocks. |
Question 8 |
INT signal is sent by the terminal driver when one types and it is a request to terminate the current operation. | |
TERM is a request to terminate execution completely. The receiving process will clean up its state and exit. | |
QUIT is similar to TERM, except that it defaults to producing a core dump if not caught. | |
KILL is a blockable signal. |
→ The kill command will kill a process using the kill signal and PID given by the user.
→ The kill command accepts either a signal number or name (signals have both a number and name that can be referenced). The name must be in all caps.
Question 9 |
WC – l <a >b&
It runs the word count program to count the number of lines in its input, a, writing the result to b, as a foreground process. | |
It runs the word count program to count the number of lines in its input, a, writing the result to b, but does it in the background. | |
It counts the errors during the execution of a process, a, and puts the result in process b. | |
It copies the ‘l’ numbers of lines of program from file, a, and stores in file b. |
WC → Word count
Options:
wc -l : Prints the number of lines in a file.
wc -w : prints the number of words in a file.
wc -c : Displays the count of bytes in a file.
wc -m : prints the count of characters from a file.
wc -L : prints only the length of the longest line in a file.
WC – l < a >b& → It runs the word count program to count the number of lines in its input, a, writing the result to b, but does it in the background.
Question 10 |
The cron daemon is the standard tool for running commands on a predetermined schedule. | |
It starts when the system boots and runs as long as the system is up. | |
Cron reads configuration files that contain list of command lines and the times at which they invoked. | |
Crontab for individual users are not stored. |
→ The crontab command creates a crontab file containing commands and instructions for the cron daemon to execute.
→ The cron daemon is the standard tool for running commands on a predetermined schedule.
→ It starts when the system boots and runs as long as the system is up.
→ Cron reads configuration files that contain list of command lines and the times at which they invoked.
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 |
