0% found this document useful (0 votes)
15 views22 pages

Os Quiz

The document contains the results of an OS quiz taken on January 22, 2024, where the respondent scored 70 out of 75 points. It includes various questions related to Linux commands, operating system concepts, and programming outputs, along with the correct answers and the respondent's email. The quiz covers topics such as file management, CPU scheduling, and process management.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
15 views22 pages

Os Quiz

The document contains the results of an OS quiz taken on January 22, 2024, where the respondent scored 70 out of 75 points. It includes various questions related to Linux commands, operating system concepts, and programming outputs, along with the correct answers and the respondent's email. The quiz covers topics such as file management, CPU scheduling, and process management.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 22

OS QUIZ

Total points70/75

Quiz 22nd January 2024


The respondent's email ([email protected]) was recorded on submission of this
form.

28 of 30 points
Student ID*
Select your TNU ID

TNU2022053200055

Which of the following command is used to count the total number of lines, words,
and characters contained in a file?*
1/1

wc

wcount
ls -w
ls -lw

Identify the command which is used to remove files.


*
1/1

rw
rm

dm
erase

Among the following command which is used with vi editors to delete a single
character?
*
1/1

a
i
x
w

Identify the command which is used to remove files and empty folder.
*
1/1

rd
rm

rmdir
rmd

Identify the command which is used to create Linux File systems.


*
1/1

fsk
mkfs

make filesystems
fdisk

Which of the following is used to back up over typing errors in vi?


*
1/1

!
@
#

GNU stands for ______________________


*
1/1

Generic Unix
GNU's NOT Unix

Global Network Unix


General Global Unix
What is the core of the Linux operating system?
*
1/1

Terminal
Shell
Kernel

bash

In which of the following directory does the configuration files are present?
*
1/1

/bin
/root
/etc

/dev

Where is the user password stored?


*
2/2

/etc/passwd file
/etc/password file
/etc/shadow file

/etc/info

Identify the default file system type of Linux


*
0/1

ext3
NTFS
ext2
ext4

Which command is used to display the operating system name?


*
1/1
wc
uname

whoami
hostname

Which command is used to print a file


*
1/1

cat
ls
print
lp

Which option of ls command used to view file inode number


*
1/1

-I
-i

-- inode
-a

Identify the command which is used to display the unix version.


*
1/1

uname -a
uname -r

uname -i
uname -n

Using which of the following command can hidden files be viewed?


*
1/1

ls -a

ls -h
ls -ivh
ls -l
Which of the following is used to represent the top-level directory?
*
1/1

@
$
#

Which of the following command is used to sort the lines of data in a file in
alphabetical order?
*
1/1

ls -ls
sort

sort -r
flag -k

Identify this script which is run for setting a global defaults for users
*
1/1

/etc/profile file

/etc/profilerc file
/etc/bashrc file
/etc/profiles file

Linux Kernel was founded by?


*
1/1

Linus Torvalds

Dennis Ritchie
Ken Thompson
Ben Thomas
Which of the following command can force all buffers to disk?
*
1/1

flush
fflush
sync

buffer

To create a swap partition by using fdisk, which partition’s system ID type should be
used?
*
1/1

1
82

5
83

Which of the following command is used to change the working directory?


*
1/1

chdir
chdr
cd

change

LILO stands for ____________________


*
2/2

Last In Last Out


Linux Loader

Linux Last Order


Linux In Linux Out

Which among the following interacts directly with system hardware?


*
1/1

Shell
Commands
Kernel

Applications

Which command is used to display the unix version


*
0/1

uname -r

uname -n
uname -t
kernel

Which command is used to display disk consumption of a specific directory


*
1/1

du

ds
dd
dds

Which command is used to extract a column from a text file?


*
1/1

paste
get
cut

tar

33 of 35 points

Which of the following are NOT CPU scheduling algorithms?


*
0/1

Round Robin
FCFS
Priority

Cache Paging

FIFO scheduling is a type of _______________


*
1/1

Long-Term Scheduling
Preemptive Scheduling
Non-Preemptive Scheduling

Short-Term Scheduling

