Chapters 1&2
Home Up Errata / Updates Why Shell? Using Telnet Telnet Logging Chapters 1&2 Chapters 3&7&13 Chapters 4&5 Chapters 6&8 Chapter 22 Chapter 23 Chapters 10&12 Chapter 14 Chapter 15
Updated:
2000-10-09 01:53

Chapters 1&2 Exercises

Read Chapters 1 and 2 of the UNIX text and work on the UNIX system. Make sure you can answer the following questions:

Chapter 1 - UNIX Tour

1-1    What role does the text book intend to play as explained in the first paragraph of Chapter 1?

1-2     What are the two major versions of UNIX?  Which version is used on ACADAIX?

1-3     Skip the "Terminal Window" section on page 11.  Describe three methods of logging off the Unix system.  Try all of them.  Make a note of which one(s) work using your given login shell.

1-4     On page 16, you are asked to try three methods of deleting keystrokes. What are they? Make a note of which one(s) work.

1-5     On page 17, try the two suggested methods of reissuing commands and see which one works.  Name also the key combination that will bring back the last command on our system.

1-6     What is the shell file output redirection character?  What effect does it have?

1-7     What is a home directory?  How would you find out its contents?

1-8     Name 5 commands which can be used to display file contents.

1-9     Name the UNIX commands that will copy, erase, rename, and combine files.

1-10     Work on the review questions on page 30 of the text.

1-11     What does the term utility mean on UNIX?

1-12     What messages do you receive when you issue the following Unix commands, and explain what is happening (type the lines in bold exactly as shown):
              a. copy and the Enter key
              b. cp and the Enter key
              c. cp xyz xyz zyz and the Enter key
              d. cp xxx yyy and the Enter key

1-13     What is the pipe symbol? What effect does it have?

1-14     Explain the advantages of using the pipe symbol in a UNIX command.

1-15     What command line would you use to list users who are online in alphabetic order?

1-16     How would you produce a count of the number of users online without displaying each user?

1-17     Give the command line used to display only the number of users in the /etc/passwd file.

1-18     Explain the function of the grep command.

1-19     On pages 41-42, the text provided 3 commands that you could use to examine Unix environment variables.  Make a note of which methods work using your shell and ACADAIX.

1-20     What does the $ character mean when given as input to the shell?

1-21     On page 45, why is the file total listed twice by the command:  wc *

1-22     State the command used to find all files in your current directory whose name start with 'user'.

1-23     Explain the difference between echo $HOME and echo \$HOME.

1-24     How would you continue a long command onto a second line?

1-25     Explain the difference between echo user* and echo 'user*' .

1-26     From where do the following utilities read their input?  Where does the output go?
              a. date
              b. who
              c. sort
              d. sort > s_output
              e. cat

1-27     Explain what you would get as output from each of the following 5 commands:
              a. who | sort
              b. who | sort -r
              c. who | wc -l
              d. who | grep $LOGNAME
              e. who | awk '{print $2, $1}'

1-28     Explain the difference between these two command lines:
              a. sort  mypasswd
              b. sort  < mypasswd

1-29     Which group of the noclobber commands works in our system?
              'set/unset noclobber' or 'set +o/-o noclobber'.

1-30     Continue working from page 58 to 81. Practice write and mail with a friend, change your prompt to "Next command please:=>", set the alias of rm to "rm -i", and create the shell script new_script as illustrated. What command did you use to change your prompt?  What command did you use to create the alias for the rm command?

1-31     Explain why the command on the top of page 66 (rm filename) does not remove the file right away.

1-32     What does pwd stand for?

1-33     Explain the differences among the following commands:
              a. cd /
              b. cd ..
              c. cd
              d. cd ../..
              e. pwd

1-34     Explain how to extract and display your login entry from the /etc/passwd file.

1-35     What starts a process?  Is the shell you are interacting a process?

1-36     Explain how to run a process in the background.

1-37     Explain the difference between ps and ps -ef.

1-38     Explain how to tell the shell to stop the key sequence CTRL-D from logging you out.

Chapter 2 - The Unix Text Editor vi

2-1.     Name 6 commands that switch vi from command mode to append/insert mode.

2-2.     Name two ways to open a document.

2-3.     How do you save a document and exit? How do you save a document without exiting?  How do you exit vi without saving the document?

2-4.     Explain the following vi command mode instructions:
              w, b, e, a, i, o, u, dd, x, A, O, yy, p, r, R, J, s, cw, cc, C, k and h.

2-5.     Explain the following vi settings:
              :set number
              :set showmode
              :set list

2-6.     What is the file .exrc used for?

2-7.     Explain how to redraw the screen. (See page 143)

These exercises were originally created by Maitang Mark

Web Author: Ian! D. Allen idallen@ncf.ca
Updated: 2000-10-09 01:53