Students Corner

Students Corner: Opereating System Multiple Choice Questions and Answers

1. To mount remote devices, you must put an entry into the file A. /etc/imports B. /etc/exports C. /dev/imports D. /dev/exports

The correct answer is B. /etc/exports. This file contains a list of local directories that are shared with remote hosts and the permissions that those remote hosts have on those directories. The /etc/imports, /dev/imports, and /dev/exports files do not exist and are not used for mounting remote devices.

2. When we execute a C program, CPU runs in ____ mode. A. user B. kernel C. supervisory D. system

When we execute a C program, the CPU runs in user mode. Therefore, the correct answer is A. “user.” In user mode, the CPU executes instructions that are part of the user program, but it cannot execute privileged instructions that are reserved for the operating system kernel in kernel mode. Supervisory and system modes are not typically used in modern computer systems.

3. ______ is used for removing files. A. rm B. cd C. erase D. clear E. delete

The command used for removing files in most Unix-based systems (such as Linux and macOS) is rm. Therefore, the correct answer is A. rm. The cd command is used for changing the current working directory, erase and delete are commands used for removing files in some other operating systems (such as MS-DOS and Windows), and clear is a command used for clearing the terminal screen.

4. Server programs which provides remote network and administration services and is usually spawned automatically at system start-up are ……………… A. Daemons B. Init C. System Utilities D. Links E. Operating system.

Server programs that provide remote network and administration services and are usually spawned automatically at system start-up are called “daemons.” Therefore, the correct answer is A. “Daemons.” Daemons are background processes that run continuously and perform various tasks, such as handling incoming network requests or providing services to other programs. Init is a process management system in Unix-based operating systems that starts and stops other processes, system utilities are programs that perform various system-level tasks, links are shortcuts to files or directories, and the operating system is the core software that manages the hardware and provides services to other programs.

5. For restoring files using tar, the ____ option is used. A. -a B. -c C. -v D. -x
For restoring files using tar, the -x (or --extract) option is used. Therefore, the correct answer is D. -x. This option tells tar to extract files from the archive. The -a (or --auto-compress), -c (or --create), and -v (or --verbose) options are used for creating archives, compressing archives, and displaying verbose output, respectively.
6. _______ is the command used to show all processes running on the machine A. grep B. top C. kill D. ls E. cd

The command used to show all processes running on a machine is top. Therefore, the correct answer is B. top. When executed, the top command displays a dynamic real-time view of the system’s processes, including their resource usage and other information. The grep command is used to search for a specific pattern in a file or output, the kill command is used to terminate a running process, the ls command is used to list the contents of a directory, and the cd command is used to change the current working directory.

7. Which of the following is not a text editor in Linux or Unix? A. ed B. cat C. nano D. shell

Among the options listed, shell is not a text editor in Linux or Unix. Therefore, the correct answer is D. shell. A shell is a command-line interface used to interact with the operating system and run commands, but it is not a text editor. The ed, cat, and nano commands, on the other hand, are all text editors that can be used to create or edit files in Linux or Unix.

8. The Linux executables files is found in the directory A. /etc B. /bin C. /boot D. /lib

The Linux executable files are typically found in the /bin and /usr/bin directories. Therefore, the correct answer is B. /bin. The /bin directory contains essential command-line utilities and system executables that are required for basic system operations, such as file management, process control, and network configuration. The /etc directory contains system configuration files, the /boot directory contains boot loader files and the kernel image, and the /lib directory contains shared library files that are required by programs at runtime. While some executables may also be located in these directories, they are not primarily intended for holding executable files.

9. What command is used to list contents of directories on a server? A. tar B. dir C. lp D. ls

The command used to list the contents of directories on a server in most Unix-based systems (such as Linux and macOS) is ls. Therefore, the correct answer is D. ls. When executed, the ls command displays a list of files and directories in the current working directory, or in the specified directory. The tar command is used for creating and manipulating archive files, the dir command is used in some other operating systems (such as MS-DOS and Windows) to display the contents of directories, and the lp command is used for sending print jobs to a printer.

10. Adding a machine name to the file /etc/x0.host accomplishes which of the following: A. Restricts that machine to a particular X port. B. Allows that machine to use a specific X port. C. Restricts that machine from being accessed using X. D. Allows that machine to be accessed using X.

Adding a machine name to the file /etc/x0.host allows that machine to be accessed using X. Therefore, the correct answer is D. “Allows that machine to be accessed using X.”

The file /etc/x0.hosts is used to configure access control for the X Window System, which provides a graphical user interface for Unix-based systems. By adding a machine name to this file, you are specifying that the X server running on that machine is allowed to accept connections from other hosts that have access to the X display. This is a way of granting remote access to the X display for other machines on the network.

Option A, “Restricts that machine to a particular X port” and option B, “Allows that machine to use a specific X port” are not accurate descriptions of the function of the /etc/x0.hosts file. Option C, “Restricts that machine from being accessed using X” is the opposite of the correct answer, as adding a machine name to the file actually allows access to that machine using X.

11. The change directory command to move to the parent directory is A. cd ~ B. cd .. C. cd D. cd –

