cd (built-in Bash command)

Content

 

Data

License: GNU GPLv3 +
Version number: GNU Bash 5
Developer / owner: Free Software Foundation Inc.

Short description:

Manual page and help for the linux cd built-in Bash command. The cd command changes the current directory to the specified directory. If no directory is specified, the value of the HOME shell variable will be the default.

 

 

Man page output

man bash
[...]
       cd [-L|[-P [-e]] [-@]] [dir]
              Change the current directory to dir.  if dir is not supplied, the value of the HOME
              shell variable is the default.  Any additional arguments following dir are ignored.
              The  variable CDPATH defines the search path for the directory containing dir: each
              directory name in CDPATH is searched for dir.  Alternative directory names  in  CD-
              PATH  are separated by a colon (:).  A null directory name in CDPATH is the same as
              the current directory, i.e., ``.''.  If dir begins with a slash (/), then CDPATH is
              not  used.   The -P option causes cd to use the physical directory structure by re-
              solving symbolic links while traversing dir and before processing instances  of  ..
              in  dir  (see  also the -P option to the set builtin command); the -L option forces
              symbolic links to be followed by resolving the link after processing  instances  of
              ..  in dir.  If .. appears in dir, it is processed by removing the immediately pre-
              vious pathname component from dir, back to a slash or the beginning of dir.  If the
              -e option is supplied with -P, and the current working directory cannot be success-
              fully determined after a successful directory change, cd will return an  unsuccess-
              ful  status.   On  systems that support it, the -@ option presents the extended at-
              tributes associated with a file as a directory.  An argument of - is  converted  to
              $OLDPWD  before  the  directory change is attempted.  If a non-empty directory name
              from CDPATH is used, or if - is the first argument, and  the  directory  change  is
              successful,  the  absolute  pathname of the new working directory is written to the
              standard output.  The return value  is  true  if  the  directory  was  successfully
              changed; false otherwise.
[...]

 

 

Help output

cd --help
cd: cd [-L|[-P [-e]] [-@]] [ktár]
    A parancsértelmező munkakönyvtárának váltása.

    A munkakönyvtár átváltása a KTÁR-ra. Elhagyása esetén a HOME környezeti
    változóban lévő könyvtárra vált.

    A CDPATH környezeti változó adja meg a KTÁR keresési útvonalait. Az
    útvonalakat kettőspont (:) választja el. Egy üres könyvtárnév az aktuális
    könyvtárat jelenti. Ha a KTÁR „/” jellel kezdődik, a CDPATH értéke
    nincs figyelembe véve.

    Ha a könyvtár nem létezik, és a „cdable_vars” parancsértelmező-beállítás
    aktív, a KTÁR változónévként lesz használva. Ha a változónak van
    értéke, az lesz KTÁR-értékként használva.

    Kapcsolók:
      -L        szimbolikus linkek szigorú követése
      -P        a fizikai könyvtárfa használata a szimbolikus linkek követése
       helyett: szimbolikus linkek feloldása a KTÁR-ban a „..”
                előfordulásainak feldolgozása előtt
      -e        ha a -P kapcsoló meg van adva, és az aktuális munkakönyvtár
                nem határozható meg sikeresen, kilépés nem nulla állapottal
      -@        az azt támogató rendszereken a kibővített attribútumokkal
                rendelkező fájlok megjelenítése a fájlattribútumokat tartalmazó
                könyvtárként

    Az alapértelmezett a szimbolikus linkek követése, mintha „-L” lenne
    megadva.
    A „..” feldolgozása a közvetlenül előtte lévő útvonalnév-összetevő
    eltávolításával történik, visszamenve egy osztásjelig vagy a KTÁR kezdetéig.

    Kilépési kód:
    0-val tér vissza, ha könyvtárat váltott és ha a -P használatakor a $PWD
    sikeresen beállításra kerül; más értéket különben.

 

Related Content