WGU Operating Systems 1 Practice Test B

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Which option is used with the lilo command to test the changes made in the LILO configuration file?

-t The -t option is used with the lilo command to test the changes made in the LILO configuration file. It is not used to write a new boot sector or map file, but instead it is used for tests only. Using this option along with the -v helps users to find out what action the command is about to perform.

Which of the following files stores the default configuration settings of the dpkg files?

/etc/dpkg/dpkg.cfg

Which file lists the filesystems to be mounted automatically at startup?

/etc/fstab The /etc/fstab file contains a list of the filesystems to be mounted automatically at startup. The Linux system consults the /etc/fstab file whenever the mount command is executed during the boot process. If the line in the file contains any invalid entry of a filesystem, the system will not be able to mount it.

Which configuration file must be edited to alter the runlevel?

/etc/inittab To alter the runlevel, a user must edit the /etc/inittab file. The /etc/inittab file describes the processes that are started up during boot process. It specifies runlevels for each process. The format of an entry in the /etc/inittab file is as follows: id:runlevels:action:process where, id specifies a unique sequence of 1-4 characters, which identifies an entry in the inittab file. runlevels list the runlevel of a process for which the specified action should be taken. action specifies which action should be taken. process specifies the process to be executed.

Which two files contains the list of directories in which the ldconfig command searches the shared libraries?

/etc/ld.so.conf, /etc/ld.so.cache The /etc/ld.so.conf file contains the list of colon, space, tab, newline, or comma-separated directories in which the ldconfig command searches the shared libraries. The /etc/ld.so.cache file contains an ordered list of libraries found in the directories specified in /etc/ld.so.conf.

In what directory tree are you most likely to find programs compiled by the system administrator for general use (accessible by standard user accounts)?

/usr/local The /usr/local directory tree is intended to be used for storing local programs and files. Standard user accounts can typically access this directory. Content is often added after the operating system has been installed, sometimes compiled from source code tarballs or similar sources. Thus, option A is correct.

Which two runlevels cannot be used as the default runlevel on the Linux operating system?

0, 6 Runlevel 0 or 6 cannot be used as the default runlevel, since runlevel 0 is used to power off the Linux operating system and runlevel 6 is used to restart it.

You have to create a primary partition on one of your hard disk in a Linux system. How many primary partitions can you create?

4 You are limited to four primary partitions on each hard disk. To have more partitions, substitute an extended partition for one primary partition. You can then configure the local partitions that you need within the extended partition.

Which command exits vi without saving changes?

:q! The :q! command is used to quit from the vi editor without saving. vi The VI is a visual interactive text editor that allows a user to create, modify, and store files on a Linux computer. It works in the following modes: Command: This is the default mode of the command. Various commands can be used in this mode to manipulate the opened text. Input: In this mode, a user can insert text directly in the text screen area. Ex: This mode allows keys to be used to save, save as, and quit the document.

You work as a Linux technician for Tech Perfect Inc. The company has a Linux-based network. You have configured a database server in the network. Users complain that the server has become remarkably slow. However, the previous day, the server was performing well. You know that some of the processes may be the cause of the issue. You run the ps command on the server. While reviewing this output, which information will you look at that suggests the problematic process?

A high CPU time A high CPU time shows that a process is taking a high percentage of the processor time to run it. Such processes can be faulty processes. Faulty processes can usually be fixed by restarting the processes. ps command The ps command reports the status of processes that are currently running on a Linux computer.

Sam works as a Hardware Engineer at Bell laboratory. He decided to install Linux operating system in his computer. He wants to make the swap space as efficient as possible. Which two measures should he take in order to get his task done?

Create swap space on a primary partition and near the front of the hard disk for faster data access times.

You work as a network administrator for McNeil Inc. The company has a Linux-based network. You have just created a directory named Sales on a file server. David, a Sales Manager, has to use this directory to keep sales reports. David reports that he is unable to save his reports in the directory. When you list the directory using the ls -l sales command, you get the following result: drwxr-xr-x 2 root root 2048 Jan 2 2006 Sales What is the most likely cause?