The change directory command to move to the parent directory is cd ... Therefore, the correct answer is B. cd ...

In Unix-based systems, the cd command is used to change the current working directory. The .. notation is used to refer to the parent directory, which is the directory that contains the current working directory. Therefore, cd .. moves up one level in the directory hierarchy and sets the parent directory as the current working directory.

Option A, cd ~, is used to change the current working directory to the user’s home directory. Option C, cd, is used to change the current working directory to the user’s home directory, which is the default behavior of the cd command with no arguments. Option D, cd -, is used to switch between the current and previous directories.

12. To remove/delete files in UNIX, what command do we use? A. rmdir B. rm C. del D. mv E. None of these

To remove or delete files in Unix-based systems (such as Linux and macOS), we use the rm command. Therefore, the correct answer is B. rm.

The rm command is used to delete files and directories in Unix-based systems. It can be used with various options to specify the behavior of the deletion operation. For example, the -r option is used to delete directories and their contents recursively, and the -f option is used to force deletion without prompting for confirmation.

Option A, rmdir, is used to remove empty directories. Option C, del, is not a valid command in Unix-based systems, but it is used in some other operating systems (such as MS-DOS and Windows) to delete files. Option D, mv, is used to rename or move files and directories, but it does not delete them. Therefore, the correct answer is B. rm.

13. cpio program can be used with redirection and piping. A. True B. False C. May be D. Can’t say

The statement “cpio program can be used with redirection and piping” is true. Therefore, the correct answer is A. True.

In Unix-based systems, the cpio command is used to create, extract, and manipulate archive files. It can read input from standard input (using redirection or piping) and write output to standard output (using piping). This makes it possible to use cpio in combination with other commands in shell scripts and command pipelines.

For example, the following command creates a tar archive of a directory and pipes it to cpio, which in turn extracts it to another directory:

ruby
tar cf - /path/to/directory | cpio -idm /path/to/destination

Here, the output of the tar command is piped to the input of the cpio command using the | (pipe) operator. The cpio command extracts the archive to the specified destination directory using the -idm options.

14. The popular Linux utility to search for text pattern matching in a file is A. Search B. Grep C. Locate D. Find

The popular Linux utility to search for text pattern matching in a file is grep. Therefore, the correct answer is B. grep.

grep is a powerful command-line tool for searching for text patterns in one or more files or streams. It stands for “global regular expression print”. It can search for text using a variety of regular expressions, and can perform advanced text processing tasks such as filtering and formatting.

For example, the following command searches for the word “example” in all files with the “.txt” extension in the current directory and its subdirectories:

perl
grep -r "example" *.txt

Here, the -r option tells grep to search recursively in subdirectories, and the *.txt argument specifies the file pattern to search. The output of the command is a list of filenames and line numbers where the matching pattern was found.

15. What are the names given to the various parts I, II and III respectively of the permission? Use the information below to answer this questions -rw- -w- -wx I II III A. user, group, others B. others, user, group C. others, user, group D. group, others, user E. User,others, group

The names given to the various parts I, II, and III of the permission are:

  • I: User permissions
  • II: Group permissions
  • III: Other (or world) permissions

Therefore, the correct answer is A. user, group, others.

In Unix-based systems, file and directory permissions are represented by a 10-character string that specifies the read, write, and execute permissions for the owner, group, and other users, respectively. The first character of the string indicates the file type (e.g., - for a regular file, d for a directory, etc.), while the remaining nine characters are divided into three groups of three characters each, representing the permissions for the owner, group, and other users, in that order. For example, the permission string -rw-r--r-- indicates that the owner has read and write permissions, while group and other users have only read permissions.

16. This RAID type works across disks A. RAID 5 B. RAID 1 C. RAID 6 D. RAID 0

The RAID type that works across disks is: D. RAID 0

RAID (Redundant Array of Inexpensive Disks) is a technology used to combine multiple physical disk drives into a single logical unit for data storage, with the goal of improving performance, reliability, or both. RAID 0, also known as striping, is a configuration that distributes data evenly across two or more disks without redundancy, meaning that if one disk fails, all data is lost. However, this configuration provides improved read and write performance, as data can be read from or written to multiple disks simultaneously. Therefore, option D is the correct answer.

17. Which of the following offset is used with lseek system call to set the offset pointer to the end of the file? A. SEEK_SET B. SEEK_END C. SEEK_CUR D. SEEK_CR

The offset used with lseek system call to set the offset pointer to the end of the file is: B. SEEK_END

The lseek system call is used to change the file offset of the open file. It takes three arguments: file descriptor, offset, and whence. The whence argument specifies how the offset is interpreted. SEEK_SET seeks relative to the beginning of the file, SEEK_CUR seeks relative to the current file offset, and SEEK_END seeks relative to the end of the file. Therefore, option B is the correct answer.

18.  Another name for “root” is A. President B. Superuser C. Supervisor D. Manager

Another name for “root” is: B. Superuser

In Linux and Unix operating systems, “root” is the highest level of access, and the user with this level of access is often called the “superuser”. The superuser has complete control over the system, including the ability to modify system files, install software, and change system settings. Therefore, option B is the correct answer.

