Tag: operating systems

Questions Related to operating systems

what is the command to change ownership of a file?

  1. change

  2. setfscl

  3. chown

  4. chmod


Correct Option: C
  1. test $a -eq $b

  2. test a -eq b

  3. test $a -equal $b

  4. test $a = $b


Correct Option: D

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

  1. sleep 1 & echo $!

  2. sleep 1 & echo $?

  3. sleep 1 & echo $#

  4. sleep 1 & echo $$


Correct Option: A

Which command will create a soft link to a file?

  1. ls -n

  2. ln

  3. ln -s

  4. link -s


Correct Option: C

How to search recursively in the directory structure to list the file named file1?

  1. ls -lrt file1

  2. ls -lR file1

  3. find . -s file1

  4. find . -name file1


Correct Option: D

How can you determine the number of positional parameter passed to the script ?

  1. $# will print the same

  2. $? will print the same

  3. $! will print the same

  4. $$ will print the same


Correct Option: A

How can we know two text files are identical?

  1. if the output of “cmp -s file1 file2” is not zero

  2. if the output of “cmp -s file1 file2” is zero

  3. if the output of “cmp -s file1 file2” is one

  4. if the output of “cmp -diff file1 file2” is zero


Correct Option: B