Sobell Exercises, Chapter 3

1. What command can you use to determine who is logged in on a specific terminal?

2. List some differences between talk and write. Why are three different communications utilities (talk, write, mailx) useful on a UNIX system?

Describe a situation where it makes sense to use:

  a. mailx instead of talk or write

  b. talk instead of write

  c. write instead of talk

3. How can you send a single mail message to agnes on the system named cougar and to jim on the system named ucsf? Assume your computer has network links to cougar and ucsf.

4. Describe a method for synchronizing communication with another user when you are using write?

5. How can you keep other users from using write to communicate with you? Why would you want to?

6. What happens if you give the following commands when the file called done already exists?

$ cp to_do done

$ mv to_do done

7. What command will send chapter1, chapter2, and chapter3 to the printer?

8*. How can you find the phone number for Ace Electronics in a file called phone that contains a list of names and phone numbers? What command can you use to display the entire file in alphabetical order? How can you remove adjacent duplicate lines from the file?

9. Try giving these two commands:

$ echo cat

$ cat echo

Explain the difference between them.

10*. How can you tell whether the file memo is the same as the file memo.bak?

11*. How can you use the tail utility to display the last line of a file [called file]?

12*. What command can you use to look at the first few lines of a file called status.report? What command can you use to look at the end of the file?

13*. Alex is expecting a mail message from Scott? How can he find out if he has recieved one?

14*. How might you look at the last mail message someone sent you, without running the mailx (mail) utility?

15. How can you find out which utilities are available on your system for editing files?

16*. Repeat exercise 8 above using the file phone.Z, a compressed version of the list of names and phone numbers. Try to consider more than one approach to each question, and explain how you chose your answer.