Which of the type of OS reads and reacts in terms of actual time?


*
1/1

Batch Processing OS
Time Sharing OS
Real Time OS

Multiple Time OS

Thread is a ____________________
*
1/1

Short Scheduling Process


Light Weight Process

I/O Process
Batch Scheduling Process

What is the main function of the command interpreter?


*
1/1

to provide the interface between the API and application program


to handle the files in the operating system
to handle the processes in the operating system
to get and execute the next user-specified command
To access the services of the operating system, the interface is provided by the
___________
*
1/1

Library
System calls

Assembly instructions
API

CPU scheduling is the basis of ___________


*
1/1

multiprogramming operating systems

larger memory sized systems


batch processing systems
multiprocessing operating systems

Which one of the following is not true?


*
1/1

kernel remains in the memory during the entire computer session


kernel is made of various modules which can not be loaded in running operating system

kernel is the first part of the operating system to load into memory during booting
kernel is the program that constitutes the central core of the operating system

If a process fails, most operating system write the error information to a ______
*
1/1

new file
another running process
log file

crash dump

Which one of the following is not a real time operating system?


*
1/1

RTLinux
Palm OS

QNX
VxWorks

What does OS X has?


*
1/1

monolithic kernel with modules


microkernel
monolithic kernel
hybrid kernel

In a timeshare operating system, when the time slot assigned to a process is


completed, the process switches from the current state to?
*
1/1

Suspended state
Terminated state
Ready state

Blocked state

When a process is in a “Blocked” state waiting for some I/O service. When the
service is completed, it goes to the __________
*
1/1

Ready state

Terminated state
Suspended state
Running state

Transient operating system code is a code that ____________


*
1/1
stays in the memory always
never enters the memory space
comes and goes as needed

is not easily accessible

The FCFS algorithm is particularly troublesome for ____________


*
1/1

operating systems
multiprocessor systems
time-sharing systems

multiprogramming systems

The operating system and the other processes are protected from being modified by
an already running process because ____________
*
1/1

every address generated by the CPU is being checked against the relocation and limit
registers

they have a protection algorithm


they are in different memory spaces
they are in different logical addresses

Using transient code, _______ the size of the operating system during program
execution.
*
1/1

maintains
changes

increases
decreases

To obtain better memory utilization, dynamic loading is used. With dynamic loading,
a routine is not loaded until it is called. For implementing dynamic loading
____________
*
1/1

special support from operating system is essential


special support from hardware is required
user programs can implement dynamic loading without any special support from hardware or
operating system

special support from both hardware and operating system is essential

The _________ presents a uniform device-access interface to the I/O subsystem,


much as system calls provide a standard interface between the application and the
operating system.
*
1/1

Device drivers

I/O systems
Devices
Buses

In real time operating system ____________


*
1/1

process scheduling can be done only once


all processes have the same priority
kernel is not required
a task must be serviced by its deadline period

If the sum of the working – set sizes increases, exceeding the total number of
available frames ____________
*
1/1

the operating system selects a process to suspend

the system crashes


then the process crashes
the memory overflows

The information about all files is kept in ____________


*
1/1

operating system
memory
separate directory structure

swap space

The operating system keeps a small table containing information about all open files
called ____________
*
1/1

file table
directory table
open-file table

system table

On systems where there are multiple operating system, the decision to load a
particular one is done by _____________
*
1/1

process control block


file control block
boot loader

bootstrap

The two steps the operating system takes to use a disk to hold its files are _______
and ________
*
0/1

caching & logical formatting


logical formatting & swap space creation

swap space creation & caching


partitioning & logical formatting

The _______ program initializes all aspects of the system, from CPU registers to
device controllers and the contents of main memory, and then starts the operating
system.
*
1/1

bootstrap

bootloader
kernel
system call

In SCSI disks used in high end PCs, the controller maintains a list of _________ on
the disk. The disk is initialized during ________ formatting which sets aside spare
sectors not visible to the operating system.
*
1/1

destroyed blocks, partitioning


bad blocks, low-level formatting

destroyed blocks, high-level formatting


bad blocks, partitioning