David does not have the write permission on the directory.

What is the purpose of the cut command?

It extracts information from within lines of a file. The cut command can extract part of a line of information for further processing, which can be handy when you need to use a script to extract information from highly structured files.

What is the function of the following command? export THEFILE=/usr/local/bin/theprogram

It sets the value of the environment variable $THEFILE to /usr/local/bin/theprogram.

Which of the following is the most frequent use of IRQ 14?

Primary IDE or ATA controller

You type history -c at a bash command prompt. What will be the result?

The command history will be cleared (deleted).

You work as a network administrator for McNeil Inc. The company has a Linux-based Network. You are a root user on the Red Hat operating system. You see the following permissions on a file: -rwxr----- What two operations can be performed on the file?

The file can be read by its owner, The file can be read by its owner and member of its owning group.

How do the commands shutdown -r now and shutdown -h now differ?

The first command reboots the computer; the second halts the computer (that is, turns it off, if the motherboard and kernel have appropriate support). The -r parameter to shutdown causes a reboot after Linux shuts down, enabling you to boot a new kernel or OS. (This is equivalent to runlevel 6.) The -h parameter to shutdown causes the computer to halt, although this action requires motherboard and kernel support that may not always be present. Both commands use now as the time, indicating an immediate shutdown.

How do grep and egrep differ?

The grep command uses basic regular expressions by default, whereas egrep uses extended regular expressions by default.

Which two statements are true about the rm command?

The rm command can remove files. The rm command can remove directories. rm is a command to delete or remove files from the Linux system. You can also use 'rm' to delete directories using the "-R" option.

You work as a network administrator for Net World International. You have installed a Linux server on the company's network. Users report that they are unable to write on a filesystem. You verify that there is no free space available on the hard disk drive. You mount another hard disk drive to resolve the issue. How will you prevent the issue from happening again?

Track the amount of free space on the hard disk. If there is no free space on the hard disk drive, users will not be able to write on it. To prevent this issue from happening again, you should track the amount of free space on the hard disk. By doing so, you can take necessary actions before the actual problem arises.

(T or F) A tarball is an archive file created by tar and optionally compressed with gzip or bzip2.

True

(T or F) A tarball is usually indicated by using multiple extensions, .tar and .gz, which are written together as .tar.gz or .tgz.

True

(T or F) When the sticky bit is applied to a directory, it allows only the owner or root to delete or rename files in that directory.

True The sticky bit is a part of a permission set applied to files or folders. When the sticky bit is set on a directory, only the owners of files and superuser accounts (like "root") can unlink (delete) or rename the files in that directory. Without the sticky bit, anyone who is able to write to the directory can delete or rename the files. In a long listing, 't' denotes that sticky bit is set. If both sgid and sticky bit are set on a directory, it is represented by 'T' instead of 't'. The syntax of setting the sticky bit on a directory is given below: chmod o+t directoryname Here, o denotes that the permission is set for other users. The + sign indicates that the permission will be set on the directory. The t denotes the sticky bit permission. The syntax to remove the sticky bit from a directory is given below: chmod o-t directoryname Here, the - sign indicates that the permission will be removed. If the sticky bit ID is set and other users have the execute permission, the 'x' in the other users' permissions is replaced by 't', and if they have no execute permission, the 'x' in the other users' permissions is replaced by 'T'. For example: Command Description -rwxrwxrwt The Sticky bit is set and other users have the execute permission. -rwxrwxr-T The Sticky bit is set but other users have no execute permission. This bit is commonly set for the /tmp directory so that multiple users can write to files in that directory, but those files cannot be accessed by other standard user accounts. This functionality is needed for privacy. The effect of the "sticky bit" on files is less standardized between different operating systems. On some platforms, including Linux-based systems, the value of this bit does not affect how the file is commonly accessed.

How can you search for text in vi?

Type the slash key (/) followed by the text you want to find while in command mode. Vi uses a slash (/) in command mode to initiate searches

You want to convert the my_package.rpm rpm package into the Debian package. Which of the following commands will you use to accomplish the task?

