Friday, February 27, 2009

Chapter 5 Review Questions

1.) A regular expression is used to:

Define a potentially complex pattern of characters or digits.

2.) The regular expression [cChapter0[12345]* does not match which of the following files?

Chapter1.doc

3.) Which of the following regular expressions matches the text "Reunion-2004"?

Reunion-[0-9]{4}

4.) The grep command is not useful for which of the following?

Determining which directories are currently in use.

5.) Searching documents created by word-processing programs is not an appropriate use of the grep command because:

Word-processing documents contain nonreadable codes (nontext information).

6.) If you execute a grep command without providing the name of one or more files to search, you should:

Provide input using a pipe from another utility.

7.) You need to track the output of a text file in real time as lines are added to that file by another program. Which command do you use?

tail -f

8.) Several commands are available in Linux that let you compare two or more files to determine how they differ. One of these programs in particular is widely used by programmers and system administrators and is a tool commonly used for assisting with modified source code on Linux systems. Which is it?

diff

9.) Which of the following features is not supported by default in ispell?

Seeing a list of suggestion words to correct the spelling of a word that ispell does not recognize, then selecting one of those words to insert in the document by pressing a single key.

10.) The wc command displays:

The number of lines, words, and characters in a file.

11.) Name five programs that can be used to filter text files in Linux.

sort, diff, comp, sed, awk

12.) The command ls sort causes which of the following to occur?

The output of the ls command is sent to the sort command. The results are printed on the screen.

13.) When you run a program called gather_data, it normally reads text as a user enters it at the keyboard. If you use the command gather_data <> to run the program, which of the following occurs?

The input that the gather_data program normally reads from the keyboard is taken from the input_text file instead.

14.) Which independent Linux command replaces tabs in a text file with a fixed number of spaces?

expand

15.) The name of a script file can be provided to sed and awk on the command line using which command-line option?

/file name/

16.) Using a ! along with a standart write command in vi causes the editor to:

Attempt to write the file despite a file permission that does not by itself permit writing the file, though this can only be done if the person editing the file is the owner of that file or is working as root.

17.) Which of the following creates a mark at the current line within vi so that you can quickly jump to that line in the file?

'a

18.) The vi editor checks for an environment variable and for a hidden initialization file in the directory in which a file being edited is stored. These are called respectively:

EXINIT, .exrc

19.) Describe the meaning of 1,$ as a ranger operator at the beginning of a search and replace command withing vi.

It is telling the search command to search from line one of the document all the way to the end.

20.) Describe the difference between the following four search commands in vi: / ? n N

The / command tells vi to search from the current position forward. The ? command tells vi to search from the current position backward. The n command tells vi to move to the next position of the most recent / or ? command. The N command tells vi to move to the previous position of the most recent / or ? command.

Saturday, February 21, 2009

Chapter 4 Review Questions

1.) Describe the effect of using a hyphen when executing the su command.

The hyphen tells causes the command to execute login scripts, and puts you in the login directory of the user you are switching to.

2.) A user's primary group can be a User Private Group. True or False? Explain.

True. If that is the only group that the user is assigned to then those are the only permissions that user is able to have.

3.) The /etc/passwd file does not contain which of the following fields:

The file privileges for the user.

4.) Explain the meaning of this line in the /etc/group file: webmasters:x:710:rthomas,cyang

Webmasters is the name of the group, the "x" designates the password, 710 is the GID(Group Id Number), and rthomas, and cyang are the members of the group.

5.) To create or change a password on any user account, the following is used:

The passwd command

6.) What does the fourth field in /etc/passwd contain?

It contains the GID.

7.) Why should you not use a standard text editor to add users to /etc/passwd?

In case there is more than one system administrator working on the file across the network, and in case of typing errors.

8.) If you enter a new password for a user account that can be easily guessed, the message BAD PASSWORD appears and the password is:

Only updated if you are logged in as a regular user.

9.) A mounted file system is on that:

Allows any user to run programs located on it.

10.) The Shadow Password Suite enhances Linux security by:

Hiding encrypted passwords in a file that only root can read.

11.) The df utility provides information about which of the following:

File system capacity, device name, and percentage used status.

12.) If you attempt to unmount a mounted file system receive an error message, the most likely cause is:

One or more users are working in a directory of the file system.

13.) Describe the difference between an alias and a symbolic link.

An alias is an executable script, and a symbolic link is a file that points to another file or directory.

14.) Which command is used to create a symbolic link?

ln

15.) The command chmod 744 report.doc grants ________ execute permission to the report.doc file.

User (The file's owner)

16.) The owner and group assigned to a file are shown by which of the following:

ls -l

17.) Execute a permission on a file is required to:

Start that file as a program

18.) The tar command creates archive files that compressed by the ______ command.

gzip

19.) The tar utility differs from the cpio utility in that:

cpio always reads and writes to STDIN, and STDOUT, and tar uses command-line parameters.

20.) Describe why the find command is option used with tar or cpio for backups.

The find command searches the directory that is listed for an exact match to the parameters that you have given.

