ITU UNIX Operating System

Total Page:16

File Type:pdf, Size:1020Kb

ITU UNIX Operating System

ITU – UNIX Operating System Assignment #2

UNIX UTILITIES

1. Write a command to determine who is logged in on a specific terminal.

2. List some differences between pine and write. Describe a situation where it makes sense to use:

a) pine instead of write b) write instead of pine

3. Make a new copy of mars.txt called marsx. What happens if you give the following commands when the files bio and marsx both already exist? Don't guess, try it!

a) cp bio marsx b) mv bio marsx

4. Write a command to determine which utilities are available on your system for editing files. Is the command sed among them?

5. Write a command to determine whether the name “bob” is in the file “Addresses.”

6. Write a command to display the entire file “Addresses” in alphabetical order.

7. Use gzip to compress your bio file, and then compress a text file called “food.” What happens if you use diff to compare these two binary files that are not identical? When you are done, uncompress the two files.

8. Use man to determine what the grep command does for you. Report on your results.

9. The date command comes with an ability to format the output in different ways. Determined and explain the result of the following commands: date "+%D" date "+%H" date "+%D %H" date "+%b %B"

10. The echo command can be used with back quotes (under the ~ Character in upper left corner of keyboard). Determine and explain the result of the following commands: echo date echo `date` (notice both are ` -- back-quotes, not ' --single quotes) echo dats is `date` echo `$$$`

11. Determine and explain the result of the following commands: date ; who ( can you guess the effect of ";" here?) date; date "+%D" who ; whoami cal 2005; date

Recommended publications