Linux+ 05-1

Lakukan tugas rumah & ujian kamu dengan baik sekarang menggunakan Quizwiz!

Which of the following commands creates a display of processes, showing the parent-child relationships through links between their names

ps --forest

What commands may be used instead of shutdown in certain circumstances

reboot, halt, poweroff, telinit

Which of the following commands can be used to summarize the quota information about all filesystems

repquota utility is used to summarize the quota information about the filesystem.

Which of the following commands will extract the contents of the myfonts.rpm file into the current directory

rpm2cpio myfonts.rpm | cpio -i --make-directories. —make-directories is a valid option

Which of the following commands will change all occurrences of dog in the file animals .txt to mutt in the screen display

sed 's/dog/mutt/g' animals.txt

What program would you use to display the end of a configuration file

tail

Which of the following commands are commonly used to create archive files

tar and cpio

You've received a tarball called data79.tar from a colleague, but you want to check the names of the files it contains before extracting them. Which of the following commands would you use to do this

tar tvf data79.tar. t stands for list, v verbose, and f for file

You want to change to single-user mode on a running system. What command might you use to do this

telinit 1. telinit is used to change runlevels.

What tool would you use to disable a motherboard's sound hardware if you don't want to use it

the firmware. Modern firmware, BIOS and EFI, provide the means to disable many onboard devices.

What programs might you use to learn what your system's load average is

top & uptime

What is the surest way to run a program (say, myprog) that's located in the current working dir

type a ./ followed by the myprog name

What filesystem options might you specify in /etc/fstab to make a removable disk (USB flash drive, Zip disk, floppy disk, and so on) mountable by an ordinary user with a UID of 1000

user, users, and owner options in /etc/fstab all enable ordinary users to mount a filesystem, but with slightly different implications: user enables anybody to mount a filesystem, and only that user can unmount it; users enables anybody to mount a filesystem, and anybody may unmount it; and owner enables only the owner of the mount point to mount and unmount a filesystem.

A text-mode program, verbose, prints a lot of spurious "error" messages to standard error. How might you get rid of those messages while still interacting with the program

verbose 2> /dev/null

Typing ls -ld wonderjaye reveals a symbolic file mode of drwxr-xr-x. Which of the fol- lowing are true

wonderjaye is a directory and wonderjaye may be read by all users of the system.

Which of the following commands would you type to update the unzip program on a Fedora system to the latest version

yum update unzip & yum upgrade unzip

Which of the following options is used with fsck to force it to use a particular filesystem type

-t, it tells the OS what type of filesystem it is using

Which of the following is the GRUB 2 boot loader configuration file

/boot/grub/grub.cfg

You've just installed Linux on a new computer with a single SATA hard disk. What device identifier will refer to the disk

/dev/sda or /dev/hda. SATA disks are usually handled by Linux SCSI subsystem, giving them the /dev/sdX, however, some drivers handle these disks as PATA drives and refers to them as /dev/hdX

The string root (hd1,5) appears in your /boot/grub/menu.lst file. What does this mean

GRUB Legacy looks for files on the sixth partition of the second disk. The root keyword in a GRUB legacy configuration file tells the boot loader where to look for files, including it's own configuration files, kernel files, and so on. GRUB numbering system is 0-based, therefore hd1,5 refers to the sixth partition.

Which of the following pieces of information can df not report

How long the filesystem has been mounted

What can the type command do that whereis can't do

Identify a command as an alias, internal command, or external command

An administrator types the following command on an RPM-based Linux distribution: rpm -ivh megaprog.rpm

If the megaprog.rpm package exists, is valid, and isn't already installed on the computer, it is installed.

How would you remove two lines of text from a file using Vi

In command mode, position the cursor on the first line, and type 2dd.

What does the following command: mkfs -t ext2 /dev/sda4 accomplish

It creates a new ext2 filesystem on /dev/sda4, overwriting any existing filesystem and data.

What does the PWD command accomplish

It prints the current working directory

Which is true of using both RPM and Debian package management systems on one computer

It's generally inadvisable because the two systems don't share installed-file database information.

What does runlevel 4 do

