Unix "Utilities" --- J. Maybury ------------------------------- See the file "unix_basics.txt" for some other Unix commands which will not be repeated in this file (like man, ls, cp, ...). Remember the general format of the Unix command line is: [prompt] % command [option(s)] [argument(s)] Note: the commands described below may or may not contain all of the options/behaviors described dependant upon the system and versions of the commands being used (disclaimer for any errors - they're not mine but the systems :-). --------------------------------------------------------------------------- Input/Output redirection and "piping" (in c-shell) < > >& | |& --------------------------------------------------------------------------- whereis - used to find out the path to a command or program options (optional): see man page arguments (required) - must type at least one argument, the command/program you are looking for. Note: this depends upon your PATH setting. which - Locates a program file including aliases and paths no options. arguments (required) - the commands (or programs) you are looking for. The whereis command tells you where all of the commands may be located - which tells you the one that you would run. Note: this depends upon your PATH setting. date - Displays or sets the date options (optional): see man page. arguments (optional): if you place a "+field_descriptor list" you can control the format of the date output. For example date "+%B, %e" will just display the "month, day" - see the man page for a complete list of field descriptors. cal - Displays a calendar no options. arguments (optional): with 1 argument it will display the whole year for that year ("cal 2002" for example) with 2 arguments it will display that month for that year ("cal 11 2002" for example). grep - Searches a file for patterns options (optional): see man page. arguments (required): file-list of 1 or more files (none can be -) diff - Compares text files options (optional): [-i] ignores case when "diff'ing" see man page for others. arguments (required): file-list of only 2 files (one can be -) note: the default output of diff are actually commands that the "ed" program can use to convert file1 into file2. sort - Sorts or merges files options (optional): see man page. arguments (optional): file-list of any length uniq - Removes or lists repeated lines in a file options (optional): see man page. arguments (optional): file-list of only 1 file (one can be -) cat - Concatenates or displays file options (optional): [-n] number the lines arguments (optional): file-list of any length (one or more can be -) tee - Displays the output of a program and copies it into a file options (optional): see man page. arguments (optional): file-list of any length (none can be -) head - Displays the beginning of files options (optional): [-n lines] will display see man page for others. arguments (optional): file-list of any length tail - Writes a file to standard output, beginning at a specified point options (optional): [-f] this option will force it to keep displaying any new lines that get appended to a file. see man page for others. arguments (optional): file-list of only 1 file (one can be -) cut - Displays specified parts from each line of a file options (optional): arguments (optional): file-list of 1 or more files (none can be -) wc - Counts the lines, words, characters, and bytes in a file options (optional): arguments (optional): file-list of any length (none can be -) file - Determines file type options (optional): see man page. arguments (required): file-list of 1 or more files (none can be -) gzip - compress or expand files gunzip - compress or expand files zip - package and compress (archive) files unzip - list/test/extract from a ZIP archive file tar - Manipulates tape archives gtar - GNU version of tar hostname - Sets or displays the name of the current host system options (optional): see man page. arguments (optional): see man page. uname - Displays information about the operating system options (optional): arguments (optional): see man page. whoami - Displays the user's name no options. no arguments. who - Identifies users currently logged in options (optional): [am i] this option will just display your login info ("who am i") arguments (optional): finger, f - Displays user information options (optional): see man page. arguments (optional): rwho - Shows which users are logged into hosts on the local network last - Displays information about previous logins lastcomm - Outputs information about the last commands executed uptime - Shows how long a system has been running ruptime - Displays the status of each host on a network pwd - Displays the pathname of the current working directory alias - Defines or displays aliases echo - Writes its arguments to standard output $cwd $PATH $path ... set - "Shell command" used to set variables setenv - "Shell command" used to set environment variables banner - Creates a large banner sleep - Suspends execution for at least the specified time time - Times the execution of a command mail - Sends and displays messages lynx - a text based web browser trn - threaded read news program tin - A Netnews reader clear - clear the terminal screen cmp - Compares two files comm - Compares two sorted files Paste - Joins corresponding lines of several files or subsequent lines in one file fold - Breaks or wraps lines in a file groups - Displays your group membership umask - Displays or sets the file mode creation mask ps - Displays current process status kill - Sends a signal to a running process fg - Runs jobs in the foreground bg - Runs jobs in the background nice - Runs a command at a different priority cron - The system clock daemon at, batch - Runs commands at a later time scp - secure copy (remote file copy program) ssh - secure shell client (remote login program) (note can run a command remotely) awk - Pattern scanning and processing language sed - Stream editor test, [ - Evaluates conditional expressions