Unformatted text preview:

COP3353 Final Study Guide Components of the Unix OS o Kernel master control program o Shell interprets user commands o File System information organized as files and specialized files called directories o Executable program in a form that can be executed o Process activation or instantiation of an executable o Daemons processes spawned by the kernel OS to perform tasks on behalf of OS to manage system resource o Commercial versions SunOS Solaris SCO Unix Aix HP UX Ulrix o Freely available version GNU Free Software Foundation Linux NetBSD FreeBSD o Command line prompts vary depending on the shell and or version of Unix o Shells Tshell or Tenux shell default Bourne shell C shell Korn shell Bourne again shell Editors o vi i Esc x q e w w file q wq 12x dw dd 5dd x s x c x w k y x f a b c e f Insert mode Command mode Save the file if it has changed and quit vi Quit vi Edit file Save as file Save as an existing file Quit vi without saving changes Save the file and quit vi Deletes 12 characters Deletes word Deletes current line Deletes five lines o emacs o pico nano Saves file Closes file Save a file with a new name Cuts text to end of line Pastes text Find a file and copy it into buffer Move to beginning of line Move back one character Shows current position Move to the end of line Move forward one character Move to the next line Saves file Move to the previous line Move forward one page Move back one page Cuts text Exits the editor commandname flags parameters n o p v y k x ls a l cat more touch cp mv rm pwd mkdir rmdir cd passwd wc w c l file man List files a all files l gives detailed info View file contents View file contents pause each screen Creates file updates time stamp Copy file to the new file Move file to a new directory rename file Delete file Display absolute pathname to current directory Create directory Remove directory Navigate directories Change your password Counts the words characters and of lines Manual pages Structure of Directories o is the starting directory or root Pathnames o is also the separator between the directories and final file o Absolute Pathnames starts at current directory o Relative Pathnames starts at current directory o refers to parent directory o refers to current directory Removing a file directory o rm confusing name o rmdir directory name Wildcards condone chap7 c File Permissions o matches any number of characters in a filename con matches condor o matches any single character in a filename b t matches bit bot bat o matches any one of the characters in the brackets chap 5 8 c matches chap5 c o User group other o Read 4 write 2 execute 1 o Changing permissions chmod numbers filename directory Standard input output and error o Standard input 0 stdin default place where a process reads its input terminal keyboard terminal display o Standard input 1 stdout default place where a process writes its output o Standard error 2 stderr default place where a process can send its error messages terminal display Redirecting standard I O o Redirecting standard input from a file a out input12 o Redirecting standard output to a file testprog1 testout1 o Redirect stderr and or stdout at the same time a out input12 testout o operator appends to a file so that it doesn t overwrite what s already in the file o Allow standard output of one program to be used as the standard input of another o Pipe operator takes the output from the command on the left and feeds it as standard input to the command at the right of the pipe Piping program Redirection o command file output redirection o command file input redirection o pipes are used between two commands Separating Commands o Separate instructions by Other commands o diff compares two text files and prints the lines for which the files differ diff options original file new file example diff w testprog1 c testprog2 c Options b treats groups of spaces as one i ignores case r includes directories in comparison w ignores all spaces and tabs a stands for added d stands for deleted c stands for changed Example of output of diff command 5c5 means difference on the fifth line of both files and c that something was changed o grep searches files for a particular pattern examples grep int c finds all occurrences of the pattern int in all files with a c extension i ignores case n displays the line numbers l display only names of files and not actual lines o tar command tar options filenames c insert files into a tar file f use the name of the tar file that is specified v output the name of each file as it is inserted into or extracted from a tar file x extract the files from a tar file t list contents of an archive z will gzip gunzip if necessary Creating an Archive tar flags tarname files to put in tar tar cvf prog tar c h Extracting files from an archive tar xvf proj tar tar xvzf proj tar gz extracts files but also unzips files in the process compares two files byte by byte an tells you where they differ usage cmp myfile1 o myfile2 o gzip gunzip compressing and restoring gzip bigfile original file is gone gzip d bigfile gz OR gunzip bigfile gz restores a gz file o cmp and gzip cmp o ps command o jobs o fg job o bg job o Ctrl Z o Ctrl C report on current processes e views all processes on the system f views the full format a all processes except for session leaders aux l view the long format view the current background processes you are running puts a job into the foreground process puts a job in the background Suspends the current foreground process Kills foreground job o kill PID kills a running process through its process ID PID KILL or 9 sends a KILL signal to override and halt processes that can t be killed with normal kill command o sleep command delays for a specified time for a certain number of seconds o Use to launch a process as a background job Example sleep 30 can be used to stop a specific job running in the background o stop Scripts o always start with bin sh AND make executable by changing permissions o exit immediately quits the shell script exit 0 ends script and sends back the good status of 0 exit any number exits with an error code o indicates comment is following it o echo prints out a line to stdout o contains the number of command line arguments o string containing the command line arguments o 1 9 refer to up to nine command line arguments o 0 contains the name of the script o Environment Variables Example setenv PATH PATH home here bin o User …


View Full Document

FSU COP 3353 - Components of the Unix OS

Download Components of the Unix OS
Our administrator received your request to download this document. We will send you the file to your email shortly.
Loading Unlocking...
Login

Join to view Components of the Unix OS and access 3M+ class-specific study document.

or
We will never post anything without your permission.
Don't have an account?
Sign Up

Join to view Components of the Unix OS 2 2 and access 3M+ class-specific study document.

or

By creating an account you agree to our Privacy Policy and Terms Of Use

Already a member?