Skip to main content

Navigation Commands

cd — Change directory

cd [dir]
UsageResult
cdGo to home directory ($HOME)
cd /path/to/dirGo to absolute path
cd relative/pathGo to relative path
cd -Go to previous directory ($OLDPWD)
cd ..Go up one level
cd ~/projectsTilde expands to home
tip

cd - is a quick toggle between two directories — great when bouncing between source and output dirs.


pwd — Print working directory

pwd

Prints the absolute path of the current directory.

$ pwd
/home/user/projects/xshell

ls — List directory contents

ls [-a] [-l] [path ...]
FlagDescription
-a / --allShow hidden files (starting with .)
-lLong format — shows size and type indicator

Directories are shown in blue, executables in green (Unix only).

ls # short listing of current dir
ls -la # long listing including hidden
ls -l ~/Desktop # long listing of another path
ls src tests # list multiple directories
note

dir is an alias for ls and accepts the same flags.


Default aliases for navigation

These aliases are pre-configured in the default config:

.. # cd ..
... # cd ../..
ll # ls -l
la # ls -a
lla # ls -la