alien --to-deb my_package.rpm The alien --to-deb my_package.rpm command converts the my_package.rpm rpm package into the Debian package. alien is a command that is used to convert or install a non-Debian package such as Red Hat .rpm, Stampede .slp, Slackware .tgz, and Generic .tar.gz on the Debian system. The syntax of the alien command is as follows: alien [--to-deb] [--patch=patchfile] [options] file The commonly used options are -i and -r. The -i option is used to convert a non-Debian package into the Debian format, install the output package, and remove the converted package file. The -r option is used to convert an rpm file into a Debian file.

Mark works as a network administrator for Perfect Solutions Inc. He wants to install a non-Debian package on the Debian system. Therefore, he has to run a command to convert a non-Debian package into a Debian format. Which command should Mark use to accomplish the task?

alien -i packagename According to the given scenario, Mark will use the alien -i packagename command because this command automatically converts a non-Debian package into a Debian format. Note: The alien -r packagename command is used to convert an rpm file into a Debian format.

Which command can be used to list the installed services and their associated runlevels?

chkconfig The chkconfig software can be used to list the installed services and their associated runlevels. chkconfig utility chkconfig is a utility and tool; it is used to update and query the runlevel information for the system services. The primary functions of the chkconfig tool are as follows: Adding new services for management Removing services from management Listing the current startup information for services Changing the startup information for services Checking the startup state of a particular service The chkconfig utility is invoked by running the chkconfig command.

You work as a network administrator for Perfect Solutions Inc. The company has a Linux-based network. You are a root user on the Red Hat operating system. You want to grant ownership of the foofile file to a user named John. Which of the following commands should you use to accomplish this task?

chown John foofile The chown command is used to change the ownership of a file. Only root can change the ownership of a file. The chown command can be used with the -R option to recursively change the ownership of an entire directory tree. Syntax: chown [-R] newowner filename where, Options Descriptions newowner The alias or username of the new owner of the file filename The file whose ownership needs to be changed The -R causes a recursive effect if a directory is specified. (The brackets around the -R are simply noting that the -R is optional.) You could also use: chown [ -R ] :newgroup filename(s) That is one way to change the "group ID" setting for a file. You can also combine setting the user account name, and the group name, in one command: You could also use: chown [ -R ] newuser:newgroup filename(s) There is also a historical syntax of using a period instead of a colon. That is still widely supported, and may be required with some older releases of operating systems. (The colon is preferred because it never appears as part of a Unix username. Many modern operating systems do support a period in a username.)

Which command will you use to remove a Debian file along with its configuration files?

dpkg --purge

John works as a Network Administrator for Perfect Solutions Inc. The company has a Linux-based network. He is working as a root user on the Linux operating system. He wants to remove a Debian package foobar from his computer and have it maintained so that whenever he wants to install it from the stored files, he can do so. Which two commands can John use to accomplish his task?

dpkg --remove, dpkg -r John can use either the dpkg --remove or dpkg -r command to remove a Debian package foobar from his computer and maintain it so that whenever he wants to install it from the stored files, he can do so. The Debian package manager (dpkg) is a command that performs various actions such as installing, configuring, removing, or unpacking a Debian package. The dpkg command maintains package information in /var/lib/dpkg. The available file keeps a list of all available packages, and the status file keeps package attributes, such as whether a package has been installed or has been marked for removal.

Which command lists all partially installed Debian packages on the Linux operating system and also suggests what to do with them to get them working correctly?

dpkg -C The dpkg -C lists all partially installed Debian packages on the Linux operating system and suggests what to do with them to get them working correctly. The Debian package manager (dpkg) is a command that performs various actions such as installing, configuring, removing, or unpacking a Debian package. The dpkg command maintains package information in /var/lib/dpkg. The available file keeps a list of all available packages, and the status file keeps package attributes, such as whether a package has been installed or has been marked for removal.

John works as a network administrator for Perfect Solutions Inc. The company has a Linux-based network. John is working as a root user on the Linux operating system. He has stored all user names, one name per line, in the file named users.txt. Now, he wants to search for such user names that does not contain the letter D. Which command will John use to accomplish his task?