Which of the following system calls does not return control to the calling point, on
termination?
*
1/1

fork
exec

ioctl
longjmp

The following program results in the creation of?


main()
{
if(fork()>0)
sleep(100);
}
*
1/1

an orphan process
a zombie process

a process that executes forever


no process creates

How many times the following C program prints yes?


main()
{
fork();fork();printf("yes");
}
*
1/1

only once
twice
four times

eight times

Which of the following calls never returns an error?


*
1/1

getpid

fork
ioctl
open

What is the output of this program?


main()
{
fork();
printf("TNU\n");
return 0;
}
*
1/1

the string “TNU” will print 1 time


the string “TNU” will print 2 times

the string “TNU” will print 3 times


the string “TNU” will print 4 times

What is the output of this program?


main()
{
pid_t child;
child = fork();
printf("%d\n",child);
return 0;
}
*
1/1

it will print “0”


it will print the PID of the child process
it will print “0” & the PID of the child process

it will print nothing

What is the output of this program?


main()
{
pid_t child;
int status;
child = fork();
switch(child){
case -1 ;
perror("fork");
exit(1);
case 0 :
printf("%d\n",getppid());
break;
default :
printf("%d\n",getpid());
wait(&status);
break;
}
return 0;
}
*
1/1

this program will print two same integer values

this program will print two different integer values


this program will print nothing
segmentation fault

This program will print ____ as output.


main()
{
pid_t child;
child = fork();
switch(child){
case -1 :
perror("fork");
exit(1);
case 0 :
sleep(10);
printf("%d\n",getppid());
break;
default :
break;
}
return 0;
}
*
1/1

0
nothing
1

an integer value except 0 and 1 i.e. PID of a process

9 of 10 points

What is the output of this program?


main()
{
pid_t child;
int a, status;
a = 10;
child = fork();
switch(child){
case -1 :
perror("fork");
exit(1);
case 0 :
printf("%d\n",a);
break;
default :
wait(&status);
break;
}
return 0;
}
*
1/1

10

garbage value
segmentation fault
program will give an error because variable “a” is not defined in child process

What is the output of this program?


main()
{
pid_t child;
int status;
child = fork();
switch(child){
case -1 :
perror("fork");
exit(1);
case 0 :
exit(2);
break;
default :
wait(&status);
printf("%d\n",WEXITSTATUS(status));
break;
}
return 0;
}
*
1/1

0
1
2

What is the output of this progarm?


main()
{
execl("/bin/ls","ls",NULL);
return 0;
}
*
1/1

the program will execute nothing


the program will give an compilation error
the program will give segmentation fault
the program will execute just like “ls” command

How many times “TNU” will print in this program?


main()
{
if( execl("/bin/ls","ls",NULL) == -1){
perror("execl");
exit(1);
}
printf("TNU\n");
return 0;
}*
1/1

run time error


0
1
2

What is the output of this program?


main()
{
pid_t child;
int a, b;
a = 10;
b = 20;
child = fork();
a = a + b;
if(child > 0){
printf("%d\n",a);
}
return 0;
}
*
0/1

10
20
30

50

The kernel is _______ of user threads.


*
1/1

a part of
the creator of
unaware of

aware of

If a kernel thread performs a blocking system call, ____________


*
1/1

the kernel can schedule another thread in the application for execution
the kernel cannot schedule another thread in the same application for execution
the kernel must schedule another thread of a different application for execution
the kernel must schedule another thread of the same application on a different processor

The first linux kernel which supports the SMP hardware?


*
1/1

linux 0.1
linux 1.0
linux 1.2
linux 2.0

Which one of the following linux file system does not support journaling feature?
*
1/1

ext2

ext3
ext4

Standard set of functions through which interacts with kernel is defined by


___________
*
1/1

system libraries

kernel code
compilers
utility programs

Do not edit this field, click on SUBMIT


0 of 0 points
The field below is needed by Form Timer and must NOT be modified. If you modify this key
your answer will not be recorded.

Fingerprint - DO NOT EDIT*

Rn4DDp2O
This form was created inside of The Neotia University.
Forms

You might also like