0

operating systems Online Quiz - 49

Description: operating systems Online Quiz - 49
Number of Questions: 20
Created by:
Tags: operating systems
Attempted 0/20 Correct 0 Score 0
  1. a. test $a –eq $b

  2. b. test $a –equal $b

  3. c. test $a = $b

  4. d. sh –c test $a == $b


Correct Option: C

Which of the following would return the process ID of the sleep command

  1. a. sleep 1 & echo $

  2. b. sleep 1 & echo $#

  3. c. sleep 1 & echo $$

  4. d. sleep 1 & echo $!

  5. e. sleep 1 && echo $0


Correct Option: D
  1. a. $tree = maple;echo $tree

  2. b. tree = maple; echo $tree

  3. c. tree=maple; export $tree; sh –c “echo $tree”

  4. tree=maple; export tree; sh -c "echo $tree"


Correct Option: D
Explanation:

To solve this question, the user needs to have knowledge of basic programming and shell scripts.

Option A is incorrect because the variable $tree is not enclosed in quotes, which will result in a syntax error. The correct way to assign a string value to a variable in PHP is to enclose it in quotes. Thus, the correct syntax for option A is $tree = "maple";echo $tree

Option B is incorrect because the variable tree is not preceded by a dollar sign $, which will result in a syntax error. Thus, the correct syntax for option B is $tree = "maple"; echo $tree

Option C is incorrect because the export command is used to set an environment variable so that it can be accessed by child processes. In this case, the sh -c command creates a new shell process and prints the value of the environment variable $tree. However, since the variable was not exported, it will not be accessible by the new shell process, and the output will be empty. Thus, the correct syntax for option C is tree=maple; export tree; sh –c "echo $tree"

Option D is correct because it correctly assigns the string value "maple" to the variable tree, exports it so that it can be accessed by child processes, and then prints its value using the sh -c command. Thus, the correct answer is:

The Answer is: D

  1. a. case “dog” in *) echo cat;; esac

  2. b. case “cat” in cat) echo$1 exit

  3. c. case cat dog rabbit; echo $1

  4. d. echo cat | case $1 in cat) echo $1 ;; esac

  5. e. case (cat dog rabbit) {echo $2}


Correct Option: A
  1. a. for n in one two three ; do echo –n $n ; done

  2. b. for val ; do echo –n $val ; done

  3. for n in one two three ; do echo -n $n ; done

  4. d. foreach n in one two three; do echo –n $n ; done

  5. e. foreach n in one two three { echo –n $n }


Correct Option: C
  1. Gnome not Unix

  2. GNU not unix.

  3. gnome

  4. gnometrics


Correct Option: B

which command is used to display the network interfaces in a linux system.

  1. ipconfig

  2. ifconfig

  3. netstat

  4. neat


Correct Option: B

what is K means in KDE sessions.

  1. killer

  2. knome

  3. K (just k, alphabet before L)

  4. kick


Correct Option: C

command for listing file contents page wise

  1. less

  2. huge

  3. make

  4. take


Correct Option: A
  1. dir

  2. show contents

  3. show dir contents

  4. ls


Correct Option: D

what is the name of Linux boot loader

  1. lilo

  2. grub

  3. ntloader

  4. booter


Correct Option: B

what is essential partition in installing linux

  1. swap

  2. etc

  3. root or /

  4. var


Correct Option: C

how much amount of disk space is needed for a swap partition in general

  1. 4 times to RAM

  2. 3 Times to RAM

  3. 2 times to RAM

  4. RAM size


Correct Option: C

using root user in a GUI environment is a security issue ??

  1. yes

  2. no

  3. cant say

  4. dont know


Correct Option: A
- Hide questions