General man page for tzsh (update for version 0.62) From man pages from an IBM AIX Version 3.2 (C) Copyrights by IBM and by others 1982, 1993. and a Sequent DYNIX/ptx 4.0 V4.1.4. This is a Freeware shell based on the excellent Korn shell. The file tzsh.prf may be used to initialise your environment The following (subset of) commands are internal to tzsh for DOS, Windows and UNIX as appropriate, otherwise the native command is used. Please note that UNIX style slashes ( e.g. /) can be used on all file system commands, even for DOS & Windows builds of tzsh. Examples are given below, delimited within single quotes. -------- Environment and Process Commands alias Creates aliases for commands, e.g. 'alias ll=ls -l', or 'alias np=notepad'. The command 'np myfile.txt' would then start the notepad program with the specified file. 'alias' by itself displays all defined aliases. unalias Clears a command alias. shift Shifts positional parameters for shell scripts. history Display command history. r Repeat a command by specifiying it's number (absolute or relative e.g. r 235 or r -2). pwd Displays the path name of the working directory. cd Changes the current directory (UNIX style slashes may be used). 'cd -' changes to previous directory. network aware - e.g. cd h:/mydir is possible. ls Displays the contents of a directory. Options: -s size info, -l full info, -R recurse, -C column format. lp Print file to output destination, 'lp [-d dest] file' or uses variable LPDEST for destination. echo Writes character strings to standard output. Supports special chars such as \n for newline, \r for carriage return, \c for continue on current, \t horizontal tab. clear Clears the terminal screen. cat Displays contents of file to screen. Supports options: -v decimal view of non-asci, -h hex view of non-asci, -H hex view of all, -b process file as binary (good for recombining split binaries). cp Copy files. Supports option -i for interactive query for ok to copy if file already exists, e.g. 'cp afile $MYDIR' will copy the 'afile' to the user directory in the variable MYDIR. Note: If the destination directory is the current one then only the source need be specified (as in DOS), although UNIX style '.' is also supported. mv Move files. Supports option -i. rm Remove files. Supports option -i. mkdir Creates the named directory in mode 777. rmdir Removes the named directory. touch Update the timestamp on files. run Begins running an application or forces execution of the command, most programs can be started by simply typing their name. . Processes the specified file as a script within the current shell. set Displays, creates, changes or deletes a global environment variable. Also enables options to be set using 'set -o opt mode' syntax, e.g. 'set -o' and 'set -o xtrace on', the last example is equivalent to 'set -x' or 'set +x' for 'off' mode. env Displays all local environment (see = for setting, these have precedence over globals). unset Deletes a local environment variable (see = for setting). expr Evaluates arguments as expressions. e.g. v=`expr 1.2 + 3.0` would set v to 4.2, then v1=`expr $v + 2` would set v1 to 6.2. Also support $(( expr )) for expression evaluation, e.g. v=$(( 1.2 + 3.0 )) would be the same as above. more Displays continuous text one screen at a time on a screen. q/Q to quit more, b/B to scroll back a page, for 1 line, for 1 screen, a forward slash then some text e.g. '/searchstring', will move forward until the searchstring is found. pg, page Similar to more but no display of percentage of file viewed. hexview Outputs the contents in a formatted hex (or dec) format. man Displays a manual page for the specified command. exit Terminates the shell (and for Windows closes the window). cut Cut out selected fields or columns of each line of a file. Supports extraction of columns by column (e.g. -c3-5,7) and by delimited field (e.g. -f4,5). IFS or -d'char' are used for -f option as delimiter. paste Merges same lines of several files or subsequent lines of one file. Supports option -s to merge subsequent lines from the first file horizontally. head Delivers the first few lines of a file, defaults to 10, e.g. 'head 30 afile'. tail Delivers the last few lines of a file, defaults to 10, e.g. 'tail 100 afile'. Supports the option -f to follow a file, e.g. 'tail -f myfile' will continually output all new contents of the file as it is appended to. grep Searches for strings in files. Supports options: -y ignore case, -n show line numbers, -c display count only, -l list filenames only, -h supress filenames for multiple selection, -p get paragraph. diff Differential file comparison. exec See read. read Reads input from stdin or a file if a process is exec'd on this, the command 'exec 2\" sets $> as prompt. PS1=`pwd`\"$\" sets the current directory as prompt with a $ at the end. IFS The Internal Field Seperator, used by shell to delimit fields in a string or series of strings. TMP The work area directory (can use as TMP=$TEMP to set from another environment variable). HOME The home path, (typing cd by itself always returns you to this directory). MANPAGES Path for manual pages files (e.g. /utils/man). ? Result of last command, e.g. echo result = $? # Number of arguments passed to a script * All arguments passed to a script. @ Token (IFS) seperated list of arguments. 0 and 1..9 Scriptname and positional arguments passed to script. RANDOM A random number, seeded by setting RANDOM. SECONDS The number of seconds the shell has been active. -------- Flow Control Script Commands if..else..fi Expression evaluation with branching for Define a set to loop through while Loop while expression is true e.g. while ( $myvar < 100 ) do..done Begining and end of flow control. -------- CommandLine Startup and Redirection Options <, > and >> Redirection for input (run) and output (results) files instead of stdin and stdout e.g. 'ls -l > afile'. | Piping, passing results of one command to another try "ls -l | more" to see this in action. >&1 redirect to stdout, no matter what other redirections in effect also support /dev/tty as valid output file for stdout. >&2 redirect to stderr, no matter what other redirections in effect. /dev/nul Null device, all output sent here is lost. -------- Not Supported The todo.txt file describes all the functionality which will be added. The following important items are currently not supported: There is no typeset concept, all variables are non-typed. '*' and '?' are supported for matching, '[charlist]' is not. There is no umask concept, uses native UNIX features on these platforms, otherwise it is not supported. -------- Points of Interest If you're in a directory and find you need to do some GUI stuff, then simply type 'winfile .' or 'explorer .', the '.' acts current directory and opens the window in your current directory, neat, or even better 'explorer $mydir' will also work, when 'mydir' is a shell variable (tzsh or environment, doesn't matter). Also, dragging a directory, file, or other text into the tzsh window (and then wiggling the mouse - Microsoft GUIs !), copies the text into the window. This is useful to quickly change the shell to the directory you're looking at with a GUI tool, then you can do some real stuff in there. Try typing 'cd' then drag a directory into the shell window. Don't will copy the name of the directory (or file or whatever) into the window at the point where you stopped typing.