UNIX-Operating-System

Question 1
The difference between a named pipe and a regular file in Unix is that
A
Unlike a regular file, named pipe is a special file
B
The data in a pipe is transient, unlike the content of a regular file
C
Pipes forbid random accessing, while regular files do allow this.
D
All of the above
       Operating-Systems       UNIX-Operating-System       ISRO-2018
Question 1 Explanation: 
→ Named pipe is a special instance of a file that has no contents on the filesystem.
→ A FIFO special file (a named pipe) is similar to a pipe, except that it is accessed as part of the filesystem. It can be opened by multiple processes for reading or writing. When processes are exchanging data via the FIFO, the kernel passes all data internally without writing it to the filesystem. Thus, the FIFO special file has no contents on the filesystem; the filesystem entry merely serves as a reference point so that processes can access the pipe using a name in the filesystem.
→ The kernel maintains exactly one pipe object for each FIFO special file that is opened by at least one process. The FIFO must be opened on both ends (reading and writing) before data can be passed. Normally, opening the FIFO blocks until the other end is opened also.
Question 2
The Unix Kernel maintains two key data structures related to processes, the process table and the user structure. Which of the following information is not the part of user structure?
A
File descriptor table
B
System call state
C
Scheduling parameters
D
Kernel stack
       Operating-Systems       UNIX-Operating-System       UGC NET CS 2015 Jun- paper-2
Question 2 Explanation: 
The Unix Kernel maintains two key data structures related to processes, the process table and the user structure.
1. File descriptor table
2. System call state
3. Kernel stack
Scheduling parameters: Process priority, amount of CPU time consumed recently, amount of time spent sleeping recently. Together, these are used to determine which process to run next.
Question 3
Which of the following is not an Unix Command ?
A
Whoami
B
wc
C
ls
D
put
       Operating-Systems       UNIX-Operating-System       UGC NET CS 2005 june-paper-2
Question 3 Explanation: 
→ whoami: It lists the account name associated with the current login.
→ wc: It displays total word counts.
→ ls: It displays list of all files in a current folder.
**** There is no command called put.
Question 4
In UNIX, which of the following command is used to set the task priority ?
A
init
B
nice
C
kill
D
PS
       Operating-Systems       UNIX-Operating-System       UGC NET CS 2012 Dec-Paper-2
Question 4 Explanation: 
init (short for initialization) is the first process started during booting of the computer system. Init is a daemon process that continues running until the system is shut down. It is the direct or indirect ancestor of all other processes and automatically adopts all orphaned processes. Init is started by the kernel during the booting process; a kernel panic will occur if the kernel is unable to start it. Init is typically assigned process identifier 1.
nice directly maps to a kernel call of the same name. nice is used to invoke a utility or shell script with a particular priority, thus giving the process more or less CPU time than other processes. A niceness of −20 is the highest priority and 19 is the lowest priority. The default niceness for processes is inherited from its parent process and is usually 0.
kill It will kill the process
ps (short for "process status") displays the currently-running processes.
Question 5
Which UNIX/Linux command is used to make all files and sub-directories in the directory “progs” executable by all users ?
A
chmod− R a+x progs
B
chmod −R 222 progs
C
chmod−X a+x progs
D
chmod −X 222 progs
       Operating-Systems       UNIX-Operating-System       UGC NET CS 2018 JUNE Paper-2
Question 5 Explanation: 
Here, observe 2 key points is
1. All files and their subdirectories
2. Execute by all users
Step-1: Normally any file consists of 3 categories
1. Owner
2. Group
3. Others
Step-2: Every category is represented in 3 accesses.
1. Read(Octal value 4)
2. Write(Octal value 2)
3. Execute(Octal value 1)
Step-3: To change user permission, we are using command is chmod.
Chmod syntax: chmod permissions filename
1. All files and their subdirectories (using recursive command ‘R’)
2. Execute by all users(using ‘a+x’ subcommand. ‘a’ is nothing but all and ‘+x’ is execute permissions)
Actual command required: chmod− R a+x progs
Question 6
Consider the following UNIX command :
sort <in> temp; head – 30 <temp; rm temp Which of the following functions shall be performed by this command ?
A
Sort, taking the input from“temp”, prints 30 lines from temp and delete the file temp
B
Sort the file “temp”, removes 30 lines from temp and delete the file temp
C
Sort, taking the input from “in” and writing the output to“temp” then prints 30 lines from temp on terminal. Finally “temp” is removed.
D
Sort, taking the input from “temp” and then prints 30 lines from “temp” on terminal. Finally “temp” is removed
       Operating-Systems       UNIX-Operating-System       UGC NET CS 2013 June-paper-2
