CS 2500 Study Questions for Quizzes (Unix Material)
COMPUTER SCIENCE 2500 -- PROGRAMMING II
Chapter 1 -- (Unix) Background
Study Questions:
What are the names of some of the variants of unix?
What is open source code?
Chapter 2 -- Getting Started
Study Questions:
What are some of the (fully-qualified) hostnames of the computers in the
CS lab?
What is ssh and why is it preferred over telnet?
What are some guidelines for choosing a good password? What are the
characteristics of a good password?
The date command prints the date to standard output, and what
else?
If notes is the name of a file, what does the command cat notes do?
What does the ls command do?
How do you enter the ctrl-c command (aka ^c), and what
does it do?
What command do you use to change your password? What is the exact
spelling of the command?
What is the meaning of the ctrl-d 'command' (aka ^d)?
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:
Explain what a home directory is.
What is a (full) pathname? What is the full pathname of your home
directory?
Give some examples of relative pathnames.
What is a current working directory?
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?
What are some of the options that can be used with the ls
command, and what can you accomplish with them?
How can you use the cat command to combine several files into
one?
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)?
What are the chmod and chown commands used for?
What can you do with pg, more, and less?
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:
What is a unix shell?
What is the purpose of the chsh command?
What is the purpose of the which command?
Does *mailrc match the file name .mailrc? If not, why not?
Unix commands can be 'dangerous'. What is the difference between what
the following commands do?
rm a.*
rm a. *
What does the following command do?
cat my_file | grep Grant
What do the following commands do?
ls > myFile
sort < myFile
sort < myFile > myOtherFile
What does the followng command do?
history 20
(If your shell is ksh, the command would be slightly different:
history -20)
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'.
What is filename completion? How do you use it?
Chapter 5 -- Text Editing
Study Questions:
"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?
When in command mode in vi, what do the following one-character commands
do? l, h, j, k, w, and
x?
In the context of text editing, what is a macro?
Emacs is a single-mode editor. What does that mean?
Chapter 7 -- The KDE and CDE Desktops
Study Questions:
Who were the developers of CDE?
What are some of the different systems on which CDE can run?
Chapter 9 -- Networking with TCP/IP
Study Questions:
TCP/IP is a protocol family. What does that mean?
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.
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:
What is a process? What is a process ID?
What does the ps command do?
What does the kill command do?
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:
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:
What is a shell script?
What are some advantages that make it attractive to use shell scripts
instead of alternatives like a C++ or java program?
What is the purpose of the line: #!/bin/sh
at the beginning of a shell script?
How is the dollar-sign $ symbol used in scripts to distinguish between
the name of a variable and the value of that variable?
What are the positional paramaters of a script? What symbols does
a script use to refer to positional parameters and their values?
How is the test command used in conjunction with the if
keyword in shell scripts?
What is the purpose of a command of the following form? sh -x filename
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:
For what are the -o and -c options to gcc or g++ used?
What is a makefile?
What kinds of rules are found in a makefile?
What kinds of dependencies are described in a makefile?
Typically what kind of commands are incorporated into the rules in a
makefile?