πŸ“Š Operating System Architecture
Q. Which of these is the correct method for appending “foo” in /tmp/bar file?
  • (A) echo foo > /tmp/bar
  • (B) echo foo >> /tmp/bar
  • (C) echo foo | /tmp/var
  • (D) /tmp/bar < echo foo
πŸ’¬ Discuss
βœ… Correct Answer: (B) echo foo >> /tmp/bar
πŸ“Š Operating System Architecture
Q. Syntax to suppress the display of command error to monitor?
  • (A) command > &2
  • (B) command 2> &1
  • (C) command 2> &2
  • (D) command 2> /dev/null
πŸ’¬ Discuss
βœ… Correct Answer: (D) command 2> /dev/null
πŸ“Š Operating System Architecture
Q. The following commands gives the output like this #cat file1 file2
#cat: file1: No such file or directory hello
If we execute the command “cat file1 file2 1>2 2>&1” the output would be
  • (A) cat: file1: no such file or directory hello
  • (B) no output is displayed
  • (C) cat: 1>2: no such file or directory
  • (D) hello
πŸ’¬ Discuss
βœ… Correct Answer: (B) no output is displayed
πŸ“Š Operating System Architecture
Q. cat < file1 >> file2 | file3
  • (A) file1 content will be appended to file2 and finally stored in file3
  • (B) file1 content will be appended to file2 and file3 will be ignored
  • (C) file2 and file3 will have same content
  • (D) syntax error
πŸ’¬ Discuss
βœ… Correct Answer: (D) syntax error
πŸ“Š Operating System Architecture
Q. Executing cat /etc/password > /dev/sda as superuser will
  • (A) write data into a regular file called /dev/sda
  • (B) write data to the physical device sda
  • (C) it
  • (D) none of the above
πŸ’¬ Discuss
βœ… Correct Answer: (B) write data to the physical device sda
πŸ“Š Operating System Architecture
Q. rom where would the read statement read if the following statements were executed? exec < file1 exec < file2 exec < file3 read line
  • (A) it would read all the files
  • (B) it would not read any files
  • (C) t would read all the files in reverse order
  • (D) it would read only file3
πŸ’¬ Discuss
βœ… Correct Answer: (B) it would not read any files
πŸ“Š Operating System Architecture
Q. In python, the list L contains the following elements : ['A', 1,'1','George']. Which of the following ways of slicing would assign only the first two elements to the variable X ?
  • (A) l[1:2]
  • (B) x=l[0:1]
  • (C) x=[l[0:2]
  • (D) none of the above
πŸ’¬ Discuss
βœ… Correct Answer: (C) x=[l[0:2]

Jump to