Friday, February 27, 2009

CIT 174

Week 5
Chapter 5 Review Questions
1. A regular expression is used to (c) define a potentially complex pattern of characters or digits.
2. The regular expression [cC]hapter0[12345]* does not match which of the following files? (c) Chapter1.doc .
3. Which of the following regular expressions matches the text "Reunion-2004"? (c) [Rr]eunion[0-9]{4}.
4. The grep command is not useful for which of the following? (b) 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 (d) word-processing documents contain non-readable codes (non-text information).
6. If you execute a grep command without providing the name of one or more files to search, you should (a) 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 would you use? (b) 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 administrations and is a tool commonly used for assisting with modified source code on Linux systems. It is called (a) diff. (“cmp”-are files identical and “comm.”-are sorted files the same)
9. Which of the following features is not supported by default in ispell? (/) ispell supports all theses options and I don’t see one of these answers in the book.
10. The wc command displays (a) the number of lines, words, and characters in a file.
11. Name five programs that can be used to filter text files in Linux. (command line programs)
a. sort
b. uniq
c. sed
d. awk
e. vi, pico, or emacs.
12. The command ls | sort causes which of the following to occur (a) the output of the ls command is sent to the sort command and the results are printed to 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 < input_text to run the program, which of the following occurs? (b) the input that the gather_data program normally reads form the keyboard is taken form the input_text file instead.
14. Which independent Linux command replaces tabs in a text file with a fixed number of spaces? (c) expand.
15. The name of a script file can be provided to sed or awk on the command line using which command-line option? (a) file
16. Using a ! (bang) along with a standard write command in vi causes the editor to (a) attempt to write the file despite a file permission that does not by itself permit writing the file, thought 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? (b) ‘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 (b) EXINIT, .exrc.
19.Describe the meaning of 1, $ as a range operator at the beginning of a search and replace command within vi. The range 1, $ means from the first line to the last line of the file.
20. Describe the difference between the following four search commands in vi:
/ --looks for a pattern from the current position FORWARD.
? – looks for a pattern from the current position BACKWARD.
N – jumps to the NEXT occurrence of the most recent search pattern ( / or ? )
N jumps to the PREVIOUS occurrence of the most recent search pattern ( / or ? )

Saturday, February 21, 2009

CIT 174

Week 4
Chapter 4 Review Questions
1. Describe the effect of including a hyphen when executing the su command. Using a hyphen after su allows you to assume the rights of another user.
2. A user’s primary group can be a User Private Group. True or False? Explain. True, for security reasons every new user has a private group with only one user. This is to prevent another user from accidently accessing someone else’s files.
3. The /etc/passwd file does not contain which of the following fields? (b) 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, x means the password is stored somewhere else, 710 is the group id (GID), and the two names are the members of the group.
5. To create or change a password on any user account, the following is used (c) the passwd command.
6. What does the fourth field in /etc/passwd contain? The group id or (GID) of the primary group for the user.
7. Why should you not use a standard text editor to add users to /etc/passwd? Because two people could be working on the file at the same time. In addition, a small typing error could make user accounts inaccessible.
8. If you enter a new password for a user that can be easily guessed, the message BAD PASSWORD appears and the password is (b) updated unless you are root. (I don’t like any of the choices!)
9. A mounted file system is one that (c) allows any user to run programs located on it.
10. The Shadow Password Suite enhances Linux security by (b) hiding encrypted passwords in a file that only root can read.
11. The df utility provides information about which one of the following (c) file system capacity, device name, and percentage used status.
12. If you attempt to unmount a mounted file system and receive an error message the most likely cause is (d) 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 causes the shell to substitute a different string than the one the user entered. Whereas a symbolic link causes the system to request a file from another place in the file structure.
14. Which command is used to create symbolic link? (b) ln.
15. The command chmod 744 report.doc grants (a) the user (the file’s owner) execute permission to the report.doc file.
16. The owner and group assigned to a file are shown by which of the following commands? (a) chown.
17. Execute permission on a file is required to(a) start that file as a program.
18. The tar command creates archive files that are most often compressed by the (d) gzip command.
19. The tar utility differs from the cpio utility in that (a) cpio always reads and writes to STDIN and STDOUT and tar uses command-line parameters.
20. Describe why the find command is often used with tar or cpio for backups. Because find can create a list of all the files that have been modified in the last day, which makes it easier to know what files to archive.
21. The (b) x option causes the tar command to extract the files from an archive file or device.
22. Describe how the newgrp command relates to the second field of each record in the /etc/group file. This is a rarely used command that allows a person who knows the group’s password to temporarily assume the group’s rights.
23. The output of the id command includes (a) 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 that the object on that line was a (d) socket.
25. Which utility typically provides the highest compression ratio (makes the smallest compressed file from a given data file)? (b) bzip2.

Saturday, February 14, 2009

CIT 174

