terminal = text interface to a computer
other names: console, shell, command line
variants:
pwd (print working directory)lscdThese paths have special meanings:
. = current directory.. = parent directory~ = user's personal directoryexample terminal commands:
pwd
ls .
cd ..
ls .
cd ~
pwd
ls .
Commands and programs may be run by typing their name, e.g. ls, explorer, git, node, python, ...
After the command name / program name we can add some arguments
positional arguments:
ls .mv a.txt archive/a.txtoptions:
ls . -a (bash)ls . -Force (powershell)node -h (short option name with single dash)node --help (long option name with double dash)named arguments via options (separated via a space or equal sign):
node --title=playgroundnode --eval "console.log(1);"git commit -m "test_message"up arrow (and down arrow) to go through previous commands
ctrl + R to search through previous commands
auto completion via tab key:
in powershell:
exp + tab → Expand-Archive
expl + tab → explorer.exe
in bash (under Windows):
a + tab + tab → lists all commands starting with a (exit long lists via Q)
cd ~/ + tab + tab (all possibilites in personal folder)cd ~/d + tab + tab (all possibilities starting with d)cd ~/de + tab (~/Desktop/)