Its purpose isn't standardized, so it can be used for anything you like.

What is an advantage of a journaling filesystem over a conventional (non-journaling) filesystem

Journaling filesystems require shorter disk checks after a power failure or system crash.

Where might the BIOS find a boot loader

MBR or Master Boot Record holds boot loader information that is up to 446 bytes in size.

You type jobs at a bash cmd prompt and receive a new command prompt with no intervening output. What can you conclude

No background processes are running that were launched from the shell you're using.

You want to discover the sizes of several dot files in a directory. Which of the following commands might you use to do this

ls -la

Which two of the following commands are equivalent to one another

nice -10 crunch & nice crunch

Which of the following commands will number the lines in aleph.txt

nl adelph.txt; cat -b adelph.txt; cat -n adelph.txt. cat -b will only number non-blank lines, whereas cat -n will number every line, blank or not.

Which of the following file-location commands is likely to take the most time to find a file that may be located anywhere on the computer

out of locate, whereis, type, find takes the longest because it is the only one that searches all directory trees without the use of a database such as locate.

What parameter can you pass to ln to create a soft link

-s and —symbolic

Which of the following /etc/fstab entries will mount /dev/sdb2 as the /home directory at boot time

/dev/sdb2 /home reiserfs defaults 0 0. The /etc/fstab file consists of lines that contain the device identifier, the mount point, the filesystem type code, filesystem mount options, the dump flag, and the filesystem check frequency, in that order.

Which of the following directories is most likely to be placed on its own hard disk partition

/home

You've installed a commercial spreadsheet program called WonderCalc on a workstation. In which of the following directories are you most likely to find the program executable file

/opt/wcalc/bin. the /opt directory tree exists to hold programs that aren't a standard part of a Linux distribution, such as commercial programs.

Which files contain essential system information such as IRQs, direct memory access channels, and I/O addresses

/proc/ioports, /proc/interrupts, /proc/dma

Which runlevels are reserved by init for reboot, shutdown, and single-user mode purposes

0 shutdown, 1 single user mode, 6 reboot

You want to boot a Linux system into single-user mode. What option might you add to a Linux kernel's options list at a boot loader, when you type e, to accomplish this task

1. Runlevel 1 is single-user mode and adding digit 1 to the kernel's options line in a boot loader will launch the system in this run level.

What are common IRQs for RS-232 serial ports

3 and 4 are common IRQ's for serial ports

A system administrator types the following command: shutdown -c. What is the effect of this command

A previously scheduled shutdown is cancelled.

You type mkdir one/two/three and receive an error message that reads, in part, No such file or directory. What can you do to overcome this problem

Add the --parents parameter to the mkdir command or issue three separate mkdir commands: mkdir one, then mkdir one/two, and then mkdir one/two/three

What is the preferred method of adding a directory to the library path for all users

Add the directory to the /etc/ld.so.conf file, and then type ldconfig.

To access files on a USB flash drive, you type mount /dev/sdc1 /media/flash as root. Which types of filesystems will this command mount

All of the above. When typed without an option, mount attempts to auto detect the OS

How many commands can you pipe together at once

An arbitrary number

How should you configure a system that uses Yum to access an additional Yum software repository

Download a package from the repository site and install it with RPM, or place a configuration file from the repository site in the /etc/yum.repos.d directory.

Typing fdisk -l /dev/sda on a Linux computer with an MBR disk produces a listing of four partitions: /dev/sda1, /dev/sda2, /dev/sda5, and /dev/sda6. Which of the following is true

Either /dev/sda1 or /dev/sda2 is an extended partition. Logical partitions are numbered 5 and up, and they reside in an extended partition with a number between 1 and 4. Therefore, one of the first two partitions must be an extended partition that house 5 and 6.

What mount point should you associate with swap partitions

None of the above. Swap partitions aren't mounted in the way filesystems are, so they have no associated mount points.

When should programs be configured SUID root

ONLY when they require root privileges to do their job

You want to create a link from your home directory on your hard disk to a directory on a CD-ROM drive. Which of the following types of links might you use

