.\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" Set up some character translations and predefined strings. \*(-- will .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left .\" double quote, and \*(R" will give a right double quote. \*(C+ will .\" give a nicer C++. Capital omega is used to do unbreakable dashes and .\" therefore won't be available. \*(C` and \*(C' expand to `' in nroff, .\" nothing in troff, for use with C<>. .tr \(*W- .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' .ie n \{\ . ds -- \(*W- . ds PI pi . if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch . if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch . ds L" "" . ds R" "" . ds C` "" . ds C' "" 'br\} .el\{\ . ds -- \|\(em\| . ds PI \(*p . ds L" `` . ds R" '' . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .if !\nF .nr F 0 .if \nF>0 \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} .\} .\" ======================================================================== .\" .IX Title "wcd 1" .TH wcd 1 "2018-05-07" "wcd" "2017-01-03" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH "NAME" wcd \- Wherever Change Directory .PP chdir for DOS and Unix .SH "SYNOPSIS" .IX Header "SYNOPSIS" .Vb 1 \& wcd [options] [directory] .Ve .SH "DESCRIPTION" .IX Header "DESCRIPTION" .SS "Overview" .IX Subsection "Overview" Wcd is a command-line program to change directory fast. It saves time typing at the keyboard. One needs to type only a part of a directory name and wcd will jump to it. Wcd has a fast selection method in case of multiple matches and allows aliasing and banning of directories. Wcd also includes a full screen interactive directory tree browser with speed search. .PP Wcd was modeled after Norton Change Directory (\s-1NCD\s0). \s-1NCD\s0 appeared first in \&\fIThe Norton Utilities, Release 4\fR, for \s-1DOS\s0 in 1987, published by Peter Norton. .PP Wcd has been ported to different command-line shells: \s-1DOS\s0 command.com, Windows cmd.exe and PowerShell, \s-1OS/2\s0 cmd.exe, and Unix shells such as Bourne (sh), Bourne Again (bash), Korn (ksh), Z (zsh), and C (csh) shell and others running on any operating system. .PP Wcd supports 8 bit character sets on all systems, and has optional support for Unicode. See section \s-1LOCALIZATION.\s0 .PP See section \s-1INSTALLATION\s0 how to setup wcd for personal use. .SS "Basic use" .IX Subsection "Basic use" By default (if no wildcards are used) wcd searches for a directory with a name that begins with the typed name. .PP For instance this command will change to directory to the current user's \&\f(CW\*(C`/home/user/Desktop\*(C'\fR: .PP .Vb 1 \& wcd Desk .Ve .PP When there are multiple matches, wcd will present the user a list of all matches. The user can then make a selection with a few keystrokes (most of the times only one). .SS "Wildcards" .IX Subsection "Wildcards" Wcd supports following wildcards: .PP .Vb 4 \& * matches any sequence of characters (zero or more) \& ? matches any character \& [SET] matches any character in the specified set, \& [!SET] or [^SET] matches any character not in the specified set. .Ve .PP A set is composed of characters or ranges; a range looks like \&\fIcharacter hyphen character\fR as in \f(CW\*(C`0\-9\*(C'\fR or \f(CW\*(C`A\-Z\*(C'\fR. The \&\f(CW\*(C`[0\-9a\-zA\-Z_]\*(C'\fR is the minimal set of characters allowed in the \&\f(CW\*(C`[..]\*(C'\fR pattern construct. International characters (i.e. 8 bit characters) are allowed if the system supports them. To suppress the special syntactic significance of any of \f(CW\*(C`[]*?!^\-\e\*(C'\fR inside or outside a \f(CW\*(C`[..]\*(C'\fR construct and match the character exactly, precede the character with a backslash (\f(CW\*(C`\e\*(C'\fR) marker. .PP Using wildcards makes powerful searching possible. For instance this matches any directory name that ends with \*(L"top\*(R": .PP .Vb 1 \& wcd *top .Ve .PP Match directories that have \*(L"top\*(R" anywhere in the name: .PP .Vb 1 \& wcd *top* .Ve .PP Match any directory name that begins with \*(L"a\*(R", \*(L"b\*(R" or \*(L"c\*(R": .PP .Vb 1 \& wcd [a\-c]* .Ve .PP It is also possible to give a part of a directory path. Here Wcd searches for directory that begins with \*(L"Desk\*(R" and which path matches \fI*me/Desk*\fR. .PP .Vb 1 \& wcd me/Desk .Ve .PP It is allowed to type any kind of expression with slashes and wildcards. E.g.: .PP .Vb 1 \& wcd src*/*1?/a*2 .Ve .SS "Other uses" .IX Subsection "Other uses" If no wildcards are used and wcd finds a perfect match, wcd will ignore all wild matches by default. This behaviour can be changed with the \fB\-w\fR option. .PP The interactive directory tree browser can be started by using option \fB\-g\fR. .PP .Vb 1 \& wcd \-g .Ve .PP Wcd generates a treedata file where it searches the directory. On Unix and Windows systems wcd does add symbolic links to the treedata file while scanning the disk, but does not follow them. While following links wcd could end up scanning infinite loops, or scan very large portions of a network. .PP Wcd can also change to directories that are not in the treedata file. E.g.: .PP .Vb 1 \& wcd .. .Ve .PP If wcd found a match but can't change to the directory it tries to remove it from the default treedata file. Not from the extra treedata file. See also option \fB\-k\fR. .PP Wcd keeps a directory stack which is stored on disk. The stack has a default size of 10 and is cyclic. See options \fB\-z\fR, \fB\-\fR, \fB+\fR and \&\fB=\fR. .PP In multi-user environments option \fB\-u\fR can be used to change to directories of other users. .PP On \s-1DOS\s0 and Windows systems it does not matter if you use a slash \*(L"/\*(R" or a backslash \*(L"\e\*(R" as a directory separator. .PP It is possible on \s-1DOS\s0 and Windows systems to change drive and directory in one go by preceding the directory name with the drive name. .PP .Vb 1 \& wcd d:games .Ve .SS "Windows \s-1UNC\s0 paths" .IX Subsection "Windows UNC paths" The Windows versions (Command Prompt, PowerShell, \s-1MSYS,\s0 zsh, cygwin) support Windows \s-1SMB LAN UNC\s0 paths without drive letter such as \&\f(CW\*(C`\e\eservername\esharename\*(C'\fR. Wcd for Windows Command Prompt makes use of the \*(L"pushd\*(R" command to automatically map a \s-1UNC\s0 path to a drive letter. In Windows PowerShell, \s-1MSYS,\s0 zsh and Cygwin \s-1UNC\s0 paths are fully supported. The current working directory can be a \s-1UNC\s0 path. .SS "Interfaces" .IX Subsection "Interfaces" Wcd has three different interfaces to choose from a list of matches. The interface can be chosen at compile time. .PP The first interface uses plain stdin/stdout. A numbered list is printed in the terminal. The user has to choose from the list by typing a number followed by . This interface does not provide scroll back functionality in case of a long list. The scroll back capability of the terminal/console has to be used. It is very small and portable. .PP The second interface is built with the conio library. It provides a builtin scroll back capability. The user is presented a list numbered with letters. Choosing from a list can be done by pressing just one letter. This interface is fast because it saves keystrokes. If possible the screen will be restored after exiting. One who prefers to type numbers can use the \&\fB\-N\fR option. .PP The third interface is built with the curses library. It is similar to the conio interface. The curses version of wcd has also an additional 'graphical' interface. It lets the user select a directory via a full screen interactive directory tree browser. It has a \fIvim\fR\|(1) like navigation and search method. It can be activated with option \fB\-g\fR. .PP By using the \fB\-o\fR option one can always fall back to the stdin/stdout interface. .SH "OPTIONS" .IX Header "OPTIONS" .IP "\fB\-a\fR" 4 .IX Item "-a" Add current path to the default treedata file. .Sp Use this option to quickly add the current path to the default treedata file. Re-scanning the complete disk can take a long time in some cases. .IP "\fB\-aa\fR" 4 .IX Item "-aa" Add current and all parent paths to the default treedata file. .IP "\fB\-A \s-1PATH\s0\fR" 4 .IX Item "-A PATH" Scan directory tree from \fI\s-1PATH\s0\fR and append to the default treedata file. Examples: .Sp .Vb 3 \& wcd \-A . \& wcd \-A /home \-A /etc \& wcd \-A d: \-A e: \-A \e\eserver\eshare .Ve .Sp On Windows one can scan all shared directories of a Windows \s-1LAN\s0 server by typing something like: \f(CW\*(C`wcd \-A \e\eservername\*(C'\fR. .Sp See also option \fB\-S\fR and \fB\-s\fR and \fB\-E\fR. .IP "\fB\-b\fR" 4 .IX Item "-b" Ban current path. .Sp Wcd places the current path in the ban file. This means that wcd ignores all matches of this directory and its sub directories. .Sp The ban file can be edited with a text editor. Use of wildcards is supported and names are matched against the absolute path. .Sp Banned paths are not excluded from scanning the disk. To do that use option \&\fB\-xf\fR. .IP "\fB\-c, \-\-direct\-cd\fR" 4 .IX Item "-c, --direct-cd" Direct \s-1CD\s0 mode. By default wcd works as follows: .Sp .Vb 2 \& 1. Try to find a match in the treedata file(s) \& 2. If no match, try to open the directory you typed. .Ve .Sp In direct \s-1CD\s0 mode wcd works in reversed order. .Sp .Vb 2 \& 1. Try to open the directory you typed. \& 2. If not, try to find a match in the treedata file(s). .Ve .IP "\fB\-d \s-1DRIVE\s0\fR" 4 .IX Item "-d DRIVE" Set drive for stack and go file (\s-1DOS\s0 only). .Sp The stack file and the go-script are by default stored on drive C: if environment variable \fI\s-1HOME\s0\fR is not set. Use this option if drive C: is a read-only drive. This option must be used in front of the stack options \fB\-\fR, \&\fB+\fR and \fB=\fR. .IP "\fB\-e\fR" 4 .IX Item "-e" Add current path to the extra treedata file. .Sp Use this option to quickly add the current path to the extra treedata file. .IP "\fB\-ee\fR" 4 .IX Item "-ee" Add current and all parent paths to extra treedata file. .IP "\fB\-E \s-1PATH\s0\fR" 4 .IX Item "-E PATH" Scan directory tree from \fI\s-1PATH\s0\fR and append to Extra treedata file. See also options \fB\-A\fR and \fB\-S\fR. .IP "\fB\-f \s-1FILE\s0\fR" 4 .IX Item "-f FILE" Read treedata file \fI\s-1FILE\s0\fR. Do not read the default treedata file. .IP "\fB+f \s-1FILE\s0\fR" 4 .IX Item "+f FILE" Read treedata file \fI\s-1FILE\s0\fR in addition to the default treedata file. .IP "\fB\-g\fR" 4 .IX Item "-g" Graphical interface (only in version with curses interface). .Sp Wcd starts a textual curses based 'graphical' interface. The user can select a directory via a full-screen interactive directory tree browser. It has a \fIvim\fR\|(1) like navigation and search method. .Sp If no search string is given wcd presents the whole tree which is in the default treedata file and the extra treedata files. .Sp If a search string is given the match list is presented as a directory tree. .Sp The default tree layout is similar to the tree layout of the original \s-1NCD\s0 on \&\s-1DOS.\s0 The difference in layout is that in \s-1NCD\s0 all directories of a same depth level were vertically aligned over the whole tree. This was possible in \s-1NCD,\s0 because the maximum width of a directory name in \s-1DOS\s0 was 12 (8.3) characters. On modern operating systems directory names can be very long, so also the differences in length can be large. Therefore folders with a same depth are not vertically aligned over the whole tree in wcd, but only in sub-branches. So there is some sideways movement when moving straight up and down from one sub-branch to another sub-branch. .Sp The navigation behaviour in Wcd is exactly the same as in the original \s-1NCD.\s0 For instance if you push the Down key you go down to the next directory with the same depth level, jumping over branches. This enables fast navigation through the tree. .Sp See options \fB\-Ta\fR, \fB\-TC\fR, and \fB\-Tc\fR to change the navigation behaviour. .IP "\fB\-gd\fR" 4 .IX Item "-gd" Dump the treedata files as a tree to stdout. .IP "\fB\-G \s-1PATH\s0\fR" 4 .IX Item "-G PATH" Write go-script in directory \fI\s-1PATH\s0\fR. For instance on Unix, \f(CW\*(C`wcd \-G PATH\*(C'\fR will write a go-script \fBPATH/wcd.go\fR. .IP "\fB\-GN, \-\-no\-go\-script\fR" 4 .IX Item "-GN, --no-go-script" Do not create go-script. This option can be used in combination with the option \fB\-j\fR if one does not want wcd to create a go-script. .IP "\fB\-h, \-\-help\fR" 4 .IX Item "-h, --help" Show help and exit. .IP "\fB\-i, \-\-ignore\-case\fR" 4 .IX Item "-i, --ignore-case" Ignore case. Dos and Windows versions of wcd ignore case default. Unix/Cygwin versions regard case by default. .IP "\fB+i, \-\-no\-ignore\-case\fR" 4 .IX Item "+i, --no-ignore-case" Regard case. See also option \fB\-i\fR. .IP "\fB\-I, \-\-ignore\-diacritics\fR" 4 .IX Item "-I, --ignore-diacritics" Ignore diacritics for Latin-based scripts. Letters with diacritical marks match their base letter without diacritical mark. The following Latin encodings are supported: \&\s-1CP437, CP850, CP852, CP1250, CP1252, ISO\-8859\-1, ISO\-8859\-2,\s0 and Unicode Latin\-1, Latin Extended-A, and Latin Extended-B. See also .IP "\fB+I, \-\-no\-ignore\-diacritics\fR" 4 .IX Item "+I, --no-ignore-diacritics" Regard diacritics (default). See also option \fB\-I\fR. .IP "\fB\-j, \-\-just\-go\fR" 4 .IX Item "-j, --just-go" Just go mode. .Sp In this mode wcd will not present a list when there is more than one directory that matches the given directory. Wcd will just change to the first option. When wcd is invoked again with the same arguments it will change to the next option, and so on. .Sp Wcd will print the directory to go to to stdout. So a different installation method can be used. One could make the following function for a \s-1POSIX\s0 compatible shell: .Sp .Vb 4 \& wcd () \& { \& cd "$($HOME/bin/wcd.exe \-j $@)" \& } .Ve .Sp When you are using an old shell that doesn't support \*(L"$()\*(R" command substitution you have to use old style command substitution with back-quotes. .Sp .Vb 4 \& wcd () \& { \& cd "\`$HOME/bin/wcd.exe \-j $@\`" \& } .Ve .Sp On Windows systems, if one is running 4NT shell, one could make the following alias: .Sp .Vb 1 \& alias wcd \`cd %@execstr[wcdwin32.exe \-z 0 \-j %1]\` .Ve .Sp This method eliminates the need of the go-script, so one can use option \fB\-GN\fR in combination with \fB\-j\fR. .IP "\fB\-k, \-\-keep\-paths\fR" 4 .IX Item "-k, --keep-paths" Keep paths. .Sp Keep paths in the treedata file when wcd can't change to them. The default behaviour of wcd is that it tries to remove paths from the treedata when wcd can't change to them. With this option this behavior is turned off. .IP "\fB\-K, \-\-color\fR" 4 .IX Item "-K, --color" Use colors in graphical mode. .IP "\fB\-l \s-1ALIAS\s0\fR" 4 .IX Item "-l ALIAS" Name the current path with \fI\s-1ALIAS\s0\fR. Wcd places the current path with alias \&\fI\s-1ALIAS\s0\fR in the alias file. Aliases are case sensitive. .IP "\fB\-ls\fR" 4 .IX Item "-ls" Show the name of the alias file, and list all the aliases. .IP "\fB\-m \s-1DIR\s0\fR" 4 .IX Item "-m DIR" Make directory and add to treedata file. .IP "\fB\-L, \-\-license\fR" 4 .IX Item "-L, --license" Print the distribution license. .IP "\fB\-M \s-1DIR\s0\fR" 4 .IX Item "-M DIR" Make directory and add to extra treedata file. .IP "\fB\-n \s-1PATH\s0\fR" 4 .IX Item "-n PATH" Read relative treedata file from \fI\s-1PATH\s0\fR. .Sp Do not read the default treedata file. The relative treedata file should already have been created using the wcd \fB+S\fR option. \&\fI\s-1PATH\s0\fR may also point to a file directly. .Sp An example. Suppose another system has been mounted to mount point \&\f(CW\*(C`/mnt/network\*(C'\fR: .Sp .Vb 1 \& wcd \-n /mnt/network src .Ve .Sp Wcd opens the relative treedata file in \f(CW\*(C`/mnt/network/\*(C'\fR. The file contains the paths relative from that point. .IP "\fB+n \s-1PATH\s0\fR" 4 .IX Item "+n PATH" Read relative treedata file in addition to the default treedata file. See option \fB\-n\fR. .IP "\fB\-N, \-\-numbers\fR" 4 .IX Item "-N, --numbers" Use numbers instead of letters. .Sp Wcd with a conio or curses based interface (see section Interfaces) presents a match list by default numbered with letters. When the \fB\-N\fR option is used the match list is numbered with numbers. Regardless of the \fB\-N\fR option one can type a letter or numbers to make a selection from the list of matches. .IP "\fB\-o\fR" 4 .IX Item "-o" Use stdin/stdout interface. .Sp When for some kind of reason the conio or curses interface of wcd does not work one can fall back to the stdin/stdout interface of wcd by using the \&\fB\-o\fR option. .IP "\fB\-od, \-\-to\-stdout\fR" 4 .IX Item "-od, --to-stdout" Dump all matches to stdout. .IP "\fB\-q, \-\-quiet\fR" 4 .IX Item "-q, --quiet" Quieter operation. Printing of the final match is suppressed. .IP "\fB\-r \s-1DIR\s0\fR" 4 .IX Item "-r DIR" Remove directory and remove from the treedata file. .Sp If the directory is empty, wcd will remove it, and try to remove it from the treedata file. .IP "\fB\-rmtree \s-1DIR\s0\fR" 4 .IX Item "-rmtree DIR" Recursively remove directory and remove from the treedata file. .Sp Wcd will remove the directory and all its sub directories and files, and remove the directories from the treedata file. .IP "\fB\-s\fR" 4 .IX Item "-s" (re)Scan disk from \f(CW$HOME\fR directory. If \fI\s-1HOME\s0\fR is not defined the disk is scanned from root directory /. .Sp The existing default treedata file is overwritten. .Sp The default scan directory can be overruled with environment variable \&\f(CW\*(C`WCDSCAN\*(C'\fR. See section \s-1ENVIRONMENT VARIABLES.\s0 .IP "\fB\-S \s-1PATH\s0\fR" 4 .IX Item "-S PATH" Scan directory tree from \fI\s-1PATH\s0\fR and overwrite the default treedata file. See also options \fB\-A\fR, \fB\-s\fR and \fB\-E\fR. E.g. with option \fB\-A\fR you can create a default treedata file of your choice. Examples: .Sp Unix: .Sp .Vb 2 \& wcd \-S / \& wcd \-S /home \-A /etc \-A /usr .Ve .Sp DOS/Windows: .Sp .Vb 2 \& wcd \-S c:/ \& wcd \-S c: \-A d: \-A \e\eserver\eshare .Ve .Sp With the Windows versions one can scan all shared directories of a Windows \&\s-1LAN\s0 server by typing something like: \f(CW\*(C`wcd \-S \e\eservername\*(C'\fR. .IP "\fB+S \s-1PATH\s0\fR" 4 .IX Item "+S PATH" Scan disk from \fI\s-1PATH\s0\fR and place relative paths in a relative treedata file. This file is used by the \fB\-n\fR and \fB+n\fR options of wcd. E.g. \f(CW\*(C`wcd \-n PATH src\*(C'\fR. .IP "\fB\-t\fR" 4 .IX Item "-t" Do not strip tmp mount dir \f(CW\*(C`/tmp_mnt\*(C'\fR (Unix only) .Sp Wcd strips by default \f(CW\*(C`/tmp_mnt/\*(C'\fR from the match. Directory \&\f(CW\*(C`/tmp_mnt\*(C'\fR is used by the auto-mounter. This behaviour can be turned off with the \fB\-t\fR option. .IP "\fB\-T, \-\-ascii\-tree\fR" 4 .IX Item "-T, --ascii-tree" Draw tree with \s-1ASCII\s0 characters. Use this option if line drawing characters are not displayed properly in your terminal. .IP "\fB\-Ta, \-\-alt\-tree\-nav\fR" 4 .IX Item "-Ta, --alt-tree-nav" Alternative way of navigation in the graphical tree. .Sp In the default \s-1NCD\s0 style tree layout the \fB\-Ta\fR option disables jumping to unrelated directories. .Sp In compact tree mode the alternative mode makes navigation similar to navigation in \s-1GUI\s0 file managers such as Windows Explorer or Linux \s-1KDE\s0 Konqueror. Pressing Up and Down moves the selected folder one line up or down. Pressing Left first folds the sub-folders and the next move left moves really left. .Sp You can switch on-the-fly between default and alternative navigation by pressing . .Sp When alternative navigation mode is on, you will see an \*(L"A\*(R" in the lower right corner. .IP "\fB\-TC, \-\-center\-tree\fR" 4 .IX Item "-TC, --center-tree" Centered view in the graphical tree. The selected directory stays in the middle of the screen. The centered mode can also be switched on and off with key in the graphical tree. .Sp The standard non-centered behaviour, which minimises tree movement, is the same as in the original \s-1NCD.\s0 .IP "\fB\-Tc, \-\-compact\-tree\fR" 4 .IX Item "-Tc, --compact-tree" By default the 'graphical' tree is drawn the same way as the original \s-1NCD\s0 on \&\s-1DOS\s0 did it. On \s-1DOS\s0 a directory path could only be 66 characters in total. With the deep directory structures of today the tree can become very wide. To overcome this wcd can draw the tree in a compact way, similar to most \s-1GUI\s0 file managers, with only one folder per line. Use option \fB\-Tc\fR or switch on-the-fly with the key. .IP "\fB\-Td, \-\-cjk\-width\fR" 4 .IX Item "-Td, --cjk-width" Legacy East-Asian \s-1CJK\s0 (Chinese, Japanese, and Korean) fonts have certain characters and line drawing symbols with a column width of 2, while the normal Unicode width for these characters is 1 column. For instance the Chinese \s-1CP936\s0 raster font on Windows and the Simsun font. Use this option for a correct outlining of the graphical tree when a legacy \s-1CJK\s0 font is used. .Sp When \s-1CJK\s0 mode is on, you will see a \*(L"C\*(R" in the lower right corner. .IP "\fB\-u \s-1USER\s0\fR" 4 .IX Item "-u USER" Scan treedata file of another user based on \fI\s-1USER\s0\fR, do not scan your own default treedata file. See also section \s-1ENVIRONMENT VARIABLES\s0 for \fI\s-1WCDUSERSHOME\s0\fR. .Sp On Unix/Cygwin the base directory for user home directories is assumed to be \f(CW\*(C`/home\*(C'\fR. Wcd will look for \&\f(CW\*(C`/home/USER/.treedata.wcd\*(C'\fR and \f(CW\*(C`/home/USER/.wcd/.treedata.wcd\*(C'\fR, in that order, and read the first one that exists and is readable. On DOS/Windows the base directory for user home directories is assumed to be \f(CW\*(C`\e\eusers\*(C'\fR, so wcd tries to read \&\f(CW\*(C`\e\eusers\eUSER\etreedata.wcd\*(C'\fR and \f(CW\*(C`\e\eusers\eUSER\e.wcd\etreedata.wcd\*(C'\fR. .IP "\fB+u \s-1USER\s0\fR" 4 .IX Item "+u USER" Read default treedata file of \s-1USER\s0 in addition to your own treedata file. .IP "\fB\-v, \-\-verbose\fR" 4 .IX Item "-v, --verbose" Display verbose messages. With this option wcd prints all filters, bans and excludes. .IP "\fB\-V, \-\-version\fR" 4 .IX Item "-V, --version" Print version information and exit. .IP "\fB\-w, \-\-wild\-match\-only\fR" 4 .IX Item "-w, --wild-match-only" Wild matching only. Treat all matches as wild matches. .IP "\fB\-x \s-1PATH\s0\fR" 4 .IX Item "-x PATH" Exclude \fI\s-1PATH\s0\fR from scanning. .Sp When this option is used wcd will exclude \fI\s-1PATH\s0\fR and all its subdirectories when wcd is scanning a disk. Wildcards are supported and matched against absolute paths. Option \fB\-x\fR can be used multiple times. .Sp .Vb 1 \& wcd \-x \-x \-s .Ve .Sp Option \fB\-x\fR must be used in front of any scan option (\fB\-s\fR, \fB\-S\fR, \fB+S\fR, \&\fB\-A\fR, \fB\-E\fR). .Sp On DOS/Windows systems one must specify the drive letter depending on if environment variable \fI\s-1HOME\s0\fR or \fI\s-1WCDHOME\s0\fR is set. If \fI\s-1HOME\s0\fR or \fI\s-1WCDHOME\s0\fR is set one needs to specify the drive letter. An example: .Sp .Vb 1 \& wcd \-x c:/temp \-S c: .Ve .Sp Otherwise do not specify drive letter. .Sp .Vb 1 \& wcd \-x /temp \-s .Ve .IP "\fB\-xf \s-1FILE\s0\fR" 4 .IX Item "-xf FILE" Exclude all paths listed in \fI\s-1FILE\s0\fR from scanning. .Sp When this option is used wcd will exclude all paths listed in \fI\s-1FILE\s0\fR and all their subdirectories when wcd is scanning a disk. Wildcards are supported and they are matched against absolute paths; one path per line. Be aware that wcd will not ignore leading or trailing blanks on a line, because they are legal characters in a directory name. Option \fB\-xf\fR can be used multiple times. When one wants to exclude all banned paths from scanning one can do the following (example for wcd on unix): .Sp .Vb 1 \& wcd \-xf ~/.ban.wcd \-s .Ve .Sp Wildcards are supported. For instance to exclude all your Subversion directories with administrative files add a line with \f(CW\*(C`*/.svn\*(C'\fR. .Sp Option \fB\-xf\fR must be used in front of any scan option (\fB\-s\fR, \fB\-S\fR, \fB+S\fR, \&\fB\-A\fR, \fB\-E\fR). .IP "\fB\-y, \-\-assume\-yes\fR" 4 .IX Item "-y, --assume-yes" Assume Yes on all queries. .Sp Wcd will not prompt the user with yes/no questions, but assumes the user answers yes on all questions. This can be used in combination with option \&\fB\-rmtree\fR. This option must be used in front of options that can lead to yes/no questions. .IP "\fB\-z \s-1NUMBER\s0\fR" 4 .IX Item "-z NUMBER" Set maximum stack size to \s-1NUMBER.\s0 .Sp The default size of the stack is 10. Stack operation can be turned off by setting the size to 0. This option must be used in front of any other stack operations (\fB\-\fR,\fB+\fR,\fB=\fR). Otherwise the size of the stack will be set back to the default 10. .Sp A correct command is: .Sp .Vb 1 \& wcd \-z 50 \- .Ve .Sp The new stack size will be 50, wcd will go one directory back. A wrong command is: .Sp .Vb 1 \& wcd \- \-z 50 .Ve .Sp Wcd goes one directory back, the stack gets the default size 10. The \fB\-z 50\fR is ignored. .Sp Add this option as the first option to your wcd alias or function. E.g. for the a \s-1POSIX\s0 compatible shell this would be: .Sp .Vb 5 \& wcd () \& { \& wcd.exe \-z 50 "$@" \& . ${WCDHOME:\-${HOME}}/bin/wcd.go \& } .Ve .IP "\fB\-[\s-1NUMBER\s0]\fR" 4 .IX Item "-[NUMBER]" Push dir \s-1NUMBER\s0 of times. Default is one. .Sp Go back a directory. Command \f(CW\*(C`wcd \-\*(C'\fR goes one directory back. To go more directories back add a number to it. E.g. command \f(CW\*(C`wcd \-3\*(C'\fR. The stack is cyclic. .IP "\fB+[\s-1NUMBER\s0]\fR" 4 .IX Item "+[NUMBER]" Pop dir \s-1NUMBER\s0 of times. Default is one. .Sp Go forward a directory. Command \f(CW\*(C`wcd +\*(C'\fR goes one directory forward. To go more directories forward add a number to it. E.g. command \f(CW\*(C`wcd +2\*(C'\fR. The stack is cyclic. .IP "\fB=\fR" 4 .IX Item "=" Show stack. .Sp Use this option if you do not know anymore how many times to push or pop. The stack is printed and you can choose a number. The current place in the stack is marked with an asterisk \f(CW\*(C`*\*(C'\fR. .SH "INSTALLATION" .IX Header "INSTALLATION" The current working directory of a Unix shell can only be changed by the builtin \fIcd\fR\|(1) command. Therefore the program is always called by a function or an alias. The function or alias sources a shell script (go-script) which is generated by the wcd program. Wcd can only work after the function or alias is defined. .PP Another important influence on your installation is the definition of environment variables \fI\s-1HOME\s0\fR and \fI\s-1WCDHOME\s0\fR. See section \s-1ENVIRONMENT VARIABLES.\s0 .SS "Install for \s-1POSIX\s0 type shells" .IX Subsection "Install for POSIX type shells" For a \s-1POSIX\s0 shell (ksh, bash, zsh, etc.) on Unix, Linux, Cygwin, or native \s-1MSYS\s0 add the following function to the shell startup file (e.g. Bash uses \&\f(CW\*(C`$HOME/.bashrc\*(C'\fR): .PP .Vb 5 \& wcd () \& { \& /wcd.exe "$@" \& . ${WCDHOME:\-${HOME}}/bin/wcd.go \& } .Ve .PP Replace \fI\s-1PATH\s0\fR with the location where the wcd executable has been installed. Reload the shell initialization files or start new shell. .PP The location of the go-script \f(CW\*(C`wcd.go\*(C'\fR differs per shell. .PP Wcd for \s-1DJGPP DOS\s0 bash requires a different function. The go script is not written in a directory \f(CW\*(C`bin\*(C'\fR, and if \fI\s-1WCDHOME\s0\fR and \fI\s-1HOME\s0\fR are both not defined the go-script is written on c:/. .PP .Vb 5 \& wcd () \& { \& /wcd.exe "$@" \& . ${WCDHOME:\-${HOME:\-"c:"}}/wcd.go \& } .Ve .PP The WinZsh version of wcd is also a bit different. No \f(CW\*(C`bin\*(C'\fR directory. .PP .Vb 5 \& wcd () \& { \& /wcd.exe "$@" \& . ${WCDHOME:\-${HOME}}/wcd.go \& } .Ve .PP See section \s-1FILES\s0 for more information. .SS "Install for C\-alike shells (csh, tcsh)" .IX Subsection "Install for C-alike shells (csh, tcsh)" Add the following alias to the shell startup file \f(CW\*(C`$HOME/.cshrc\*(C'\fR or \&\f(CW\*(C`$HOME/.tcshrc\*(C'\fR : .PP .Vb 5 \& if ( ${?WCDHOME} ) then \& alias wcd "/wcd.exe \e!* ; source $WCDHOME/bin/wcd.go" \& else \& alias wcd "/wcd.exe \e!* ; source $HOME/bin/wcd.go" \& endif .Ve .PP Replace \fI\s-1PATH\s0\fR with the location where the wcd executable has been installed. Reload the shell initialization files or start a new shell. .SS "Windows Command Prompt version" .IX Subsection "Windows Command Prompt version" Unpack the zip file and add directory \f(CW\*(C`bin\*(C'\fR to your environment variable \fI\s-1PATH\s0\fR. .PP In Windows Command Prompt a Windows program cannot change the current work directory, but a .bat file can. The batch scrip \f(CW\*(C`wcd.bat\*(C'\fR runs the wcd program which generates a new batch script \f(CW\*(C`wcdgo.bat\*(C'\fR. Then \f(CW\*(C`wcd.bat\*(C'\fR runs \f(CW\*(C`wcdgo.bat\*(C'\fR which actually changes the directory. .SS "Windows \s-1VISTA\s0 and higher" .IX Subsection "Windows VISTA and higher" In a Windows \s-1VISTA\s0 and higher Command Prompt you may have limited access to directories. To get access to more directories you need administrator rights. You can get a Command Prompt with administrator rights if you right click on the Command Prompt icon and select \fIRun as administrator\fR. .SS "Windows PowerShell version" .IX Subsection "Windows PowerShell version" Add the following function to your PowerShell user profile. The location of this profile is stored in the \f(CW$profile\fR variable. It is required that one of the environment variables \fI\s-1HOME\s0\fR or \fI\s-1WCDHOME\s0\fR is defined. .PP .Vb 5 \& function wcd \& { \& \ewcdwin32psh.exe $args \& & $env:HOME\ewcdgo.ps1 \& } .Ve .PP Replace \fI\s-1PATH\s0\fR with the location where the wcd executable has been installed. Start a new PowerShell. Wcd for PowerShell supports only the file system provider. No other providers. .SS "\s-1OS/2\s0 Command Prompt version" .IX Subsection "OS/2 Command Prompt version" In an \s-1OS/2\s0 Command Prompt (cmd.exe) an OS/2\-program can't change the current work directory. That is why wcd generates a command script \f(CW\*(C`wcdgo.cmd\*(C'\fR which must be executed in the current shell. The script \f(CW\*(C`wcd.cmd\*(C'\fR first executes \&\f(CW\*(C`wcdos2.exe\*(C'\fR, which creates the \f(CW\*(C`wcdgo.cmd\*(C'\fR script. Then \f(CW\*(C`wcd.cmd\*(C'\fR executes the \f(CW\*(C`wcdgo.cmd\*(C'\fR script. .SH "LOCALIZATION" .IX Header "LOCALIZATION" .IP "\fB\s-1LANG\s0\fR" 4 .IX Item "LANG" The primary language is selected with the environment variable \fI\s-1LANG\s0\fR. The \&\fI\s-1LANG\s0\fR variable consists out of several parts. The first part is in small letters the language code. The second one is optional and is the country code in capital letters, preceded with an underscore. There is also an optional third part: character encoding, preceded with a dot. A few examples for \s-1POSIX\s0 standard type shells: .Sp .Vb 6 \& export LANG=nl Dutch \& export LANG=nl_NL Dutch, The Netherlands \& export LANG=nl_BE Dutch, Belgium \& export LANG=es_ES Spanish, Spain \& export LANG=es_MX Spanish, Mexico \& export LANG=en_US.iso88591 English, USA, Latin\-1 encoding .Ve .Sp For a complete list of language and country codes see the \fIgettext\fR\|(1) manual: On Unix systems you can use to command \fIlocale\fR\|(1) to get locale specific information. .IP "\fB\s-1LANGUAGE\s0\fR" 4 .IX Item "LANGUAGE" With the \fI\s-1LANGUAGE\s0\fR environment variable you can specify a priority list of languages, separated by colons. Wcd gives preference to \fI\s-1LANGUAGE\s0\fR over \&\fI\s-1LANG\s0\fR. For instance, first Dutch and then German: \f(CW\*(C`LANGUAGE=nl:de\*(C'\fR. You have to first enable localization, by setting \fI\s-1LANG\s0\fR or \fI\s-1LC_ALL\s0\fR to a value other than \fIC\fR, before you can use a language priority list through the \fI\s-1LANGUAGE\s0\fR variable. See also the \fIgettext\fR\|(1) manual: .Sp If you select a language which is not available you will get the standard English messages. .IP "\fB\s-1WCDLOCALEDIR\s0\fR" 4 .IX Item "WCDLOCALEDIR" With the environment variable \fI\s-1WCDLOCALEDIR\s0\fR the \fI\s-1LOCALEDIR\s0\fR used during compilation and installation of wcd can be overruled. \fI\s-1LOCALEDIR\s0\fR is used by wcd with native language support to find the language files. The \s-1GNU\s0 default value is \f(CW\*(C`/usr/local/share/locale\*(C'\fR. By typing \f(CW\*(C`wcd \-V\*(C'\fR wcd will print the \fI\s-1LOCALEDIR\s0\fR that is used. .Sp If you have installed wcd in a different directory than the default directory you may need to set the environment variable \fI\s-1WCDLOCALEDIR\s0\fR to point to the locale directory. .Sp An example for Windows cmd: .Sp .Vb 1 \& set WCDLOCALEDIR=c:/my_prefix/share/locale .Ve .Sp An example for a \s-1POSIX\s0 shell: .Sp .Vb 1 \& export WCDLOCALEDIR=$HOME/share/locale .Ve .IP "\fB\s-1LC_COLLATE\s0\fR" 4 .IX Item "LC_COLLATE" When there are multiple directory matches wcd presents a sorted list. The sorting depends on the locale settings. If the environment \fI\s-1LANG\s0\fR has been set the matches are sorted like dictionaries or phone books are sorted in that language. For instance dots and dashes are ignored, or letters e with and without accent are equal, or upper and lower case is ignored. .Sp The sorting gives preference to environment variable \fI\s-1LC_COLLATE\s0\fR over \fI\s-1LANG\s0\fR. If you make \fI\s-1LC_COLLATE\s0\fR equal to \f(CW\*(C`C\*(C'\fR or \f(CW\*(C`POSIX\*(C'\fR, locale sorting is turned off. For instance if you want Dutch language, but not Dutch sorting, you can do something like this: .Sp .Vb 2 \& export LANG=nl_NL \& export LC_COLLATE=C .Ve .IP "\fB\s-1LC_CTYPE\s0\fR" 4 .IX Item "LC_CTYPE" With regard to character encoding Wcd will give preference to variable \&\fI\s-1LC_CTYPE\s0\fR over \fI\s-1LANG\s0\fR. For instance to set character encoding to \&\s-1UTF\-8\s0 the following environment setting can be done. .Sp .Vb 1 \& export LC_CTYPE=en_US.UTF\-8 .Ve .IP "\fB\s-1LC_ALL\s0\fR" 4 .IX Item "LC_ALL" All locale environment variables that start with \fI\s-1LC_\s0\fR are overruled by the environment variable \fI\s-1LC_ALL\s0\fR if it is defined. Wcd gives preference to \&\fI\s-1LC_ALL\s0\fR over \fI\s-1LC_COLLATE\s0\fR and \fI\s-1LC_CTYPE\s0\fR. .SS "\s-1WINDOWS CODE PAGES\s0" .IX Subsection "WINDOWS CODE PAGES" There are two groups of code pages: \s-1DOS\s0 code pages (\s-1OEM\s0) and Windows code pages (\s-1ANSI\s0). The default encoding for Windows, when configured with Western regional settings, is \s-1ANSI CP1252.\s0 Windows programs, for instance notepad, use this default system \s-1ANSI\s0 code page. The Windows console uses by default an \s-1OEM\s0 code page (\s-1CP437\s0 or \s-1CP850\s0) for compatibility with \s-1DOS\s0 programs. If you use a \s-1DOS\s0 version of wcd in a Windows console it will work, because of the \s-1DOS\s0 code page. But the \s-1DOS\s0 version of wcd lacks support for long directory names and network drives on Windows. .PP The Windows version of wcd is a native Windows program and will use the Windows system \s-1ANSI\s0 code page. So on a Western regional Windows it will use code page \&\s-1CP1252\s0 for directory names and messages. In order to get consistent output, independent of the active code page, all Windows versions of Wcd translate \s-1ANSI\s0 output to Unicode output in the Command Prompt and PowerShell. .PP The console raster font only supports the original \s-1OEM\s0 code page installed with Windows, so you have to change the console's font to true type Lucida Console to make Unicode (and \s-1ANSI\s0) letters appear correctly. .PP Non-Unicode versions of Wcd \fIprior to version 5.2.0\fR use plain \s-1ANSI\s0 output. For these older versions the code page of the console has to be made equal to the system code page (changed to 1252) to make wcd for Windows work properly with special characters such as accented characters or the Euro symbol. .PP The Windows system code page can be changed via the Control Panel regional options. The Windows console code page is changed with the \f(CW\*(C`chcp\*(C'\fR command. .PP When you type \f(CW\*(C`wcd \-V\*(C'\fR, the actual character encoding used by wcd is shown. Type the command \f(CW\*(C`chcp\*(C'\fR to display the active code page of the Windows console. .SS "\s-1UNICODE\s0" .IX Subsection "UNICODE" Wcd has optional support for Unicode. To see if wcd was built with Unicode support type \f(CW\*(C`wcd \-V\*(C'\fR. If your terminal/console and font supports it, you should see the Euro symbol and Chinese characters (meaning: \&\*(L"Chinese\*(R"). .PP Wcd has been \fIsoft\fR converted to Unicode. In its core wcd handles all data as a stream of bytes. Only the lines printed to screen are on the fly converted to Unicode wide characters. Wcd fully relies on libc functions and has no \s-1UTF\-8\s0 specific code. See also .PP Wcd has optional support for Unicode matching with normalisation. To find out whether Wcd has normalisation support type \f(CW\*(C`wcd \-V\*(C'\fR. Wcd with Unicode normalization support will match Unicode names based on \fIcompatible\fR equivalence. Without Unicode normalization support, names are matched when they are binary equivalent. See also .PP \fI\s-1UTF\-8\s0 on Unix/Linux\fR .IX Subsection "UTF-8 on Unix/Linux" .PP In order to view \s-1UTF\-8\s0 characters your console/terminal also needs to support \s-1UTF\-8.\s0 The xterm version that comes with XFree86 4.0 or higher includes \s-1UTF\-8\s0 support. To activate it, start \fIxterm\fR\|(1) in a \s-1UTF\-8\s0 locale and use a font with iso10646\-1 encoding, for instance with .PP .Vb 1 \& LC_CTYPE=en_GB.UTF\-8 xterm \-u8 \-fn \*(Aq\-Misc\-Fixed\-Medium\-R\-SemiCondensed\-\-13\-120\-75\-75\-C\-60\-ISO10646\-1\*(Aq .Ve .PP Modern distributions of GNU/Linux support \s-1UTF\-8\s0 by default. Other multi-byte character encodings should also work, but that has not been tested. .PP Wcd assumes that the treedata files are encoded in the locale character encoding. There are no Byte Order Marks written to treedata files. .PP \fI\s-1UTF\-16\s0 on Windows\fR .IX Subsection "UTF-16 on Windows" .PP On Windows Unicode is supported in all versions of PowerShell, and in Windows Command Prompt on Windows 7 (or higher). Unicode also works in Take Command or \s-1TCC/LE\s0 made by \s-1JP\s0 Software, which can be used on older Windows versions (XP/Vista). .PP On Windows all the directory names on disk are encoded in \s-1UTF\-16\s0 Unicode. For non-Unicode Windows programs the Unicode characters are translated to the default \s-1ANSI\s0 code page. For characters that are not part of the regional setting this translation is not possible and non-Unicode programs print a question mark or a wrong character instead. .PP Wcd with Unicode support will read the \s-1UTF\-16\s0 encoded directory names and converts them internally to \s-1UTF\-8.\s0 All treedata files are encoded in \s-1UTF\-8\s0 and not compatible with the non-Unicode version of Wcd. Wcd will create a go-script encoded in \s-1UTF\-8.\s0 .PP All versions of Windows PowerShell are able to run scripts encoded in \s-1UTF\-8,\s0 provided there is an \s-1UTF\-8 BOM\s0 in the script. .PP Since Windows 7 it is possible in Windows Command Prompt to change directory with a batch script to a directory with Unicode letters in the name. The directory name needs to be encoded in \s-1UTF\-8,\s0 and the batch script must \fInot\fR have a \s-1BOM.\s0 The active code page of the Command Prompt needs to be set to 65001 (\s-1UTF\-8\s0) prior to the cd command. Wcd for Command Prompt will create such a go script \f(CW\*(C`wcdgo.bat\*(C'\fR. It first changes the code page to 65001, then changes directory, and finally sets the code page back to the original code page. .PP You need to set the font to True Type Lucida Console (not raster font) when letters don't appear correctly. .PP The non-Unicode Windows version of Wcd can read Unicode treedata files since version 5.2.0, provided there is a Byte Order Mark (\s-1BOM\s0) in the file (see ), but it can't change to directories with Unicode letters in the name that are not part of the default system \s-1ANSI\s0 code page. The Unicode Windows version of wcd writes a \s-1BOM\s0 in the \s-1UTF\-8\s0 encoded treedata files since version 5.2.0, which makes them also readable by notepad. .PP \fI\s-1UTF\-8\s0 on Cygwin\fR .IX Subsection "UTF-8 on Cygwin" .PP Cygwin supports Unicode since version 1.7. The Cygwin layer takes care that the Windows \s-1UTF\-16\s0 Unicode names are converted to \s-1UTF\-8.\s0 So programs, like wcd, do not need to be aware of this and can operate using \s-1UTF\-8\s0 encoding as on Unix/Linux. Set character encoding to \s-1UTF\-8\s0 with the \fI\s-1LANG\s0\fR or \fI\s-1LC_CTYPE\s0\fR environment variable. You may need to rescan your drives. You need to set the font to True Type Lucida Console (not raster font) if you use the default Cygwin console. .PP The Cygwin version behaves exactly as the Unix version of wcd. There is no \s-1BOM\s0 written in the treedata files, and it is assumed they are encoded in the \fBCygwin\fR locale character encoding. .SH "FILES" .IX Header "FILES" If the environment variable \fI\s-1WCDHOME\s0\fR is set wcd will use \fI\s-1WCDHOME\s0\fR instead of \fI\s-1HOME\s0\fR. All \f(CW\*(C`*.wcd\*(C'\fR files are text files. They can be edited with a text editor. The Windows Command Prompt version of wcd behaves as the \s-1DOS\s0 version. The Cygwin version of wcd behaves as the Unix version. .IP "\fBwcd.exe\fR" 4 .IX Item "wcd.exe" The program. In Unix shells the program is always called by a function or alias, because the current working directory of a Unix shell can only be changed by the builtin cd command. See also section \&\s-1INSTALLATION.\s0 .IP "\fBdefault treedata file\fR" 4 .IX Item "default treedata file" This is the default treedata file where wcd searches for matches. If it is not readable wcd will create a new one. .Sp .Vb 2 \& DOS: \etreedata.wcd or %HOME%\etreedata.wcd \& Unix: $HOME/.treedata.wcd .Ve .IP "\fBextra treedata file\fR" 4 .IX Item "extra treedata file" An optional extra treedata file. If it exists and is readable wcd will try to find matches in this file also. .Sp .Vb 2 \& DOS: \eextra.wcd or %HOME%\eextra.wcd \& Unix: $HOME/.extra.wcd .Ve .IP "\fBban file\fR" 4 .IX Item "ban file" In this optional file wcd places banned paths. See option \fB\-b\fR. Wildcards are supported. .Sp .Vb 2 \& DOS: \eban.wcd or %HOME%\eban.wcd \& Unix: $HOME/.ban.wcd .Ve .IP "\fBalias file\fR" 4 .IX Item "alias file" Optional file with wcd aliases. See option \fB\-l\fR. .Sp .Vb 2 \& DOS: \ealias.wcd or %HOME%\ealias.wcd \& Unix: $HOME/.alias.wcd .Ve .IP "\fBstack file\fR" 4 .IX Item "stack file" In this file wcd stores its stack. The drive letter can be changed with the \fB\-d\fR option. .Sp .Vb 2 \& DOS: c:\estack.wcd or %HOME%\estack.wcd \& Unix: $HOME/.stack.wcd .Ve .Sp The name of the stack file can be changed with environment variable \fI\s-1WCDSTACKFILE\s0\fR. See section \s-1ENVIRONMENT VARIABLES.\s0 .IP "\fBgo-script\fR" 4 .IX Item "go-script" This is the shell script which wcd.exe creates each time. It is sourced via a function or an alias. The drive letter can be changed with the \fB\-d\fR option. For history reasons it is placed by default in \f(CW\*(C`$HOME/bin\*(C'\fR on Unix systems. The directory of this file can be changed with the option \fB\-G\fR. .Sp .Vb 7 \& DOS bash: c:/wcd.go or $HOME/wcd.go \& Windows Command Prompt: c:\ewcdgo.bat or %HOME%\ewcdgo.bat \& Windows PowerShell: $env:HOME\ewcdgo.ps1 \& WinZsh: $HOME/wcd.go \& Cygwin/MSYS: $HOME/bin/wcd.go \& OS/2 Command Prompt: c:\ewcdgo.cmd or %HOME%\ewcdgo.cmd \& Unix: $HOME/bin/wcd.go .Ve .IP "\fBrelative treedata file\fR" 4 .IX Item "relative treedata file" Text file with relative paths from \fI\s-1DIR\s0\fR. See options \fB+S\fR, \fB\-n\fR and \&\fB+n\fR. .Sp .Vb 2 \& DOS: \ertdata.wcd \& Unix: /.rtdata.wcd .Ve .SH "ENVIRONMENT VARIABLES" .IX Header "ENVIRONMENT VARIABLES" .IP "\fB\s-1HOME\s0\fR" 4 .IX Item "HOME" Wcd uses by default environment variable \fI\s-1HOME\s0\fR to determine where to store its files. See also section \s-1FILES.\s0 This can be overruled with environment variable \fI\s-1WCDHOME\s0\fR. .Sp \&\fI\s-1HOME\s0\fR also defines where to start scanning the disk when option \fB\-s\fR is used. This can be overruled with the environment variable \fI\s-1WCDSCAN\s0\fR. .Sp For the Unix, Cygwin, Windows PowerShell, WinZsh and \s-1MSYS\s0 version it is required that \fI\s-1HOME\s0\fR or \fI\s-1WCDHOME\s0\fR is set. For the other versions of wcd the use of these variables is optional. .Sp If \fI\s-1HOME\s0\fR is set on DOS/Windows, wcd will place all its files (treedata.wcd, extra.wcd, alias.wcd, ban.wcd, wcd.go) in directory \&\fI\s-1HOME\s0\fR. The behaviour of wcd is then equal to the Unix version of wcd. Wcd will scan the disk default from \fI\s-1HOME\s0\fR. Drives will not be automatically scanned by changing to them. You need to tell wcd explicitly. E.g.: .Sp .Vb 1 \& wcd \-S c: \-A d: \-A e: .Ve .Sp Matching of directories is now global over all scanned drives. .IP "\fB\s-1WCDHOME\s0\fR" 4 .IX Item "WCDHOME" Environment variable \fI\s-1WCDHOME\s0\fR can be used to change the location of wcd's files. If both \fI\s-1HOME\s0\fR and \fI\s-1WCDHOME\s0\fR are set, \fI\s-1WCDHOME\s0\fR will be used instead of \fI\s-1HOME\s0\fR. .Sp In wcd versions prior to 5.1.5 \fI\s-1WCDHOME\s0\fR also changed the default scan directory. This has changed. Since version 5.1.5 \fI\s-1WCDHOME\s0\fR does not change the default scan directory. See option \fB\-s\fR. From version 5.1.5, use environment \fI\s-1WCDSCAN\s0\fR to overrule the default scan directory. .Sp Example for \s-1DOS,\s0 Windows, \s-1OS/2\s0 Command Prompt: .Sp .Vb 1 \& set WCDHOME=C:\eUsers\eerwin\ewcd .Ve .Sp An example for \s-1POSIX\s0 type shells: .Sp .Vb 1 \& export WCDHOME="$HOME/.wcd" .Ve .Sp An example for Csh type shells: .Sp .Vb 1 \& setenv WCDHOME "$HOME/.wcd" .Ve .IP "\fB\s-1WCDSCAN\s0\fR" 4 .IX Item "WCDSCAN" Use environment variable \fI\s-1WCDSCAN\s0\fR to overrule the default scan directory \fI\s-1HOME\s0\fR. Define a colon separated list (Unix) to define more than one directory. On DOS/Windows make the list semi-colon separated. .Sp Examples for \s-1DOS,\s0 Windows, \s-1OS/2\s0 Command Prompt: .Sp .Vb 1 \& set WCDSCAN=C:\eUsers\eerwin;D:\edata \& \& set WCDSCAN=%HOMEDRIVE%%HOMEPATH%;\e\eprojectdrive\eprojectX .Ve .Sp An example for \s-1POSIX\s0 type shells: .Sp .Vb 1 \& export WCDSCAN="$HOME:/projectdisk/projectX" .Ve .Sp An example for Csh type shells: .Sp .Vb 1 \& setenv WCDSCAN "$HOME:/projectdisk/projectX" .Ve .IP "\fB\s-1WCDFILTER\s0\fR" 4 .IX Item "WCDFILTER" Specify filters with environment variable \fI\s-1WCDFILTER\s0\fR. All directories that do not match the filter(s) are ignored. A list can be specified by separating filters by the shell path separator. Similar as specifying the \fI\s-1PATH\s0\fR variable. The case sensitivity is mandated by the Operating system. .Sp An example for \s-1DOS,\s0 Windows, \s-1OS/2\s0 Command Prompt: .Sp .Vb 1 \& set WCDFILTER=projects;doc .Ve .Sp An example for \s-1POSIX\s0 type shells: .Sp .Vb 1 \& export WCDFILTER="projects:doc" .Ve .Sp An example for Csh type shells: .Sp .Vb 1 \& setenv WCDFILTER "projects:doc" .Ve .IP "\fB\s-1WCDBAN\s0\fR" 4 .IX Item "WCDBAN" The paths specified with environment \fI\s-1WCDBAN\s0\fR will be banned by wcd. See also option \fB\-b\fR. Specify a list of paths separated by shell \&\fI\s-1PATH\s0\fR separator. .IP "\fB\s-1WCDEXCLUDE\s0\fR" 4 .IX Item "WCDEXCLUDE" The paths specified with environment \fI\s-1WCDEXCLUDE\s0\fR will be excluded by wcd. See also options \fB\-x\fR and \fB\-xf\fR. Specify a list of paths separated by shell \fI\s-1PATH\s0\fR separator. .Sp An example for \s-1DOS,\s0 Windows, \s-1OS/2\s0 Command Prompt: .Sp .Vb 1 \& set WCDEXCLUDE=*/windows;*/temp;*CVS .Ve .Sp An example for \s-1POSIX\s0 type shells: .Sp .Vb 1 \& export WCDEXCLUDE="/dev:/tmp:*CVS" .Ve .Sp An example for Csh type shells: .Sp .Vb 1 \& setenv WCDEXCLUDE "/dev:/tmp:*CVS" .Ve .IP "\fB\s-1WCDUSERSHOME\s0\fR" 4 .IX Item "WCDUSERSHOME" Set the base of user's home directories. On DOS/Windows the default value is \f(CW\*(C`\e\eusers\*(C'\fR. On Unix/Cygwin the default value is \f(CW\*(C`/home\*(C'\fR. This variable is used to scan treedata files of other users. See also options \fB\-u\fR and \fB+u\fR. In verbose mode wcd will print all filters, bans and excludes. See option \fB\-v\fR. .IP "\fB\s-1WCDSTACKFILE\s0\fR" 4 .IX Item "WCDSTACKFILE" Wcd gives preference to \fI\s-1WCDSTACKFILE\s0\fR over the default stack file name (see section \s-1FILES\s0). With this variable each shell (or used terminal emulator) can have its private stack of used directories. .Sp To use a unique time based YYYYMMDD-HHMMSS file for each opened interactive shell. .Sp .Vb 1 \& export WCDSTACKFILE=$HOME/.wcd/stack.$(date +%Y%m%d\-%H%M%S) .Ve .Sp For a stack per \fIxterm\fR\|(1), use the xterm \fI\s-1WINDOWID\s0\fR environment variable: .Sp .Vb 1 \& export WCDSTACKFILE=$HOME/.wcd/stack.$WINDOWID .Ve .Sp For \s-1GNU\s0 \fIscreen\fR\|(1), to use stack per screen: .Sp .Vb 1 \& export WCDSTACKFILE=$HOME/.wcd/stack.$WINDOW .Ve .IP "\fB\s-1TERMINFO\s0\fR" 4 .IX Item "TERMINFO" If the environment variable \fI\s-1TERMINFO\s0\fR is defined, wcd with ncurses interface checks for a local terminal definition before checking in the standard place. This is useful if terminal definitions are not on a standard place. Often used standard places are \f(CW\*(C`/usr/lib/terminfo\*(C'\fR and \f(CW\*(C`/usr/share/terminfo\*(C'\fR. .IP "\fB\s-1PDC_RESTORE_SCREEN\s0\fR" 4 .IX Item "PDC_RESTORE_SCREEN" Wcd with PDCurses interface recognizes the environment variable \&\fI\s-1PDC_RESTORE_SCREEN\s0\fR. If this environment variable is set, PDCurses will take a copy of the contents of the screen at the time that wcd is started; when wcd exits, the screen will be restored. An example for Windows Command Prompt: .Sp .Vb 1 \& set PDC_RESTORE_SCREEN=1 .Ve .Sp Windows allows only a small buffer to be saved. So it is not always possible to restore everything. Some garbage data may be printed in the console after wcd exists if you have set a large buffer width. .IP "\fB\s-1SHELL\s0\fR" 4 .IX Item "SHELL" Printing of \f(CW\*(C`#!$SHELL\*(C'\fR on the first line of the go-script for \s-1POSIX\s0 type shell or C shell is needed for 8 bit characters. Some shells otherwise think that the go-script is a binary file and will not source it. In Cygwin Bash the variable \fI\s-1SHELL\s0\fR must be set in environment using the \f(CW\*(C`export\*(C'\fR command, otherwise wcd can't read the variable. .IP "\fB\s-1BASH\s0\fR" 4 .IX Item "BASH" Wcd for \s-1DOS\s0 bash uses \f(CW$BASH\fR instead of \f(CW$SHELL\fR, because \f(CW$SHELL\fR points to the \s-1DOS\s0 command shell. One may need to define \f(CW$BASH\fR with an \f(CW\*(C`export\*(C'\fR command, otherwise wcd can't read the variable. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fIsh\fR\|(1), \&\fIbash\fR\|(1), \&\fIcsh\fR\|(1), \&\fIksh\fR\|(1), \&\fIzsh\fR\|(1), \&\fIlocale\fR\|(1), \&\fIncurses\fR\|(1), .SH "AUTHORS" .IX Header "AUTHORS" Wcd was written by Erwin Waterlander .PP Project homepage: .PP SourceForge: .PP The manual page formatting was provided by Jari Aalto . .PP \&\s-1NCD\s0 was originally written by Brad Kingsbury for Peter Norton's \&\*(L"Norton Utilities\*(R" around 1987. See also