Cis 240 - execute the alias command and view the list of


Purpose: Customize a user account.

NOTE: These instructions were written with reference to version.

REMEMBER: You can exit vi without saving any changes by pressing the ESC key, then colon, q, exclamation point (:q!).

1. Boot your system and open a command shell.

2. Execute the alias command and view the list of aliases available to your user identity. Note that this list will vary from distribution to distribution.

3. Issue the command bash to create a new shell atop the one opened previously.

4. At the command prompt, create an alias which will display a long listing of all of the files in the directory, converting the sizes to human-readable format, and including all of the "dotfiles" except for the current directory (.) and the parent directory (..).
alias lh='ls -Alh'

(NOTE: The spaces and single quotes are important.)

5. Test your new command; use the alias command with no arguments to view it.

6. Now use the exit command to close the shell you opened previously. You should still see a command prompt, since that shell lay over the top of the original window. Try your lh alias again - it does not work! The alias was known to that command shell, but it vanished when that shell closed.

7. Make sure you are located in your home directory, then open the .bashrc file for editing.

8. Search for a good place to add aliases to that file (do not use a separate file), then enter the same command you used at the command line earlier. Adding the command to the configuration file will make it available whenever a new shell is started.

9. Close the vi editor and try your new alias - it does not work!

10. Now type the command bash; recall that this creates a new command shell over the top of the one you are currently using. Try the alias now. What changed to make it work?

11. Right-click on the desktop and explore the options for customizing your background. Can you see how you would go about placing an image there?

12. Bring up a command shell and verify that you are currently working in your home directory. Create a new directory there; give it the name Themes.

13. Visit the part of the GNOME web site devoted to creating new looks for desktops: art.gnome.org. Select the Backgrounds tab, find an image you like, and save it to your Themes directory.
NOTE: This may take some effort. The image may be embedded in an HTML wrapper, so you may have to save it by right-clicking.

14. Click on System Settings, then Appearance. Note that this is the same window you saw earlier. Choose the Background tab. The image(s) you downloaded are not listed as options, here. Click the +Add button (it might appear as a + button), navigate to your Themes directory, and add the new images to the list. Change your background.

15. Go back to the GNOME artwork web page and select the Themes tab. Click on Window Borders and select an entry from that area for download. When you download it, save the file rather than running the Theme Installer. Where is the file saved?

Move the file from that location to your Themes directory. Now go back to your Appearances window (re-open the window if you have closed it). Click the Themes tab. Click the Install button, navigate to your Themes directory, and select the theme you downloaded. Click Open to install it.The lecture notes (Powerpoint slides) compare the configuration of your Ubuntu system to Windows XP. However, many students are more familiar with Windows Vista and Windows 7. Augment the comparison in the slides with the features of those operating systems - are there things which interfere with your comparison?

Explain your position and be sure to include a real world example in your response. Be sure to include your cited your source(s) to support your position.

Worksheet

Purpose: Customize a user environment.

NOTE: These instructions were written with reference to version 12.04LTS of Ubuntu.

REMEMBER: You can exit vi without saving any changes by pressing the ESC key, then colon, q, exclamation point (:q!).

1. Boot your system and open a command shell.

2. Execute the command echo $PATH to view the list of directories included in your search path. When you issue a command, the OS looks in these locations for the code that corresponds to the command. Use the set | more command (note the use of the pipe) to view the information included in your environment. Concentrate on the first few pages of output. Now use the printenv command to view your environment variables. What is the difference between the set and the printenv commands?

3. Issue the command bash -l to create a new login shell atop your original shell.

4. Execute the command echo $PATH to view the list of directories included in your search path. What is the most notable change (if any)?

5. Type exit to return to your original command shell. Check to see that the PATH variable has returned to its original value.

6. Execute the command ZARKOV='... it is my fault the earth is being destroyed?' (DO NOT use any spaces, but DO use single quotes).