Only a symbolic link because a soft link can point across filesystems. Hard links are restricted to a single filesystem, in this case a CD-ROM is considered another filesystem.

How do you exit Vi's insert mode in order to type command-mode commands

Press the Esc key.

You see the usrquota and grpquota options in the /etc/fstab entry for a filesystem. What is the consequence of these entries

Quota support will be available if it's compiled into your kernel, but you must activate it with the quotaon command.

From Vi's command mode, you want to enter insert mode. How might you do this

R, for overwrite existing text, i for insert at current location, and a for insert after a space, A is append at the end of the current line.

You type a command into bash and pass a long filename into it, but after you enter the command, you receive a "File Not Found" error message because of the typo in the filename. How might you proceed

Retype the command, Press the Up arrow key and use Bash to correct typo or type a few letters of the command and hit TAB to autocomplete

What is not an advantage of a source package over a binary package

Source packages can be installed more quickly than binary packages can.

What is the effect of the following command: myprog &> input.txt

Standard output and standard error from myprog are written to input.txt.

How do the > and >> redirection operators differ

The > operator creates a new file or overwrites an existing one; the >> operator creates a new file or appends to an existing one.

As root, you type apt-get update on a Debian system. What should be the effect of this command

The APT utilities retrieve information about the latest packages available so that you may install them with subsequent apt-get commands.

You type the following command: runlevel, the system returns '5 3' What can you tell about your run level status

The current runlevel is 3 and previous runlevel was 5. The first number in the runlevel output is the previous runlevel and the second is the current runlevel, an N means no change in runlevels since previous reboot.

You discover that an MBR hard disk has partitions with type codes of 0x0f, 0x82, and 0x83. Assuming these type codes are accurate, what can you conclude about the disk

The disk holds a partial or complete Linux system.

In an xterm window launched from your window manager, you type exec edit. What will happen when you exit from the edit program

The exec cmd causes the rest of the cmd to replace the current shell. Thus when you exit from gedit in this scenario, the result will be the same as if you'd terminated the shell, namely, the xterm window will close.

What is the effect of the following command: pr report.txt | lpr

The file report.txt is formatted for printing and sent to the lpr program. The pr program takes a txt file and adds formatting intended for printing. The cmd also pipes the output through lpr which is the Linux printing cmd.

You want to move a file from your hard disk to a USB flash drive. Which of the following is true

The mv command will delete the file on the hard disk after copying it to the flash drive.

What can df report

The number of inodes used on an ext3fs partition, The filesystem type of a partition, The percentage of available disk space used on a partition, the mount point associated with a filesystem

In Vi's command mode, you type :q!. What is the effect

The program terminates without saving your work.

A new Linux administrator plans to create a system with separate /home, /usr/local, and /etc partitions, in addition to the root (/) partition. Which of the following best describes this configuration

The system won't boot because /etc contains configuration files necessary to mount non-root partitions. Remember partitions /etc, /bin, /sbin, and /lib must be with /.

Which of the following best summarizes the differences between DOS's FDISK and Linux's fdisk

The two are completely independent programs that accomplish similar goals, although Linux's fdisk is more flexible.

Which of the following statements is true about binary RPM packages that are built for a particular distribution

They can often be used on another RPM-based distribution for the same CPU architecture, but this isn't guaranteed. RPM's are usually portable across distributions, but occasionally they contain incompatibles.

Why might you type touch filename

To ensure that filename's timestamp holds the current time. Touch updates a file's time stamps.

What is the purpose of udev

To manage the /dev directory tree. the udev software creates and manages a dynamic /dev directory tree, adding entries to that directory for devices that exist on the target system.

A user types kill -9 11287 at a bash prompt. What is the probable intent, assuming the user typed the correct command

To terminate a misbehaving or hung program with process ID 11287

After booting, one of your hard disks doesn't respond. What might you do to find out what's gone wrong

Type dmesg | less, and peruse the output for disk-related messages. The kernel ring buffer, which can be viewed by typing dmesg, contains messages about the kernel, including those from hardware drivers. These messages may provide a clue about why the disk didn't appear.

