Tag: operating systems

Questions Related to operating systems

What does lspv do?

  1. List all physical volumes

  2. List all physical partitions

  3. List all logical partitions

  4. List PP size


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) List all physical volumes - This option is correct because lspv is a command in Linux/Unix systems that lists all the physical volumes (disks or disk partitions) on the system.

Option B) List all physical partitions - This option is incorrect because lspv does not list physical partitions. To list physical partitions, you would use the fdisk or parted command.

Option C) List all logical partitions - This option is incorrect because lspv does not list logical partitions. To list logical partitions, you would use the lvdisplay or lvscan command.

Option D) List PP size - This option is incorrect because lspv does not list the PP (Physical Partition) size. To view the PP size, you would use the lspv -l command.

The correct answer is Option A) List all physical volumes. This option is correct because lspv is a command that lists all the physical volumes on the system.

  1. Its gets displayed when a command continues to next line.

  2. It is reserved for root user

  3. It is used for defining the default character used to commenting a line for a particular shell.

  4. None of these


Correct Option: A

The /etc/passwd file does not have write permission for others and group. Still the non root users when use the command 'passwd' are actually updating the /etc/passwd file . How does unix allow this?

  1. Because of the principle of SUID

  2. Because the passwd command lies in /usr/bin

  3. /etc/passwd is a special file and so it is allowed

  4. None of these


Correct Option: A

What will happen if I execute a shell script with -x options

  1. Will only show a preview of the execution and will not actually execute the script

  2. Show verbose messages of the execution and helps in debugging

  3. This is called safe-execution.

  4. None of these


Correct Option: B
  1. Yes, use smitty hostname and reboot is not required

  2. No, We have to change and to make it permanent we have to reboot the server

  3. Depends on the runlevel

  4. None of these


Correct Option: A

What wil be the output of this command?$ for i in 1 2 3;do echo "$i\c";done; Tell without trying on a server.

  1. 1c2c3c

  2. 123

  3. 1\c2\c3\c

  4. None of these


Correct Option: B

I am in a directory /tmp/test. $ pwd /tmp/test Now I deleted this directory from another session and fired the command pwd on the previous session. What will be the output of the pwd command?

  1. /tmp/test

  2. Directory does not exist

  3. /tmp

  4. None of these


Correct Option: A

$ i=1 $ j=A $ A1=hello These 3 variables are defined. Which of the following commands will display hello?

  1. eval echo ${j}${i}

  2. eval echo $${j}${i}

  3. eval echo \$${j}${i}

  4. None of these


Correct Option: C
  1. List all ordinary files in current directory that have been modified within the last 1 minute

  2. List all ordinary files in current directory that have been modified within the last 1 hour

  3. List all ordinary files in current directory that have been modified within the last 24 hours

  4. List all ordinary files in current directory that have been modified within the last 48 hours


Correct Option: C