1cd [ -qsLP ] [ arg ] 2cd [ -qsLP ] old new 3cd [ -qsLP ] {+|-}n 4 Change the current directory. In the first form, change the 5 current directory to arg, or to the value of $HOME if arg is not 6 specified. If arg is `-', change to the previous directory. 7 8 Otherwise, if arg begins with a slash, attempt to change to the 9 directory given by arg. 10 11 If arg does not begin with a slash, the behaviour depends on 12 whether the current directory `.' occurs in the list of directo- 13 ries contained in the shell parameter cdpath. If it does not, 14 first attempt to change to the directory arg under the current 15 directory, and if that fails but cdpath is set and contains at 16 least one element attempt to change to the directory arg under 17 each component of cdpath in turn until successful. If `.' 18 occurs in cdpath, then cdpath is searched strictly in order so 19 that `.' is only tried at the appropriate point. 20 21 The order of testing cdpath is modified if the option POSIX CD 22 - 23 is set, as described in the documentation for the option. 24 25 If no directory is found, the option CDABLE VARS is set, and a 26 - 27 parameter named arg exists whose value begins with a slash, 28 treat its value as the directory. In that case, the parameter 29 is added to the named directory hash table. 30 31 The second form of cd substitutes the string new for the string 32 old in the name of the current directory, and tries to change to 33 this new directory. 34 35 The third form of cd extracts an entry from the directory stack, 36 and changes to that directory. An argument of the form `+n' 37 identifies a stack entry by counting from the left of the list 38 shown by the dirs command, starting with zero. An argument of 39 the form `-n' counts from the right. If the PUSHD MINUS option 40 - 41 is set, the meanings of `+' and `-' in this context are swapped. 42 43 If the -q (quiet) option is specified, the hook function chpwd 44 and the functions in the array chpwd functions are not called. 45 - 46 This is useful for calls to cd that do not change the environ- 47 ment seen by an interactive user. 48 49 If the -s option is specified, cd refuses to change the current 50 directory if the given pathname contains symlinks. If the -P 51 option is given or the CHASE LINKS option is set, symbolic links 52 - 53 are resolved to their true values. If the -L option is given 54 symbolic links are retained in the directory (and not resolved) 55 regardless of the state of the CHASE LINKS option. 56 - 57 58chdir Same as cd. 59