Week 3
Chapter 3 Review Questions
1. The default shell used by Linux is (b) The Bourne Again Shell (bash).
2. When logged in as root, the shell prompt normally changes to display (b) #.
3. The main function of a shell is to (d) start programs.
4. Name four different shells and briefly describe the differences between them.
a. Sh is the original UNIX shell.
b. Bash an enhanced version of the Bourne shell. It has history and tab completion.
c. Csh, or c shell, is a newer shell with easy to use interactive features. But it has a more complex syntax than Bourne shells. It is based on the c programming language.
d. Tcsh is the tenex/tops c shell. It is an enhancement of the c shell and is commonly used on Linux systems.
e. Ksh is the Korn shell and it is a combination of the Bourne shell and the interactive features of the c shell.
5. Tab completion is useful when you need to (c) enter long file names or directory names at the shell prompt.
6. The history command is used to (a) display a list of previously entered commands.
7. Entering the command !fr would do the following in the bash shell (b) re-execute the most currently executed command that began for "fr".
8. To have a command executed each time any user logs in to the Linux system, you place the command in which one of these files? (a) /etc/profile.
9. If a directory contains the file names micron and microscope, and you enter micro and press Tab once, what happens? (a) The shell prints all matching names, micron and microscope.
10. Which of the following is a correctly formed alias for executing the mv command? (d) alias ren=”mv –I”.
11. The command echo $HOME displays (c) the value of the HOME environment variable.
12. Describe the contents of the PATH environment variable. It is a list of the directories that the shell looks in when it is asked to execute a command.
13. When the export command is used, an environment variable (a) is available to other programs running in the same shell where export was executed.
14. Name at least three non-graphical text editors that may be included with a Linux distribution. Vi, pico, and emacs.
15. Knowledge of the vi editor is considered an essential skill because (b) the vi editor is virtually always available to complete system administrations tasks.
16. Suppose you entered the command vi my_file and then press the following keys: itestyyp:wq. Describe the result. Vi creates “my_file”, “i” starts insert mode, test is typed, yyp copies test, then :wq writes and closes the file.
17. When you run a program called gather_data, it normally reads lines entered at the keyboard. If you use the command gather_data < input_text to run the program, which of the following occurs? (b) 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 (b) 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? (a) 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 (b) 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? (a) 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." (a) as two commands, followed by an error message.
23. How is the following text executed on a command line "echo “This script has detected an error\; please check your data.”; date; "Thank you." (a) 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. (c) as three lines of text.
25. Does the following text generate a shell error? Does it print the current date? echo 'This script has detected an error. Please check your data.$’\n’’date’$’\n’Thank you.’ (c) It does not cause an error, nor does it print the date.

Linux Shell (repost)



What is a shell and what does it do?
Research the internet for different shells and give a brief description of two that we have not worked with yet.

The shell is a program which takes your commands that you type on the keyboard and gives them to the operating system to execute. The shell interprets your commands (keystrokes) and runs the utilities or programs that you requested. The most common Linux shells are bash, sh, csh, and ksh. Linux is a multitasking operating system, so more than one shell can be running at a time. Each shell keeps its work isolated from the other shells that are running.

It appears that anyone with the knowledge can write a new shell. There are some compatibility issues to contend with. The main one seems to be POSIX which statnds for "Portable Operating System Interface". This is the open operating interface standard accepted world-wide. It is produced by IEEE and recognized by ISO and ANSI. POSIX support assures code portability between systems and is increasingly mandated for commercial applications and government contracts. ISO is the International Organization for Standardization and ANSI is the American National Standards Institute.

Two of the most interesting shells that we have not used yet are "resh" and "sash". The resh shell is a restricted version of the sh shell and is equivalent to sh -r. This allows users to copy files without having access to a shell on the server. There are many security risks when users are allowed access to another system, this is an attempt to secure ftp servers. The sash is a stand alone shell that was designed for recovering from a system failure. It is designed to be simple and robust, for people who need to do emergency repair work on a system.

Want another shell? (repost)

My textbook wanted us to experiment with different shells.
I went to http://www.tcsh.org/MostRecentRelease
downloaded the most resent version of tcsh and
typed "yum install tcsh" in my terminal
and it did it all by itself.
It took me a while to research all the
different ways to install a second shell.
This one is short and sweet!!

Shells for UNIX/Linux (repost)




If chart is too small, try clicking on it,
it should open into it's own window.
There you can adjust the size of the jpg.
Thanks!

Sunday, February 8, 2009

Open Source Window Aps

http://www.opensourcewindows.org/

I use several of these and they work GREAT!
7zip is my favorite unzipper!
I only use Pidgin and Meebo for my Instant Messaging.
And of course FireFox rocks!!

Wednesday, February 4, 2009

CIT 174

