Here are some of the common Unix commands needed to get started:These commands are issued from the Unix prompt. Unix is case sensitive.Spaces are important, so don't put any spaces where none is shown.However, the number of spaces is not significant, so if there is onespace, there could be several.ls -- provides a listing of all the files (including subdirectories) in the current directory. Note: you can use wildcard characters with this command. E.g., the following command lists all files in the current directory with the .c extension: ls *.cls -l -- provides additional information about each file including its length in bytes, its protections, and the date it was last changed.pwd -- provides the path name of the current directory starting from the root directory.cd <directory> -- moves you down the unix directory tree structure into the named directory. E.g., suppose the directory you are currently in has a subdirectory named cop3002. Then the following command will move you into that subdirectory: cd cop2220cd <full pathname> -- moves you into the directory whose full pathname is given. E.g., the following command will take you to our class public directory from whereever you are: cd /usr/public/cop3002/kmartin cd all by itself returns you to your home directory.cd .. moves you up one level in the directory tree.mkdir <subdirectory name> -- creates a subdirectory of the current directory with the given name.rmdir <subdirectory name> -- removes an empty subdirectory with the given name from the current subdirectory.cp <filename1> <filename2> -- makes a copy of the file with filename1 and gives the copy the name filename2. Example: $ cp mypgm1 mypgm2 <return> After doing this both mypgm1 and mypgm2 have the same contents.rm <filename> -- removes the file with the given filename from the current directory. If there is a file with the same name in some other directory, it is not affected. Note: you can use wildcard characters with this command. E.g., the following command removes all files from the current directory with the .c extension:rm *.cmv <oldfilename> <newfilename> -- moves (renames) a file named oldfilename to a file named newfilename. Example: $ mv mypgm1 mypgm2 <return> After doing this, mypgm1 no longer exists. mypgm2 is what mypgm1 used to be.lpr <filename> -- causes a copy of the file named to be printed on the system printer along with a header page which includes your login id. Note: DO NOT EVER, EVER try to print executable code such as a file created by the compiler.gcc <filename> -- invokes the Gnu C compiler. It expects the file named to have a .c extension. If the file compiles with no errors, a file named a.out is created and stored in the current directory. To execute that file, simply type the name of the file at the Unix prompt. If the compiler finds errors, (sometimes cryptic) error messages are generated and are sent to the monitor screen.cat <filename> -- scrolls a copy of the named file on the monitor screen. (If the file is long enough that it doesn't all fit on one screen, the top scrolls off the screen.)more <filename> -- copies the named file to the screen a page at a time. less <filename> -- is similar but more powerful. Allows scrolling backward as well as forward and has other
View Full Document