Question 6 Explanation: 
sort temp; → Sort, taking the input from “in” and writing the output to“temp”
head – 30 rm temp→ “temp” is removed.
Question 7
The ‘mv’ command changes
A
the inode
B
the inode-number
C
the directory entry
D
both the directory entry and the inode
       Operating-Systems       UNIX-Operating-System       UGC NET CS 2013 June-paper-2
Question 7 Explanation: 
mv (short for move) is a Unix command that moves one or more files or directories from one place to another. If both filenames are on the same filesystem, this results in a simple file rename; otherwise the file content is copied to the new location and the old file is removed.
Question 8
The Unix command used to find out the number of characters in a file is
A
nc
B
wc
C
chcnt
D
lc
       Operating-Systems       UNIX-Operating-System       UGC NET CS 2009 Dec-Paper-2
Question 8 Explanation: 
Word Count(wc) is perform following operations in a file
1. Newline count
2. Word count
3. Byte count
Question 9
An example of a directory found in most UNIX system is :
A
usr.
B
waitpid.
C
brk.
D
unmap.
       Operating-Systems       UNIX-Operating-System       UGC NET CS 2007-Dec-Paper-2
Question 9 Explanation: 
The “usr” directory is default location of user home directories.
Sub directories:
1. /usr/bin
2. /usr/include
3. /usr/lib
4. /usr/spool
5. /usr/tmp
6./usr/adm
Question 10
The “nice” command is used in Unix :
A
to decrease the priority of a process.
B
to increase the priority of a process.
C
to get the highest priority.
D
nothing to do with the priorities.
E
None of the above
       Operating-Systems       UNIX-Operating-System       UGC NET CS 2007 June-Paper-2
Question 10 Explanation: 
→ The “nice” command is used in Unix to decrease/increase the priority of a process.
→ A process with a lower niceness value is given higher priority and more CPU time. A process with a higher niceness value (a "nicer" process) is given a lower priority and less CPU time, freeing up resources for processes that are more demanding.
Question 11
The Sigmoid activation function f(t) is defined as:
A

B

C

D

       Operating-Systems       UNIX-Operating-System       UGC NET CS 2017 Nov- paper-3
