CSci 553: Spring 2006 Exam 1: Study Guide (UPU)Ch #2: Basic Unix Utilities * Know the following basic set of Unix command line utilities. Do you know what these commands do? Do you know some of the more common options for these commands? For example, how do you get a listing of the file permissions for the files in a directory? How do you add execute permissions to a file? How do you get help for a command to, for example, find out what options the command supports? o cat o chmod o cp o ls o less/more o man o mv o pwd o rm o rmdir o wc * Are you familiar with the following concepts: o Every running process has a user and current working directory associated with it. How do you find out the current working directory you are in when you are using the shell? o Unix files are organized as a hierarchy of directory and file structures. There is a single root to the complete file system on a Unix system. How is this root referred to? * What is the difference between an absolute and relative pathname? Can you specify an absolute pathname for a file in your home directory? Can you specify a relative pathname to a given file given you are currently in your home directory? * How do you refer to the current directory on the command line? How do you refer to the parent directory (one level up from your current directory)? * How do you find out the owner of a particular file? How do you find out if a file is readable by the owner? Readable bsy someone else? o vi and emacs editors: * Do you know how to insert and delete text in either editor? Do you know how to move around a file in either editor? How to save a file or quit without saving? * Do you know how to search for a string in vi and emacs? (UPU)Ch #3: More advanced Unix Utilities * You should also be familiar with these following more advanced Unix utilities as well: o find: Can you use find to locate all c source code files in your home directory? o grep: Do you know how to use grep to search a file for a particular string? Can you use find and grep together to search all of your c source code files for some string? * Are you familiar with the concept of filtering files? Of creating a pipe to pass some data through multiple filters? (UPU)Ch #4: Unix Shell * You should be familiar with the following concepts supported in all Unix like shells. Most all of these concepts are used exactly the same across all Unix shells. o I/O redirection * Can you redirect input from a file into a command. Can you redirect the output of a command into a file. o Pipes * Can you create a pipe to pass some data through multiple filters. What is the pipe symbol? What exactly is a pipe doing? o File name wildcards * What is the difference between * and ?. Do you know what ~ refers to? How would you list all files in your directory that end with a ‘h’? How would you list all files that are begin with an ‘a’ or ‘b’ and end in ‘.h’ o Shell/environment variables * In particular know what the PATH, HOME and USER variables contain. * How do you display the value held in an environment variable? * How do you update your PATH? How do you make sure that an update to an environment variable, like PATH, will be visible in subshells of your current shell? * Updating an environment variable is done differently in different shells. Know at least one way of doing it and in which shell it works in. Also know how to export an environment variable so that it is visible in any subshells / subprocesses. o Making a file Executable: * There are 2 things that need to be done. The permissions of the file need to be set to have execute permissions for the appropriate category (user, group and/or other). Also the file needs to be findable by the shell, by either updating your PATH or by specifying the location of the command to execute using a relative or absolute path name. Perl and Python: * How does a high-level scripting language differ from a robust language such as C or Pascal? What about Java? * What are the main uses of a high-level scripting language? * Could you write me a simple loop in Perl or Python (your choice) to print out all of the odd numbers from between 1 to 100? * Could you write me a function in Perl or Python to find the maximum of 3 numbers passed into the function as parameters? (UPU)Ch #9: Networking * Are you familiar with the common addressing scheme used for the TCP/IP, the IP address? o What is the format of an IP address? o Can a machine have more than 1 IP address? * Do you know what the relation is between a port and a system service? What is the relation between a port and an IP address? (UPU)Ch 12: Programming Tools and Systems Programming on Unix * How would you compile 3 C source files separately to make object files? What would you then do to link the object files together? Do you know how to specify that a particular library, lets say libsodas.a, should be linked into the program? What if the library does not reside in a standard library location, how do you tell the linking process where to find the library? * What is the ld command? What is its relation to the gcc compiler? * In general terms, what is a Makefile used for? A Makefile maintains file dependencies and it also automatically updates/recompiles a project/module using such dependencies to only compile files that need to be recompiled. * Could you understand a simple Makefile and determine what commands would be executed from it given a listing of files and the dates the files were last modified? * What is an archive and how do you create one under Unix using the ar command? * What is a version control system used for?