CS501 - Study Guide

(revised 3/1/02)


  1. What can and what cannot a user do when she has the right to execute butnot the right to read a directory?
  2. Leila places an executable file called ls in her home directory. The idea is that if Sindbad wants to look at what files she has, he will first cd to the directory and then invoke ls, where upon Leila's ls file is executed rather than the system version. - What consequences can this have for Sindbad, if Leila dislikes him? - What can he do to protect against such tricks?
  3. What is the purpose of the unusual comment (#!) line used in shell scripts?
  4. Suppose that after logging in you see some funny characters on the screen. Also, whenever you try to use the cursor keys you see funny characters. What problem do you suspect and how would you try to correct the situation?
  5. Explain the meaning of the operation "export" in the shell.
  6. Suppose you want to create a file with a short sentence in it. How can you do this, from the shell?
  7. Suppose that you run a program and it gets out of hand. You type Ctl-C but it does not work since the program catches thissignal, or it is running in the background. What can you do to stop it?
  8. What is the vi command for each of the following tasks?
    a. save the work and exit
    b. go down one line
    c. delete a character
    d. enter command mode
  9. Explain some options of the ls command.
  10. Find all files in the /usr directory that start with lp.
  11. Display the directory you are currently in.
  12. Delete all files in the current directory.
  13. Sort the comment fields from the /etc/passwd file.
  14. Sort the /etc/passwd file by uid numbers?
  15. What is the purpose of ps
  16. What is the purpose of su
  17. What is the purpose of clear.
  18. To create a home page (using UNIX), it is sufficient to allow everyone read permissions to the file(s) and read and executable permissions to the directory called public_html is in your home directory. Assume you have a file called index.html in your public_html directory. What commands are necessary to make it readable on the web? What else is necessary to allow access?
  19. Change your password.
  20. Who else is on the system?
  21. Display all files and directories in /usr/grader.
  22. What command searches for file names.
  23. Find all the files in the /bin directory that begin with b.
  24. UNIX is a multi-tasking, timesharing operating system. Explain the terms multitasking, multiprogramming, and time sharing.
  25. What is UNIX? Who developed it, where, when, and why?
  26. Discuss the strengths and weaknesses of UNIX.
  27. Why is UNIX so popular with programmers?
  28. Why is UNIX so portable?
  29. What is the relationship between UNIX and C?
  30. Two important parts of a UNIX system are the kernel and the shell. Explain the purpose of each. Name three commonly used shells. What is your default shell (how can you determine your default shell)?
  31. Describe the structure of a UNIX file system. How is access to files controlled? How are access permissions changed?
  32. What limitations / restrictions does UNIX place on file names?
  33. What is the significance of the wild cards (* and ?) in file names. Explain what the following commands do:
    1. rm *.*
    2. cat a*.c
    3. ls ???.*
  34. What is a home directory? What is the significance of your home directory?
  35. Explain what each of the following UNIX commands do and be able to use them.
    1. who
    2. cd
    3. cp
    4. cat
    5. passwd
    6. mkdir
    7. mv
    8. rmdir
    9. rm
    10. whoami
    11. pwd
    12. chmod
    13. tail
    14. ps
    15. man
    16. ls, ls -l -a
    17. kill
    18. exit
    19. TERM
    20. echo
    21. PATH
    22. sh, ksh, csh
    23. ping
    24. traceroute
    25. pine
    26. pico
    27. pipe (|)
    28. redirection, <, >, etc.
  36. What is I/O redirection? Explain the following:
    1. cat file1 > file2
    2. ls >> a_file
    3. sort < a_file
  37. What is piping? Explain the following:
    1. sort < a.file | pg
    2. ls | pg
  38. Some UNIX files are said to be hidden.
    1. What determines whether a file is hidden?
    2. Give examples of several hidden files that might be found in a user's home directory.
  39. List and briefly discuss two UNIX editors.
  40. What is vi? Why is it useful to know vi?
  41. vi has two modes of operation. What are the two? How do you change from one mode to the other?

Answer the following questions using absolute/relative pathnames. Your working directory is eric

1. copy the file data to fred's directory hmwk
2. move the file ex3.c to directory lea
3. copy the directory projects to directory eric
4. move the directory roger to directory c of zephyrus
5. copy the directory zoe to directory b of borea
6. remove the directory chm