0

operating systems Online Quiz - 4

Description: operating systems Online Quiz - 4
Number of Questions: 20
Created by:
Tags: operating systems
Attempted 0/20 Correct 0 Score 0

BSD is an acronym for what?

  1. Berkeley Software Distribution

  2. Berkel Software Distro

  3. Berkeley Systems Distribution

  4. Bourne Systems Distribution


Correct Option: A

Which Shell variable indicates search path for commands?

  1. IFS

  2. PATH

  3. SHLVL

  4. TERM


Correct Option: B

A local variable can be used by child processes of a shell.

  1. True

  2. False


Correct Option: B

What is the first process that comes into existence whenever system is booted?

  1. init

  2. shell

  3. kernel

  4. login


Correct Option: C

What is the process id and group id of the init process?

  1. 1,0

  2. 0,1

  3. 1,1

  4. 0,2


Correct Option: A

Which of these is not a valid mode in the VI editor in unix?

  1. command

  2. ex

  3. edit

  4. insert


Correct Option: C

Which is not a filter in unix?

  1. pg

  2. ksh

  3. awk

  4. grep


Correct Option: B

What is the command for listing all the background jobs?

  1. ps

  2. jobs

  3. processes

  4. kill


Correct Option: B

What is the command for killing the suspended job number three?

  1. kill $3

  2. kill <<3

  3. kill %3

  4. terminate #3


Correct Option: C

Which of the following does one need to log in to Unix?

  1. username

  2. password

  3. host name

  4. all of the above


Correct Option: D

Which command always puts you in your home directory?

  1. home

  2. cd

  3. cd . .

  4. pwd


Correct Option: B

What will the following command do? % chmod og+r *.jpg

  1. Change the permissions on all the .jpg file so that it is readable.

  2. It is not a valid command because the file name contains a *.

  3. Change the permissions on all image files

  4. Change permissions on the directory so that image files can be saved in it.


Correct Option: A

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) Change the permissions on all the .jpg file so that it is readable. - This option is correct. The chmod command is used to change the permissions of files and directories in Unix-like operating systems. In this command, og+r sets the read permission (r) for the owner (o) and the group (g) of each file. By using *.jpg, it selects all files with the .jpg extension, and changes their permissions to be readable.

Option B) It is not a valid command because the file name contains a . - This option is incorrect. The use of `` as a wildcard character is a valid syntax in Unix-like operating systems. It allows the command to be applied to multiple files or directories that match the specified pattern.

Option C) Change the permissions on all image files. - This option is incorrect. The command specifically targets files with the .jpg extension, not all image files. Only the permissions of the .jpg files will be changed, not other image files.

Option D) Change permissions on the directory so that image files can be saved in it. - This option is incorrect. The chmod command does not change the permissions of the directory itself, but rather the permissions of the files within that directory.

The correct answer is A) Change the permissions on all the .jpg file so that it is readable. This option is correct because the chmod og+r *.jpg command will change the permissions of all .jpg files, making them readable.

Predict the output of the following program code main() { fork(); printf("Hello World!"); }

  1. Hello World!Hello World!

  2. Hello World!

  3. World!Hello

  4. error


Correct Option: A

main(){ fork(); fork(); fork(); printf("Hello World!"); } How many times "Hello World!" will be printed?

  1. 2

  2. 4

  3. 6

  4. 8


Correct Option: D

AI Explanation

To determine how many times "Hello World!" will be printed, let's analyze the given code.

In the code, the fork() function is called three times consecutively. Each time the fork() function is called, it creates a new process by duplicating the existing process. So, the first fork() call creates one child process, the second fork() call creates two child processes (one from the original process and one from the child process of the first fork() call), and the third fork() call creates four child processes (one from the original process, two from the child processes of the second fork() call, and one from the child process of the first fork() call).

Therefore, a total of 1 + 2 + 4 = 7 child processes are created, in addition to the original process. Since each process executes the printf("Hello World!"); statement, it will be printed 8 times in total.

So, the correct answer is D) 8.

When creating a directory, which of the following is true?

  1. You use the pico Unix command to create a directory

  2. The default permissions are: r w x - - - - - -

  3. You must be in your home directory

  4. The directory name must end in _html


Correct Option: C

AI Explanation

To answer this question, let's go through each option to understand why it is correct or incorrect:

Option A) You use the pico Unix command to create a directory - This option is incorrect because the pico command is used for creating or editing text files, not directories.

Option B) The default permissions are: r w x - - - - - - - This option is incorrect because the default permissions for a newly created directory are typically "rwxr-xr-x" or "755". The permissions you listed, "rwx------", would give full access to the owner of the directory but no access to any other users.

Option C) You must be in your home directory - This option is correct because when creating a directory, you can do it from any location, including your home directory, or any other directory where you have write permissions.

Option D) The directory name must end in _html - This option is incorrect because there is no requirement for a directory name to end in "_html". The name can be anything you choose.

The correct answer is C) You must be in your home directory. This option is correct because you can create a directory from any location, including your home directory or any other directory where you have write permissions.

Developer Ken Thompson of the Bell Labs Team developed what game for GE's machines?

  1. .logout

  2. .clear

  3. leave out

  4. .leave


Correct Option: A

What files are run when you log in successfully?

  1. .cshrc

  2. .c

  3. .log

  4. .login


Correct Option: A,D
- Hide questions