This command uses a complete address:
Command
cd /home/maya/DocumentsPiece-by-piece explanation
cdchanges directory.- The first slash means start at the filesystem root.
home,maya, andDocumentsare successive branches.- Replace maya with your username.
Expected output
(no output)A successful change is silent. The destination does not depend on your starting directory.
When your current directory is /home/maya, this shorter command reaches the same place:
Command
cd DocumentsPiece-by-piece explanation
cdchanges directory.Documentsis looked up inside the current directory.- There is no opening slash, so this is relative.
Expected output
(no output)Success is silent. This works only when Documents is reachable from the current location.
The relative path . means the current directory. .. means the parent. The home shortcut ~ expands to your home path and is useful even though it does not begin with slash.