Unix - Study Mode

[#706] In vi editor, forward search is performed using the command.
Correct Answer

(C) /pat

Explanation

Solution: In the vi editor, forward search is performed using the / command followed by the pattern you want to search for. This command allows you to search forward from the current cursor position for the specified pattern. So, /pat is the command used in the vi editor for forward search.

[#707] Which of the following special shell variables is used to process number of the last background job?
Correct Answer

(A) $!

Explanation

Solution: In Unix shell scripting, the $! special variable is used to process the number of the last background job. It holds the process ID (PID) of the last command run in the background. So, $! is the special shell variable used to process the number of the last background job.

[#708] Which option will be used with ps command to slow the entire command line of the process being run?
Correct Answer

-4

Explanation

Solution: In Unix/Linux , the ps command is used to display information about active processes. To show the entire command line of the process being run, the correct option is -f (full format) or -w (wide output) , not the given options. The commonly used options for displaying the full command line are: ps -f → Displays full-format listing, including command-line arguments. ps -ef → Shows all processes in full format. ps aux → Provides detailed information about all running processes. Since none of the given options (-4, -3, -1, -2) are correct, the correct answer is None of the above.

[#709] Which of the following command addresses all users who are currently hooked on?
Correct Answer

(C) wall

Explanation

Solution: In Unix, the wall command is used to send a message to all users who are currently logged in. It stands for "write all". This command sends a message to all terminals except those who have disabled messages using the mesg command. So, wall is the command that addresses all users who are currently hooked on.

[#710] Which command is used for printing the current working directory?
Correct Answer

(C) pwd