CS 2500 Study Questions for Quizzes (Unix Material)
COMPUTER SCIENCE 2500 -- PROGRAMMING II


Chapter 1 -- (Unix) Background

Study Questions:

  1. What are the names of some of the variants of unix?
  2. What is open source code?

Chapter 2 -- Getting Started

Study Questions:

  1. What are some of the (fully-qualified) hostnames of the computers in the CS lab?
  2. What is ssh and why is it preferred over telnet?
  3. What are some guidelines for choosing a good password? What are the characteristics of a good password?
  4. The date command prints the date to standard output, and what else?
  5. If notes is the name of a file, what does the command
    cat notes
    do?
  6. What does the ls command do?
  7. How do you enter the ctrl-c command (aka ^c), and what does it do?
  8. What command do you use to change your password? What is the exact spelling of the command?
  9. What is the meaning of the ctrl-d 'command' (aka ^d)?
  10. What do the cal, who, finger, write, talk, mesg, and man commands do, and how do you use them?

Chapter 3 -- Working with Files and Directories

Study Questions:

  1. Explain what a home directory is.
  2. What is a (full) pathname? What is the full pathname of your home directory?
  3. Give some examples of relative pathnames.
  4. What is a current working directory?
  5. What is the special shorthand notation for referring to the parent of your current working directory? For referring to your current working directory? For referring to your home directory?
  6. What are some of the options that can be used with the ls command, and what can you accomplish with them?
  7. How can you use the cat command to combine several files into one?
  8. What do the pwd, cd, mv, cp, ln, rm, mkdir, rmdir, and commands do, and how do you use them (and some of their options)?
  9. What are the chmod and chown commands used for?
  10. What can you do with pg, more, and less?
  11. What is the lp command for? How do you use it with the option(s) that you usually need?

Chapter 4 -- The Command Shell

Study Questions:

  1. What is a unix shell?
  2. What is the purpose of the chsh command?
  3. What is the purpose of the which command?
  4. Does *mailrc match the file name .mailrc? If not, why not?
  5. Unix commands can be 'dangerous'. What is the difference between what the following commands do?

    rm a.*

    rm a. *

  6. What does the following command do?

    cat my_file | grep Grant

  7. What do the following commands do?

    ls > myFile

    sort < myFile

    sort < myFile > myOtherFile

  8. What does the followng command do?

    history 20

    (If your shell is ksh, the command would be slightly different: history -20)

  9. Suppose you have been working at your unix computer continuously for the last several minutes. You executed a command about five minutes ago by typing (at the shell prompt) a long series of hard-to-remember strings. Now you want to execute the very same command again. Explain how you would do this 'the easy way' by using 'command-line editing'.

  10. What is filename completion? How do you use it?

Chapter 5 -- Text Editing

Study Questions:

  1. "vi starts up in command mode." What does that mean? If you just want to create and save some text in a file, what sort of things do you need to know?

  2. When in command mode in vi, what do the following one-character commands do? l, h, j, k, w, and x?
  3. In the context of text editing, what is a macro?
  4. Emacs is a single-mode editor. What does that mean?

Chapter 7 -- The KDE and CDE Desktops

Study Questions:

  1. Who were the developers of CDE?
  2. What are some of the different systems on which CDE can run?

Chapter 9 -- Networking with TCP/IP

Study Questions:

  1. TCP/IP is a protocol family. What does that mean?
  2. In a nutshell, what do the following commands/programs do? rcp, rsh, rlogin, ftp, telnet, finger, ping, ssh, sftp.
    Be able to write an example of what you would type at the command line to use each command.
  3. When using an ftp program, what are the following commands used for? binary, ascii, get, put, mget, mput.

Chapter 11 -- Processes and Scheduling

Study Questions:

  1. What is a process? What is a process ID?
  2. What does the ps command do?
  3. What does the kill command do?
  4. What does the kill command "send"? Can you use the kill command to "send" different things?

Chapter 18 -- Using Unix and Windows Together

Study Questions:

  1. Be able to discuss similarities and differences between Windows and Unix, from the point of view of the user.

Chapter 20 -- Shell Scripting

Study Questions:

  1. What is a shell script?
  2. What are some advantages that make it attractive to use shell scripts instead of alternatives like a C++ or java program?
  3. What is the purpose of the line:
    #!/bin/sh
    at the beginning of a shell script?
  4. How is the dollar-sign $ symbol used in scripts to distinguish between the name of a variable and the value of that variable?
  5. What are the positional paramaters of a script? What symbols does a script use to refer to positional parameters and their values?
  6. How is the test command used in conjunction with the if keyword in shell scripts?
  7. What is the purpose of a command of the following form?
    sh -x filename
  8. What does the following script do?
    
    #!/bin/sh
    
    i=1
    while [ $i -le 10 ]
    do
       expr $i \* $i
       i=`expr $i + 1`
    done
    

Chapter 24 -- C and C++ Programming Tools

Study Questions:

  1. For what are the -o and -c options to gcc or g++ used?
  2. What is a makefile?
  3. What kinds of rules are found in a makefile?
  4. What kinds of dependencies are described in a makefile?
  5. Typically what kind of commands are incorporated into the rules in a makefile?