Week 2
Chapter 2 Review Questions
1. The historical beginnings of the X Window System originated with .a. 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? If they liked the functions, speed, ease of use, or the look of a commercial product.
3. Describe the function of an X server within the X Window System. It communicates with the video care, keyboard, and mouse to create a graphical environment. It also interacts with applications to control the screen display.
4. An .b. X client is another name for any graphical application running in the X Windows System.
5. Name four windows managers that can be used with the X Window System on Linux. The book mentions twm, fvwm, mwn, and olwm.
6. A window manager is best described as .a. 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. The Qt and the GTK+ libraries.
8. A graphical library is best described as .b. a collection of functions that any graphical program can use to create a common look and feel. (I was unhappy with ALL the choices in the book. GTK+ libraries are described here: http://library.gnome.org/devel/gtk/unstable/gtk.html)
9. Choosing not to run X .b. can cause configuration problems on server-based systems. (this is another question I was unhappy with all the answer choices—you can choose to use only a text interface and start X when needed. And you have to use X to set up your video card.)
10. The .b. startx command is normally used to start the X Window system if you are not using a graphical login.
11. To minimize an active window in a GNOME desktop using default settings you could either .a. 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 and selecting another window and clicking both mouse buttons at the same time. This procedure is to copy and paste in X even if the application does not have the capability.
13. The Workspace Switcher in GNOME lets you .d. move between four desktop backgrounds, each of which can have different windows 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 menu? .c. Sessions.
15. Describe the default action of the Alt+Tab and the Alt+F1 key combinations in GNOME. Alt+Tab rotates focus between open windows and Alt+F1 displays the main menu.
16. The Desktop Switcher utility lets you .a. switch your desktop between GNOME and KDE.
17. Selecting a desktop theme lets you control .a. the look and feel of most aspects of your desktop interface.
18. Define an emblem as used in the Nautilus file manager. Emblems are little graphic symbols you can add to a folder as part of your file manager.
19. When you select a text editor in the Preferred Application window of GNOME .c. you select the text editor that GNOME or Nautilus starts whenever you want to view a text file.
20. OpenOffice.org consists of the following .d. a word processor, a spreadsheet, a drawing program, presentation software, and database tools. (Writer, Calc, Impress, Draw and Base)
21. For which platform is OpenOffice.org available? As of 2009 Open Office supports Mac, Windows, and UINX/Linux.
22. Evolution is .a. a program that includes e-mail, 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 .c. one lets you enter passwords as part of the setup procedure, the other does not, but prompts you for passwords as needed.
24. List four features that Evolution provides via its Summary window or the standard icons on the left side of the Summary window. Summary, Inbox, Calendar, Tasks, and Contacts.
25. Within Nautilus file manager, the side pane is used to .b . 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.

CIT 174

Week Two
Chapter 1 Review Questions
1. An operating system does not provide .d. word-processing features for users.
2. Four possible Linux career paths are software development, business consultant, network administrator, and teaching or training.
3. Linus Torvalda began to create Linux because .b. he wanted a powerful operating system but could not afford one.
4. The Free software Foundation is dedicated to the idea that .b. the real value of software is in customization, not in selling mass-produced copies.
5. The GNU Project is important to Linux because .a. it provides the majority of the system utilities used by Linux.
6. The GPL includes all of the following facets except: .c. software that runs on a GPL operating system must be given away.
7. In general usage, the name “open source software” refers to .c. software that has source code included and follows a set of general principles espoused by the OpenSource consortium. (I am not real sure this is the correct answer)
8. In the Linux kernel version 2.6.10 the second digit, 6, indicates .b. a minor kernel release number for a stable kernel.
9. Version numbers for Linux distributions don’t track Linux kernel version numbers because .a. 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 .c. anyone new to the subject being discussed.
11. The .a. / directory is the beginning of the Linux directory structure—the top of the inverted tree.
12. The pwd command is used to .c. display the current working directory on the screen.
13. The command Ls –l in invalid because .b. Linux commands are case sensitive.
14. Which task is not likely to be assigned to you as a system administrator? .a. Develop a new cash register system using C programming.
15. Linux file names can include .d. letters, digits, punctuation, and many special characters (but no spaces)
16. The rm command is used in Linux to .b. delete files from a hard disk. (use caution)
17. A trash can facility on a Linux graphical desktop differs from the rm command in that .a. files placed in the trash can are not deleted until the trash can is empties, but files deleted by rm are deleted immediately.
18. Each answer contains several paths separated by semicolons. Which answer contains only absolute paths? .c. /var/named; /etc/samba; /home/abutler.
19. Within the Nautilus file manager, you can view the properties of a selected file or directory by .d. right-clicking the file or directory and selecting the Properties item for the context menu.
20. Within the Nautilux file manager, pressing Shift+Ctrl+N is analogous to which command? .a. mkdir
21. Which of the following commands is most likely to produce the following output on the screen? /home/abutler. .c. 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? .b. cat
23. If the slocate command fails to function as expected, it is likely because .b. the index of file and directory names has not been created using updateb.
24. In Red Hat Linux, documentation files dedicated to each installed software package are stored .a. in the /usr/share/doc directory.
25. The Red Hat Enterprise Linux product line includes several versions such as .b. WS, ES, and Fedora.