21.) The _______ option causes the tar command to extract files from an archive file or device.

x

22.) Describe how the newgrp command relates to the second field of each record in the /etc/group file.

If the person using the command knows a groups password they are able to temporarily assume that groups permissions. The second field in the /etc/group file is the groups password.

23.) The output of the id command includes:

The effective UID, the effective GID, and a list of groups of which the effective UID user is a member.

24.) If the far left column in the output of the ls -l command shows the character "s" you would know the object on that line was a:

Socket

25.) Which utility typically provides the highest compression ration (makes the smallest compressed file from a given data file)?

bzip2

Sunday, February 15, 2009

Chapter 3 Review Questions

1.) The default shell used by Linux is:

The Bourne Again shell (bash)

2.) When logged in as root, the shell prompt normally changes to display:

#

3.) The main function of a shell is to:

Start programs

4.) Name four different shells and briefly describe the differences between them.

1.) bash: This is the default shell of Linux
2.) csh: Uses a more complex syntax for programming the shell
3.) ksh: Has the features of csh while having the syntax of bash
4.) zsh: Combines ksh interactive features with csh programming syntax

5.) Tab completion is useful when you need to:

Enter long file names or directory names at the shell prompt.

6.) The history command is used to:

Display a list of previously entered commands.

7.) Entering the command !fr would do the following in the bash shell:

Reexecute the most recently executed command that began with "fr".

8.) To have a command executed each time any user logs in to the Linux system, you place the command in which of these files:

/etc/bashrc

9.) If a directory contains the file names micron and microscope, and you enter micro and pres Tab once, what happens?

The shell beeps

10.) Which of the following is a correctly formed alias for executing the mv command:

alias ren="mv -i"

11.) The command echo $HOME displays:

The word HOME

12.) Describe the contents of the PATH environment variable.

It is a list of the different "paths" that will be searched whenever a command is entered.

13.) When the export command is used, an environment variable:

Is available to other programs running in the same shell where export was executed.

14.) Name at least three nongraphical text editors that may be included with a Linux distribution.

1.) vi
2.) emacs
3.) pico
4.) joe

15.) Knowledge of the vi editor is considered an essential skill because:

The vi editor is virtually always available to complete system administrator tasks.

16.) Suppose you enter the command vi my_file and then enter the following keys: itestyyp:wq
Describe the results

It copies the word "test" into the buffer and then places the word "test" on the next line below. Then it saves the file as you exit the vi editor.

17.) When you run a program called gather_data, it normally reads lines entered at the keyboard. If you use the command gather_data <> to run the program which of the following occurs:

The input that the gather_data program would normally read from the keyboard is taken from the input_text file instead.

18.) A pipe is a method of connecting:

The output channel of one program with the input channel of another program.

19.) The command ls sort causes which of the following to occur?

The output of the ls command is sent to the sort command. The results are printed to the screen.

20.) Using the lpoptions command, you can:

Associate a set of lpr printing options with a name (called an instance) so that those options can be used more conveniently in the future.

21.) Which of these commands displays the current value of the USER environment variable?

echo "You are currently logged in as $USER."

22.) How is the following text executed on a command line?
echo 'This script has detected an error; please check your data.'; date; "Thank you."

As two commands followed by an error message

23.) How is the following text executed on a command line?

How is the following text executed on a command line?
echo "This script has detected an error\; please check your data."; date; "Thank you."

As two commands followed by an error message

24.) How is the following text executed on a command line?
echo This script has detected an error. Please check your data.$'\n''date'$'\n'Thank you.'

As three lines of text

25.) Does the follow text generate a shell error? Does it print the date?
echo 'This script has detected an error. Please check your data.$'\n'`date`$'\n'Thank you'

No it does not generate a shell error. It does not print the date.

Saturday, February 7, 2009

Chap. 1 & 2 Review Questions

Chapter 1 Review Questions

1.) An operating system does not do which of the following:

Provide word-processing features for users.

2.) Name four career paths where a strong knowledge of Linux is useful.

1. Network Administrator
2. System Administrator
3. Technical Writer
4. Business Consultant

3.) Linus Torvalds began to create Linux because:

He wanted a powerful operating system but could not afford one.

4.) The Free Software Foundation is dedicated to the idea that:

The real value of software is in customization, not in selling mass-produced copies.

5.) The GNU Project is important to Linux because:

It provides the majority of the system utilities used by Linux.

6.) The GPL includes all of the following facets except:

Software that runs on a GPL operating system must be given away

7.) In general usage, the name "open source software" refers to:

Software that has the source code included and follows a set of general principles espoused by the OpenSource consortium.

8.) In the Linux kernel version 2.6.10, the second digit, 6, indicates:

A minor kernel release number for a stable kernel

9.) Version numbers for Linux distributions don't track Linux kernel version numbers because:

Distributions include many components, so the vendor assigns a version number to the collection of software as a whole.

10. HOWTO documents discuss a variety of specific subjects. They are written for:

Anyone new to the subject being discussed