grep -v D users.txt The -v option of the grep command invert the sense of matching, i.e., it will display all lines that don't match the specified pattern. Hence, John will use the grep -v D users.txt command to search for user names that does not contain the letter D.

You want to enable group quota support on a filesystem. Which option will you add on the /etc/fstab file to accomplish the task?

grpquota According to the question, you want to enable group quota support on a filesystem. To enable group quota support on a filesystem, edit your fstab file using a text editor and add grpquota to the fourth field in the row of the specified filesystem.

Which two commands is used to switch a Linux computer to different runlevels?

init, telinit The init daemon is the parent of all processes. It creates processes from the script stored in the /etc/inittab file. It sets the following environment variables for all processes: path, init_version, runlevel, prelevel, and console. telinit is a command that can be used in place of init. It is often used interchangeably with init. In some distributions of Linux-based operating systems, the telinit command is nothing but a link to init. In some other distributions, the init daemon is invoked by running the "init" command, and may support syntax similar to telinit.

You can add a new kernel module in the Linux operating system by using what command?

insmod insmod is a command that is used to insert a module into the Linuxkernel's memory. The syntax of the insmod command is: insmod [ filename ] [ module options... ] You can also use "modprobe" as this inserts modules as well and also checks for dependencies while doing so, unlike insmod.

Which two commands would you use to terminate all the processes having the same name?

killall, pkill killall is a command that terminates multiple processes running with the same name. For example, killall httpd terminates all httpd processes running on a Linux computer. Syntax: killall The following command will kill all of the gdm (GNOME Display Manager) processes: killall gdm The pkill command is used to kill processes according to an extended regular expression pattern which can be based on process name and other attributes. pkill can also send specific signals to processes. Syntax: pkill pattern

Which command can be used to display the ld.so.cache file?

ldconfig The ldconfig command is used to display the ld.so.cache file. A user can use the following command to display the ld.so.cache file: /sbin/ldconfig -p | more

A system contains a file, /usr/share/important.txt. You want to create a link to this file in the /usr/local directory, which is on another partition. Which of the following commands will accomplish this goal?

ln -s /usr/share/important.txt /usr/local/important.txt Because the link is on another partition than the target file, a symbolic link is required. The -s option creates a symbolic link.

Which command is used to append the list of files in the /tmp directory to an existing file named deletelater.txt?

ls /tmp >> deletelater.txt The ls command is used to list files on a Linux computer. The syntax of the ls command is as follows: ls [options] [files] Several options are used with the ls command. The following is a list of some important options: Options Descriptions -a Lists all entries including hidden files. -d Lists only the name of a directory and not the contents. -R Lists the contents of subdirectories also. -r Lists filenames reverse sorted. For example, the following command displays all the files (including hidden files) in the /home directory and the contents in the subdirectories: ls -aR /home >> The append operator >> is similar to >. It also redirects the standard output but if the target file exists, the data is appended to it. An existing file is not overwritten. Example: $ date >> datefile This command appends the current date to the end of the file 'datefile'.

Which is the command to see how PCI devices are connected to the PCI bus in your system in a tree structure.

lspci -t Execute the lspci -t command to see how PCI devices are connected to the PCI bus in a tree structure, where the -t option displays the output in tree format with information about bus, and how devices are connected to those buses. The lspci command is used to display information about all PCI buses in the system and all devices connected to them. It is based on a common portable library libpci, which offers access to the PCI configuration space on a variety of operating systems.

Which command is used to create the extended ext2/ext3 filesystem on a partition?

mke2fs The mke2fs command is used to create ext2, ext3, and ext4 filesystems. The commonly used mke2fs command options are as follows: Options Descriptions -b It specifies the size of blocks in bytes. -i It specifies the bytes/inode ratio. -N It overrides the default calculation of the number of inodes that should be reserved for the filesystem. -m It specifies the percentage of the filesystem blocks reserved for the super-user. -c It checks the device for bad blocks before creating the file system. -l It specifies the size of each inode in bytes. -L It sets the volume label for the filesystem to new-volume-label.

