You only need a few Linux terminal commands for this workshop.
You do not need to memorize them. Keep this page open as a reference and return to it whenever you need it.
Where am I?ΒΆ
Run:
pwdpwd means print working directory. It shows the directory you are currently working in.
For example:
/home/jovyanor:
/home/jovyan/workshopWhat is here?ΒΆ
Run:
lsls lists the files and directories in your current location.
You can also list a specific directory without moving into it:
ls ~/workshopFor a more detailed listing with human-readable file sizes:
ls -lhMove into a directoryΒΆ
Use cd followed by a directory path.
For example:
cd ~/workshop/newport_demThen check your location:
pwdand list what is there:
lsMove back one directoryΒΆ
Run:
cd .... means the parent directory, or one level up.
For example:
~/workshop/newport_dem
β
cd ..
β
~/workshopReturn to your home directoryΒΆ
From anywhere, run:
cd ~or simply:
cdBoth return you to your home directory.
Useful path shortcutsΒΆ
| Symbol | Meaning |
|---|---|
~ | Your home directory, such as /home/jovyan |
. | The current directory |
.. | The parent directory |
/ | The top, or root, of the Linux filesystem |
For this workshop:
~/workshopmeans the workshop directory inside your home directory.
Use Tab to autocompleteΒΆ
Start typing a filename or directory name and press Tab.
For example:
cd ~/workshop/newp<Tab>The terminal may complete the name for you.
Autocomplete is especially helpful for long filenames and reduces typing mistakes.
Recall a previous commandΒΆ
Press the Up Arrow to bring back commands you ran previously.
This is useful when you want to make a small change and run a command again.
Stop a running commandΒΆ
If you intentionally need to stop a command that is currently running, press:
Ctrl+CDo not use Ctrl+C just because a DEM-processing step takes some time. Some workshop commands are expected to run for several minutes.
Multi-line commandsΒΆ
Some workshop commands are written across several lines to make them easier to read:
globato build \
-R -124.10/-124.00/44.59/44.64 \
-P epsg:4269+5703 \
...The backslash (\) at the end of a line tells the Linux shell that the command continues on the next line.
You can paste the full multi-line command into the terminal as shown.
Workshop quick referenceΒΆ
| Command or key | What it does |
|---|---|
pwd | Show your current directory |
ls | List files and directories |
ls ~/workshop | Show the workshop workspace |
ls -lh | List files with details and readable file sizes |
cd directory_name | Move into a directory |
cd .. | Move up one directory |
cd ~ or cd | Return to your home directory |
Tab | Autocomplete a filename or directory |
Up Arrow | Recall a previous command |
Ctrl+C | Stop the currently running command |
\ at the end of a line | Continue a command on the next line |
If you get lostΒΆ
These two commands are usually the best place to start:
pwd
lsTo inspect the workshop workspace from anywhere:
ls ~/workshopIf a workshop command fails and you are not sure why, copy the error message and show it to an instructor rather than installing or changing software on your own.