7. Use the printenv command to view the information included in your environment. Notice that ZARKOV is included on the list now. Also note the contents of the variables mentioned in the lecture.

8. Issue the bash command to start a new shell (NOT a login shell). Run the printenv command again - notice that the ZARKOV variable has disappeared.

9. Type the exit command to return to your original shell, then use the printenv command to view ZARKOV; notice that it remained a part of the orginal shell even when the new one was opened above it.

10. Now issue the command export ZARKOV - this command will make the variable available to children of the original shell. Issue the bash command to open a child shell and use the printenv command to verify that the child has access to the variable.

11. Use the exit command to close the child shell and return to the parent. Start a new login shell using the bash -l command. Is the ZARKOV variable carried into the new shell? Did you expect it to be?

12. Use the exit command to close the child shell. Issue the command unset ZARKOV to remove that variable from the list. (NOTE: If you perform a printenv command, you will see the line _=ZARKOV at the end of your list; the underscore is a special-purpose variable. Your ZARKOV really has been removed.)

13. Make sure that your current working directory is your home directory, then edit ~/.profile.

14. Near the end of the file, add a line which reads:
export ZARKOV='Get your toothbrush!'

15. Save your changes and close the file. Then perform the printenv command to show that your ZARKOV variable does not exist.

16. Run the bash command, then the printenv command - ZARKOV does not appear!

17. Close that shell with the exit command, then open a new login shell with the bash -l command - NOW your ZARKOV variable is visible.

18. Close that shell with the exit command, then open the ~/.profile for editing again. Right below the line in which you assigned a value to the ZARKOV variable, add a line which extends that value:
export ZARKOV=$ZARKOV' and whatever!'
Re-open the login shell to see that your change has taken effect.

Why is the $ZARKOV included in that command? What would happen if it were not there?

19. Use the command echo $PATH to view the contents of that environment variable. Recall the work we did with processes earlier in the course. In your current shell, which is a login shell, is your personal bin directory included in the search path?

Exit the login shell; is your personal bin directory there now?

Find the line in your ~/.profile which includes that directory and write it here:

Why is the $PATH included in the assignment?

(To make the next set of instructions easier, maximize your terminal window.)

20. Issue the command echo $PS1 to view the contents of the prompt string. You may safely ignore a good chunk of that string - the ${debian_chroot:+($debian_chroot)} part - since it is empty in our installation of Ubuntu. Compare the remainder of the prompt string to what you see displayed on your screen; interpret what you see. (NOTE: The @ and : are displayed literally, and the \$ produces a $.)

\u ____________________________________________________________

\h ____________________________________________________________

\w ____________________________________________________________

21. We will now search through the bash manual page for information about the prompt string. To perform a search, you type the slash character (/), then type the string for which you wish to search. In this case we will search for the string "prompting", so type man bash to bring up the manual page. Once it is displayed, type the / character, then the string prompting and hit ENTER. You will see your search string highlighted at the top of the page. Read that section: what does the man page identify as the default value of the prompt string? Do you see that on your system?

22. Repeat your search, so that you can view the next instance of the string "prompting". In this section you see descriptions of the characters used in prompt strings.

23. Leave the man page up in that window, and open a new one. In the new window, issue the command:
PS1='Havent you any spirit at all? '
(NOTE: The single quotes are important.) Now change the prompt to the value that the man page identified as the default:
PS1='\s-\v\$ '
What is displayed?

24. View the man page again. Imagine that you are working on a computer with a hostname of mongo.bellevue.edu, that it is 4:00PM, and that you are on command number 100. What command would set your prompt string so that it contained
mongo 16:00 100 >

25. Given that the control sequences used to define the prompt string are particular to the BASH shell, which configuration file should be used to set a user's individual prompt?

Solution Preview :

Prepared by a verified Expert
Operating System: Cis 240 - execute the alias command and view the list of
Reference No:- TGS01402093

Now Priced at $110 (50% Discount)

Recommended (91%)

Rated (4.3/5)