11.) The _________ directory is the beginning of the Linux directory structure---the top of the inverted tree.

/root

12.) The pwd command is used to:

Display the current working directory on the screen.

13.) The command Ls -l is invalid because:

Linux commands are case sensitive.

14.) Which task is not likely to be assigned to you as a system administrator?

Develop a new cash register system using C programming

15.) Linux file names can include:

Letters, digits, punctuation, and many special characters.

16.) The rm command is used in Linux to:

Delete files from a hard disk.

17.) A trash can facility on a Linux graphical desktop differs from the rm command in that:

Files placed in the trash can are not deleted until the trash can is emptied, but files deleted by rm are deleted immediately.

18.) Each answer contains several paths separated by semicolons. Which answer contains only absolute paths?

/var/named;/etc/samba;/home/abutler

19.) Within the Nautilus file manager, you can view the properties of a selected file or directory by:

Right-clicking the file or directory and selecting the Properties item from the context menu.

20.) Within the Nautilus file manager, pressing Shift+Ctrl+N is analogous to what command?

mkdir

21.) Which of the following commands is most likely to produce the following output on the screen? /home/abutler

pwd

22.) You see in the output of ls -l an unrecognized file. You wonder what it contains. Your first step should be to use which command?

file

23.) If the slocate fails to function as expected, it is likely because:

The index of file and directory names has not been created using updatedb.

24.) In Red Hat Linux, documentation files dedicated to each installed software package are stored:

In the /usr/share/doc directory

25. The Red Hat Enterprise Linux product line includes several versions such as:

WS, ES, AS, and Professional Workstation

Chapter 2 Review Questions

1.) The historical beginnings of the X Window System originated with:

Project Athena

2.) Why might a person choose to purchase a commercial X server instead of using XFree86, which comes free with each copy of Linux?

Because the purchased version of X server may support video cards that XFree86 does not.

3.) Describe the function of an X server within the X Window system

The X server essentially acts as a video card driver by communicating with with the video card and sending the most basic images to the screen. It also communicates with the mouse and the keyboard used in the graphical environment.

4.) A(n) _______ is another name for any graphical application running in the X Window System

X client

5.) Name four windows managers that can be used with the X Windows System on Linux:

1. twm (Tab Window Manager)

2. fvwm (Feeble Virtual Window Manager)

3. wm2

4. mwm (Motif Window Manager)

6.) A window manager is best described as:

A special-purpose X client that provides core graphical functionality for other X clients

7.) Name the two graphical libraries used by the two major desktop environments of Linux.

1. Qt

2. GTK+

8.) A graphical library is best described as:

A collection of functions that any graphical program can use to create a common look and feel.

9.) Choosing not to run X:

Can cause configuration problems on server-based systems.

10.) The ________ command is normally used to start the X Window System if you are not using a graphical login.

startx

11.) To minimize an active window in a GNOME desktop using default setting, you either:

Press Alt+F9 or select minimize from the window control menu.

12.) Describe the purpose of clicking and dragging to highlight text in one graphical window, then selecting another window and clicking both mouse buttons at the same time.

It copies the text from the first graphical window to the second. Doing this saves you steps by allowing you to copy the text directly instead of copying it to the clipboard and then to the second graphical window.

13.) The workspace switcher in GNOME lets you:

Move between four desktop backgrounds, each of which can have different windows open on it.

14.) To enable the feature that saves your desktop setup each time you log out of GNOME, you would explore which item on the preferences submenu?

Sessions

15.) Describe the function of the Alt+Tab and Alt+F1 combinations in GNOME.

Alt+Tab rotates the focus among all of your windows. Alt+F1 displays the main menu of GNOME.

16.) The Desktop Switcher utility lets you:

Switch your desktop between any installed window manager or desktop environment that the utility can locate on the system.

17.) Selecting a desktop theme lets you control:

The look and feel of most aspects of your desktop interface.

18.) Define an emblem as used in the Nautilus file manager.

It is a picture that you can "drop" on a file or folder to change what the icon looks like.

19.) When you select a text editor in the Preferred Application window of GNOME:

You select the text editor that GNOME or Nautilus starts whenever you want to view a text file.

20.) OpenOffice.org consist of the following:

Word processor, spreadsheet, a drawing program, presentation software, and database tools.

21.) For which platforms is OpenOffice.org available?

Windows, Solaris, Mac, and Linux

22.) Evolution is:

A program that includes email, calendar, task list, and contact management features, similar to Microsoft Outlook.

23.) When setting up a POP e-mail account, Evolution and Mozilla differ in that:

One is integrated with the GNOME main menu, the other is not.

24.) List four features that Evolution provides via its Summary window or the standard icons on the left side of the Summary window.

Weather information, critical update notices for Red Hat Linux and Fedora, a summary of e-mail, and a summary of tasks.

25.) Within the Nautilus file manager, the side pane is used to:

Display basic information about an object that has been selected in the left part of the window, including,for example, a thumbnail image of a graphic file, if so configured in the Preview tab of the File Management Preferences window.