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
  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.

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.

  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

What command allows you to log in to a remote host securely?

  1. ssl

  2. slt

  3. ssh

  4. sl-rem


Correct Option: C

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
- Hide questions