You are configuring a new hard disk on your Linux server. The new hard disk will become the second hard disk of the server. You use the fdisk command to make it a single partition drive. You want to format the partition with the ext2 filesystem. Which command will you use to accomplish this?

mkfs -t ext2 /dev/hdb1 In Linux, the first IDE drive is represented by the device name of /dev/hda and the second one is /dev/hdb. Similarly, the first partition of the first hard disk is represented as /dev/hda1, and so on. So, the first partition of the second device is /dev/hdb1.

Which is the command to create the ext3 filesystem on the /dev/sda1 partition.

mkfs -t ext3 /dev/sda1 Explanation: Execute the mkfs -t ext3 /dev/sda1 command to create the ext3 filesystem on the /dev/sda1 partition, where the -t option is used to specify the type of file system to be built. If not specified, the default file system ext2 is used. The mkfs command is used to build a Linux file system on a device, usually a hard disk partition. The mkfs command calls the mke2fs command, which could also be executed directly to make this filesystem.

You want to mount all partitions listed in /etc/fstab. Which command will you use?

mount -a The mount -a command mounts all partitions listed in /etc/fstab. In Linux, the mount command is used to mount and display disks, partitions, and filesystems. Mounting refers to the process in which the operating system prepares the media to be read.

You want to temporarily change your primary group to another group of which you are a member. In this process, a new shell will be created, and when you exit the shell, your previous group will be reinstated. Which command will you use to accomplish this task?

newgrp According to the scenario, you will use the newgrp command to accomplish the task. The newgrp command is used to temporarily change the primary group of a user into another group of which that user is a member. In this step, a new shell will be created, and when that user will exit from the shell, his previous group will be reinstated. If no group is specified, the GID is changed to the login GID.

Which two commands look through the currently running processes and list the process IDs that match the selection criteria to stdout?

pgrep, top The pgrep command looks through the currently running processes and lists the process IDs that match the selection criteria to stdout. All the criteria have to match. The top command will display processes that match a process ID when the -j option is used.

Which three things are maintained in the /etc/inittab file?

processes that start during boot up, runlevels of each process, actions to be taken by processes,

You want to check whether the cc process is running on a computer. Which three commands can you use to accomplish the task?

ps -aux | grep cc ps -aux | more ps -aux

You work as a network administrator for Perfect Solutions Inc. The company has a Linux-based network. You want to save a list of the current processes running on the system to the ProStat.txt file. Which command will you use to accomplish the task?

ps > ProStat.txt The ps command reports the status of processes that are currently running on a Linux computer. > is the symbol for output redirection. It is placed between a command that can generate output and a filename. If the specified file already exists, it overwrites that file's contents. Example 1: cat file1 > file2 Will first create a file named 'file2' and then copy the contents of 'file1' into it. No output will be shown on the screen. Example 2: cat file1 file2 > /tmp/file3 Will create a file named 'file3' under /tmp, which will contain sequentially, the contents of both file1 and file2. Example 3: ls -l /usr/sbin > mydir_list Will redirect the directory listing to a file named 'mydir_list' in the current directory. Example 4: (pwd; ls -l) > out Redirects output of both commands to a file named 'out'.

John works as a Network Administrator for Perfect Solutions Inc. The company has a Linux-based network. John is working as a root user on the Linux operating system. Which command will he use to create a report of the disk quota of all users?

repquota John can use the repquota command to create a report of the disk quota of all users. The repquota command is used to print a summary of quotas and disk usage for a filesystem specified by the filesystem parameter. If the -a flag is specified instead of a filesystem, the repquota command prints the summary for all filesystems enabled with quotas in the /etc/filesystems file. By default, both user and group quotas are printed. The syntax of the repquota command is as follows: repquota [ -v ] [ -c ] [ -g ] [ -u ] [ -l ] { -a | FileSystem ...} where, Options Descriptions -v Prints a header line before the summary of quotas for each filesystem. -u Specifies that only user quotas are printed. -l Enables long user names to be printed on the repquota report. The default behavior of the report will be to truncate the name at 9 characters. If the -l option is specified, the full user name will be used. -g Specifies that only group quotas are printed. -c Changes the output of the command to a colon-delineated format. -a Specifies that quotas are printed for all filesystems enabled with quotas in the /etc/filesystems file.

