Tag: operating systems

Questions Related to operating systems

  1. change to home directory

  2. change directory to last directory as saved in the environment variable OLDPWD

  3. move to the last directory of that structure

  4. None of these


Correct Option: B
  1. The DayLight Saving Time

  2. The Time zone

  3. blanck line

  4. You will have to set the value of TZ variable first


Correct Option: B
  1. grep shows different values for $? while awk always shows $?=0

  2. grep is faster and works on rows level

  3. awk can only work on field level

  4. grep has -i option which can be used for ignoring case.


Correct Option: A

What is the command to check all active volume groups on AIX?

  1. lsvg

  2. lsvg -o

  3. lsvg -a

  4. activevg


Correct Option: B

What is the output of the above command?

  1. 3*2

  2. 6

  3. syntax error

  4. Blanck Line


Correct Option: A

What is the command to execute the executable script test.sh in the current shell?

  1. ./test.sh

  2. . test.sh

  3. sh test.sh

  4. exec test.sh


Correct Option: B

AI Explanation

To execute the executable script test.sh in the current shell, the correct command is:

B. . test.sh

Explanation:

Option A) ./test.sh - This option is incorrect because it uses the dot slash notation to execute the script in a subshell, not the current shell.

Option B) . test.sh - This option is correct. The dot command, also known as the source command, is used to execute a script in the current shell. When you use the dot command followed by a space and the script name, it executes the script in the current shell environment.

Option C) sh test.sh - This option is incorrect because it runs the script using the sh command, which launches a new shell to execute the script.

Option D) exec test.sh - This option is incorrect because the exec command is used to replace the current shell process with the specified command. In this case, it would replace the shell with the execution of the test.sh script, which is not the desired behavior.

The correct answer is B. The command ". test.sh" is used to execute the executable script test.sh in the current shell.

What is the command vim for?

  1. A shell

  2. An editor

  3. System Manager

  4. None of these


Correct Option: B
  1. The +x right is meaningless for directory

  2. To give permission to other users

  3. To move into that directory

  4. None of these


Correct Option: C