19. The first 20 lines in a file messages.txt can be displayed using which command? A. first -20 messages.txt B. head -20 messages C. first -20 messages.txt D. head -20 messages E. head -20 messages.txt

The first 20 lines in a file messages.txt can be displayed using which command?

The correct command to display the first 20 lines of a file messages.txt in Linux or Unix is: B. head -20 messages.txt

The head command is used to display the first few lines of a file, and the -20 option is used to specify the number of lines to display. Therefore, option B is the correct answer. Option A and C are incorrect because there is no command called “first” in Linux or Unix. Option D is incorrect because the file extension “.txt” is missing. Option E is also correct, but it includes the “.txt” file extension unnecessarily.

20. tar command uses ___ option for backing up files. A. -a B. -c C. -d D. -f

The correct answer is B. -c. The -c option is used with the tar command to create a new archive.

21. Two machines are on the same subnet if the following parts of each machine’s IP address are the same. A. First three numbers. B. Last three numbers. C. Only the first two numbers. D. The last number.

The correct answer is A. First three numbers. Two machines are on the same subnet if the first three numbers of their IP addresses are the same. These three numbers form the network identifier portion of the IP address, which identifies the network on which the device is located. The last number of the IP address is the host identifier portion, which identifies a specific device on the network.

22. The superuser can set the sticky bit. A. True B. False C. May be D. Can’t say

True. The superuser (root) can set the sticky bit on files and directories.

23. _______ is/are example(s) of system utility programs A. registry cleaners B. archives C. usb disk security D. a & b E. None of the above
B. archives
24. grep is used for…………… A. altering B. filtering C. copying D. assigning E. removing.

grep is used for filtering text based on a given pattern or regular expression.

25. A device file contains no data. A. True B. False C. May be D. Can’t say

True.

26. RAID 10 uses the functionalities of RAID A. 1 and 0 B. 6 C. 0 D. 5 and 0 E. 1

RAID 10 uses the functionalities of RAID 1 and 0.

27. write system call returns -1 when ___________ A. if disk fills up while write is in progress B. when file doesn’t exist C. if the file size exceeds the system’s limit D. if disk fills up while write is in progress and if the file size exceeds
write system call returns -1 when:

A. if disk fills up while write is in progress.

Note: write system call returns the number of bytes successfully written to a file or -1 in case of an error.

28. All the user information is stored in _____ A. etc/passwd B. bin/passwd C. bin/users/passwd D. etc/shadow

In most Linux/Unix systems, all user information is stored in the file /etc/passwd.

29. Which Linux command can be used to determine the available space on local hard-disk partitions? A. free B. df C. du D. fdisk

The Linux command that can be used to determine the available space on local hard-disk partitions is df.

30. The mv command in open source OS is used for A. Moving a file only B. Moving and renaming a file C. Moving a file while leaving the original copy D. Moves a file to be deleted

The mv command in open source OS is used for Moving and renaming a file.

31. Absolute pathnames always begin with this symbol. A. / B. \ C. – D. ~ E. $

Answer : A. /

32. Which of the user account has the highest privilege? A. administrator B. root C. guest D. chroot

In Linux, the user account with the highest privilege is the root account.

33. Which command is appropriate for browsing the web on text only? A. wget B. netscape C. lynx D. ftp E. ping

The appropriate command for browsing the web on text only is C. lynx.

34. To check the number of hops from one router to another, we use the command __________. A. traceroute B. top C. nmap D. ping E. ifconfig

A. traceroute

35. The _______ operator is used to create concurrently executing processes that pass data directly to another A. pipe(|) B. pipe(/) C. pipe (\) D. pip (|) E. pip(\)

The correct answer is A. pipe(|).

36. The main disadvantage of using the /tmp directory to store uninstalled software is which of the following: A. The /tmp directory is in its small partition that may run out of disk space. B. The /tmp directory is a temporary location that system administrators regularly empty without warning. C. The /tmp directory is readable by the public and thus a security risk D. Access to the /tmp directory is usually restricted to administrators.

B. The /tmp directory is a temporary location that system administrators regularly empty without warning.

37. Which of these is not an example of Linux server distribution? A. Ubuntu B. Redhat C. Kali Linux D. Google Chrome OS E. Fedora

D. Google Chrome OS is not an example of Linux server distribution. It is a Linux-based operating system designed by Google primarily for web applications.

38. chgrp is used to ______ A. set file permission B. change the group that a file or directory belongs to C. investigate the contents of a file D. searching a large filespace E. searches the named files

chgrp is used to change the group that a file or directory belongs to.

Asonya Gh

Asonya Gh is an entrepreneur, an entertainment and lifestyle blogger based in the Upper West Region of Ghana. He is also the CEO of OneMuzikGh.Com, a website that covers news and updates about music, events and celebrities in Ghana. He has won several awards for his blogging work. He also has a Twitter account and a Facebook page where he posts his content and interacts with his followers.

Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Back to top button

Discover more from Asonya Gh

Subscribe now to keep reading and get access to the full archive.

Continue reading