You run Linux's fdisk and modify your partition layout. Before exiting the program, you realize that you've been working on the wrong disk. What can you do to correct this problem

Type q to exit fdisk without saving changes to disk.

What is the minimum safe procedure for removing a USB flash drive, mounted from /dev/ sdb1 at /media/usb, from a Linux computer

Type umount /media/usb, wait for the command to return and disk-activity lights to stop, and then unplug the drive.

Which of the following are restrictions on ordinary users' abilities to run renice

Users may not modify the priorities of other users' processes & Users may not increase the priority, that is, decrease the priority value, of their own processes.

How does the man display info by default on most Linux systems

Using the less pager

You use top to examine the CPU time being consumed by various processes on your system. You discover that one process, dfcomp, is consuming more than 90 percent of your system's CPU time. What can you conclude

Very little; dfcomp could be legitimately consuming that much CPU time, or it could be an unauthorized or malfunctioning program.

What is an advantage of Vi over Emacs

Vi is smaller and so can fit on compact emergency systems and embedded devices.

You prefer the look of GTK+ widgets to Qt widgets, so you want to substitute the GTK+ libraries for the Qt libraries on your system. How would you do this

You can't easily do this; libraries can't be arbitrarily exchanged for one another. You would need to rewrite all the Qt-using programs to use GTK+.

You type echo $PROC, and the computer replies, Go Away. What does this mean

You typed PROC="Go Away"

Which of the following describes a difference between apt-get and dpkg

apt-get can automatically retrieve and update programs from Internet sites; dpkg can't.

Assume you're owner of myfile.txt; Which of the following commands would you type to enable world read access to the file myfile.txt

chmod o+r myfile.txt

What command would you type (as root) to change the ownership of somefile.txt from ralph to tony

chown tony somefile.txt

Which of the following regular expressions will match the strings dog, dug, and various other strings but not dig

d[o-u]g

To use dpkg to remove a package called theprogram, including its configuration files, which of the following commands would you issue

dpkg -P theprogram. Uppercase P invokes the purge operation, which completely removes a package and its config files.

What command would you type to obtain a list of all installed packages on a Debian system

dpkg--get-selections

Of the following: cat, less, tee, sed, echo, which is an internal command

echo, all others are external

You want to track down all files in the /home directory that belong to karen, what command would you type

find /home -user karen. -uid would work too, but you have to know karen's UID number.

You've received an ASCII text file (longlines.txt) that uses no carriage returns within paragraphs but two carriage returns between paragraphs. The result is that your preferred text editor displays each paragraph as a very long line. How can you reformat this file so that you can more easily edit it (or a copy)

fmt longlines.txt > longlines2.txt. fmt cmd performs shortening long lines by inserting carriage returns

You want to run an interactive script, gabby, which produces a lot of output in response to the user's inputs. To facilitate future study of this script, you want to copy its output to a file. How might you do this

gabby | tee gabby-out.txt

Which of the following commands will print lines from the file world.txt that contain matches to changes and changed

grep change[ds] world.txt

Which command is used to install GRUB Legacy into the MBR of your first SATA hard drive

grub-install /dev/sda

What line in /etc/inittab would indicate that your default runlevel is 5

id:5:initdefault:

You want to store the std output of ifconfig cmd in a text file (file.txt) for future reference, and you want to wipe out any existing data in the file. You do not want to store standard error in this file. How can you accomplish these goals

ifconfig > file.txt

What is the first program that the Linux kernel runs once it's booted in a normal boot process

init

How might you identify an initial RAM disk file in GRUB 2

initrd /boot/initrd-3.4.2. initrd keyword identifies an initial RAM disk file in the GRUB 2 configuration file, and a space separates this keyword from the filename.


Set pelajaran terkait

Marketing Smartbook Chapter 11 Q&A/Notes

View Set

Federalist paper #10, 47, 51 (Summary, Analysis, & Key Points)

View Set

Mechanical and Electrical Equipment for Buildings (MEEB): Chapter 12 Active Climate Control (pg.421-477)

View Set

FINANCE 5 : Capital Budgeting (NPV and other methods)

View Set

International Business Chapter 17 Multiple Choice

View Set