Which command issues a warning to logged-in users before the shutdown process begins in a Linux server?

shutdown The shutdown command brings a Linux server down in a safe, secure, and graceful manner. Using this command notifies all logged-in users that a server is going down. The shutdown command signals the init daemon to change the runlevel. The syntax of the shutdown command is given below: shutdown [-t sec] [options] time [warning message] where, the time argument tells the command when to shut down, and warning message is the message that the command sends to all logged-in users on the server.

Which command will switch to the 5th runlevel?

telinit 5 Explanation: Execute the telinit 5 command to switch init to the 5th runlevel, where the argument 5 serves as a directive to telinit. It signals init to change the system's runlevel. The telinit command is used to change the system runlevel. A runlevel is a software configuration of the system which allows only a selected group of processes to exist. The runlevel argument should be one of the multi-user runlevels 2-5, 0 to halt the system, 6 to reboot the system or 1 to bring the system down into single-user mode.

Which two commands will change the modification time of a file named foo.txt?

touch foo.txt, echo -n "hello" > foo.txt touch is a command that is used to change a file's access and modification timestamps. It is also used to create a new empty file. The syntax of the touch command is as follows: touch [option] file_name The following table describes various options of the touch command: Options Descriptions -a Changes the access time only. -c Does not create any file. -m Changes the modification time only. -r Uses the file's time instead of current time. The echo -n "hello" > foo.txt command will redirect the output of the echo command in the foo.txt file. This action will have the impact of changing the modification time of the foo.txt file.

Richard created a document on his Linux system. He finds all the characters in uppercase and tries to convert all those uppercase characters to lowercase characters. Which command should he run to get his task done?

tr The tr command is used to translate the characters. It translates characters from the standard input, writing to the standard output.

How would you direct the output of the uptime command to a file called uptime-stats.txt?

uptime > uptime-stats.txt

Which of the following can you use to load the necessary modules when your system detects a newly connected USB device?

usbmgr, hotplug You can use either the usbmgr or hotplug utility to load the necessary modules when your system detects a newly connected USB device. USB Hot plugging USB Hot plugging is a standard Linux feature from Linux kernel 2.4. It helps a user to plug in new devices and to use them immediately. If a user plugs a USB or PC card, the system has to take the following steps: Determine the device type and find a driver to run it. Bind the driver to the device. Notify other subsystems about the device. This allows disks to be mounted or print queues to be added and various other resource sharing operations to be performed. There are two main USB commands used in Hot plugging: usbmgr hotplug The configuration files of these commands can be found in the following directories, respectively: /etc/usbmgr or /etc/hotplug

You want to allow a user to unmount a filesystem that the user has mounted. Which of the following options will you add in the /etc/fstab file?

user The user option in the /etc/fstab file allows an ordinary user to unmount a filesystem that the user has mounted.

You run the wc -c file1.txt command. If this command displays any error message, you want to store the error message in the error.txt file. Which command will you use to accomplish the task?

wc -c file1.txt 2>error.txt According to the scenario, you will use the wc -c file1.txt 2>error.txt command to accomplish the task. The 2> redirection operator is an error redirector, which, while running a command, redirects the error (if it exists) on the specified file.

Sam has a computer running the Linux operating system. He was asked to create a document using the vi editor having not more than hundred lines. Which command should he run to determine the number of lines in his document?

wc -l wc (short for word count) is a command. It returns the number of lines, words, and characters in a file. The syntax of the wc command is given below: wc [OPTION] filename The options used with the wc command are listed below: -w: Returns the number of words in the file -c: Returns the number of characters in the file -l: Returns the number of lines in the file For example: wc -w file1 This command displays the number of words in the file. wc -l file1 This command displays the number of lines in the file.


Kaugnay na mga set ng pag-aaral

English Unit 2: Becoming a Nation

View Set

CPP - Certified Payroll Professional Exam for 2019 limits

View Set

Project management short answer test 1

View Set