Question 12
Consider the following statements :
(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 ?
A
only (a)
B
only (b)
C
Both (a) and (b)
D
Neither (a) nor (b)
       Operating-Systems       UNIX-Operating-System       UGC NET CS 2017 Nov- paper-3
Question 12 Explanation: 
→ UNIX provides three types of permissions using octal numbers
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 13
Match the following WINDOWS system calls and UNIX system calls with reference to process control and File manipulation.  
A
(a)-(iii), (b)-(iv), (c)-(i), (d)-(ii)
B
(a)-(iv), (b)-(iii), (c)-(i), (d)-(ii)
C
(a)-(iv), (b)-(iii), (c)-(ii), (d)-(i)
D
(a)-(iii), (b)-(iv), (c)-(ii), (d)-(i)
       Operating-Systems       UNIX-Operating-System       UGC NET CS 2017 Nov- paper-3
Question 13 Explanation: 
In UNIX Wait() system call is equivalent to windows system call is WaitForSingleObject() .
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 14
Unix command to change the case of first three lines of file “shortlist” from lower to upper
A
$ tr ‘[a – z]’ ‘[A – Z]’ shortlist ¦ head-3
B
$ head -3 shortlist ¦ tr ‘[a – z]’ ‘[A – Z]’
C
$ tr head -3 shortlist ‘[A – Z]’ ‘[a – z]’
D
$ tr shortlist head -3 ‘[a – z]’ ‘[A – Z]’
       Operating-Systems       UNIX-Operating-System       UGC NET CS 2017 Jan- paper-3
Question 14 Explanation: 
Head: The head command is a command-line utility for outputting the first part of files given to it via standard input. It writes results to standard output. By default head returns the first ten lines of each file that it is given.
tr: Translates lowercase to uppercase (or) uppercase to lowercase.
Option-B will display first three lines of file “shortlist” from lower to upper
Question 15
Match the following vi commands in Unix:  
A
a-ii, b-iii, c-i, d-iv
B
a-iv, b-iii, c-ii, d-i
C
a-iii, b-iv, c-i, d-ii
D
a-iii, b-i, c-iv, d-ii
       Operating-Systems       UNIX-Operating-System       UGC NET CS 2017 Jan- paper-3
Question 15 Explanation: 
: w → saves file and remains in editing mode
: x → saves the file and quits editingmode
: q → quits editing mode and no changes are saved to the file
: sh→ escapes unix shell
Question 16
The Unix Operating System Kernel maintains two key data structures related to processes, the process table and the user structure. Now, consider the following two statements :
I. The process table is resident all the time and contain information needed for all processes, even those that are not currently in memory.
II. The user structure is swapped or paged out when its associated process is not in memory, in order not to waste memory on information that is not needed.
Which of the following options is correct with reference to above statements ?
A
Only (I) is correct.
B
Only (II) is correct.
C
Both (I) and (II) are correct.
D
Both (I) and (II) are wrong.
       Operating-Systems       UNIX-Operating-System       UGC NET CS 2016 Aug- paper-3
Question 16 Explanation: 
TRUE: The process table is resident all the time and contain information needed for all processes, even those that are not currently in memory.
TRUE: The user structure is swapped or paged out when its associated process is not in memory, in order not to waste memory on information that is not needed.
Question 17
Consider the following operations to be performed in Unix :
“The pipe sorts all files in the current directory modified in the month of “June” by order of size and prints them to the terminal screen. The sort option skips ten fields then sorts the lines in numeric order.”
Which of the following Unix command will perform above set of operations ?
A
ls – l | grep “June” | sort +10n
B
ls – l | grep “June” | sort +10r
C
ls – l | grep – v “June” | sort +10n
D
ls – l | grep – n “June” | sort +10x
       Operating-Systems       UNIX-Operating-System       UGC NET CS 2016 Aug- paper-3
Question 17 Explanation: 
ls → It will display all files in a current directory.
ls -l → It will display full details(like permissions,links,size,type of file,file name,date of modification)
grep(global search for the regular expression) → The grep command is a filter that is used to search for lines matching a specified pattern and print the matching lines to standard output. sort → To sort either ascending order/descending order. By default it sorts ascending order. sort -n → To sort a file numerically used –n option. -n option is also predefined in unix as the above options are. This option is used to sort the file with numeric data present inside.
Option-A is the correct answer.
Question 18
Which of the following statement(s) is/are True regarding ‘nice’ command of UNIX ?
I. It is used to set or change the priority of a process.
II. A process’s nice value can be set at the time of creation.
III. ‘nice’ takes a command line as an argument.
A
I, II only
B
II, III only
C
I, II, III
D
I, III only
       Operating-Systems       UNIX-Operating-System       UGC NET CS 2016 Aug- paper-3
Question 18 Explanation: 
Nice directly maps to a kernel call of the same name. nice is used to invoke a utility or shell script with a particular priority, thus giving the process more or less CPU time than other processes. A niceness of −20 is the highest priority and 19 is the lowest priority. The default niceness for processes is inherited from its parent process and is usually 0.
Question 19
In UNIX, processes that have finished execution but have not yet had their status collected are known as _________.
A
Sleeping processes
B
Stopped processes
C
Zombie processes
D
Orphan processes
       Operating-Systems       UNIX-Operating-System       UGC NET CS 2016 July- paper-3
Question 19 Explanation: 
→ An orphan process is a computer process whose parent process has finished or terminated, though it remains running itself.

→ 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 20
In Unix operating system, when a process creates a new process using the fork () system call, which of the following state is shared between the parent process and child process?
A
Heap
B
Stack
C
Shared memory segments
D
Both Heap and Stack
       Operating-Systems       UNIX-Operating-System       UGC NET CS 2016 July- paper-3
Question 20 Explanation: 
A segment of memory that is shared between processes. The shared memory segments are sharing between the parent process and child process.
Question 21
Which of the following information about the UNIX file system is not correct?
A
Super block contains the number of i-nodes, the number of disk blocks, and the start of the list of free disk blocks.
B
An i-node contains accounting information as well as enough information to locate all the disk blocks that holds the file’s data.
C
Each i-node is 256-bytes long.
D
All the files and directories are stored in data blocks.
       Operating-Systems       UNIX-Operating-System       UGC NET CS 2016 July- paper-3
Question 21 Explanation: 
FALSE: Each i-node is 128 bytes long.
Question 22
Which of the following options with reference to UNIX operating system is not correct?
A
INT signal is sent by the terminal driver when one types and it is a request to terminate the current operation.
B
TERM is a request to terminate execution completely. The receiving process will clean up its state and exit.
C
QUIT is similar to TERM, except that it defaults to producing a core dump if not caught.
D
KILL is a blockable signal.
       Operating-Systems       UNIX-Operating-System       UGC NET CS 2016 July- paper-3
Question 22 Explanation: 
KILL

→ 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 23
What is the function of following UNIX command ?
WC – l <a  >b&
A
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.
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.
C
It counts the errors during the execution of a process, a, and puts the result in process b.
D
It copies the ‘l’ numbers of lines of program from file, a, and stores in file b.
       Operating-Systems       UNIX-Operating-System       UGC NET CS 2016 July- paper-3
Question 23 Explanation: 
wc [options] filenames
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 24
Which of the following statements is not correct with reference to cron daemon in UNIX O.S. ?
A
The cron daemon is the standard tool for running commands on a predetermined schedule.
B
It starts when the system boots and runs as long as the system is up.
C
Cron reads configuration files that contain list of command lines and the times at which they invoked.
D
Crontab for individual users are not stored.
       Operating-Systems       UNIX-Operating-System       UGC NET CS 2016 July- paper-3
Question 24 Explanation: 
→ The cron daemon is a long-running process that executes commands at specific dates and times.

→ 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 25
In Unix operating system, special files are used to:
A
buffer data received in its input from where a process reads
B
provide a mechanism to map physical device to file names
C
store list of file names plus pointers associated with i-nodes
D
store information entered by a user application program or utility program
       Operating-Systems       UNIX-Operating-System       UGC NET CS 2015 Dec - paper-3
Question 25 Explanation: 
Special files: Special files in UNIX operating system are used for I/O devices. In the file system they appear like an ordinary file or a directory. Special files are used to store information about the I/O devices.
Question 26
Match the following in Unix file system:

A
(a)-(iv), (b)-(i), (c)-(ii), (d)-(iii)
B
(a)-(i), (b)-(iii), (c)-(ii), (d)-(iv)
C
(a)-(iii), (b)-(i), (c)-(ii), (d)-(iv)
D
(a)-(iv), (b)-(ii), (c)-(i), (d)-(iii)
       Operating-Systems       UNIX-Operating-System       UGC NET CS 2015 Dec - paper-3
Question 26 Explanation: 
Boot block contains the code for making OS ready.
Super block contains information about file.
Inode contains information about file system.
Data block contains info regarding data storage.
Question 27
In Unix, the command to enable execution permission for file “mylife” by all is ____________.
A
Chmod ugo + X myfile
B
Chmod a + X myfile
C
Chmod + X myfile
D
All of the above
       Operating-Systems       UNIX-Operating-System       UGC NET CS 2015 Dec - paper-3
Question 27 Explanation: 
chmod→ chmod is the command and system call which is used to change the access permissions of file system objects (files and directories). It is also used to change special mode flags. The request is filtered by the umask. The name is an abbreviation of change mode.
ugo → user,group and others
a→ all permissions
+ → defaultly will take all permissions
R,W,X→ Read(R), Write(W) and Execute(X)
Question 28
What will be the output of the following Unix command ?  $rm chap0\[1 - 3\]
A
Remove file chap0[1 - 3]
B
Remove file chap01, chap02, chap03
C
Remove file chap\[1 - 3\]
D
None of the above
       Operating-Systems       UNIX-Operating-System       UGC NET CS 2015 Dec - paper-3
Question 28 Explanation: 
rm → It removes the file in a directory.
\ → It will remove matches with escape sequences in between files [chap0, chap1, chap2, chap3]
According to given command, Option-A is the appropriate answer.
There are 28 questions to complete.
PHP Code Snippets Powered By : XYZScripts.com