Section G. INTRODUCTION TO UNIX Useful Mechanisms The following character(s) have special meaning and are useful in commands that reference files, directories, and pathnames. ~ your home directory (C-shell) . present working directory .. parent directory, the directory directly above your current working directory To copy a file file1 from your home directory to your current working directory, enter: % cp ~/file1 . Pipes (|) allow for buffering of output from one command, as input into another. Example: To view the long format output of the systems root directory one screen full at a time: % ls -lR / | more A command line may contain several commands, each taking it's input from the output of the previous command; these commands are then referred to as filters: % w | sort | more Input/Output (I/O) redirection can be accomplished by using >, >>, and <. If you enter: % cat file1 file2 > file3 the contents of file1 and file2 are written to file3; file3 is created or if it exists, it's contents are overwritten % cat file1 file2 >> file3 the contents of file1 and file2 are appended to file3 if it exists, if not it is created % mail user_name < message.file the mail command will take as input message.file and send it to user_name.
[ Next ] [ Back ] [ UNIX/Linux Intro Start ] [ Chibcha Enterprises Home ]