Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

πŸ’» Linux Terminal Quick Reference

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:

pwd

pwd means print working directory. It shows the directory you are currently working in.

For example:

/home/jovyan

or:

/home/jovyan/workshop

What is here?ΒΆ

Run:

ls

ls lists the files and directories in your current location.

You can also list a specific directory without moving into it:

ls ~/workshop

For a more detailed listing with human-readable file sizes:

ls -lh

Move into a directoryΒΆ

Use cd followed by a directory path.

For example:

cd ~/workshop/newport_dem

Then check your location:

pwd

and list what is there:

ls

Move back one directoryΒΆ

Run:

cd ..

.. means the parent directory, or one level up.

For example:

~/workshop/newport_dem
          ↓
        cd ..
          ↓
~/workshop

Return to your home directoryΒΆ

From anywhere, run:

cd ~

or simply:

cd

Both return you to your home directory.


Useful path shortcutsΒΆ

SymbolMeaning
~Your home directory, such as /home/jovyan
.The current directory
..The parent directory
/The top, or root, of the Linux filesystem

For this workshop:

~/workshop

means 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+C

Do 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 keyWhat it does
pwdShow your current directory
lsList files and directories
ls ~/workshopShow the workshop workspace
ls -lhList files with details and readable file sizes
cd directory_nameMove into a directory
cd ..Move up one directory
cd ~ or cdReturn to your home directory
TabAutocomplete a filename or directory
Up ArrowRecall a previous command
Ctrl+CStop the currently running command
\ at the end of a lineContinue a command on the next line

If you get lostΒΆ

These two commands are usually the best place to start:

pwd
ls

To inspect the workshop workspace from anywhere:

ls ~/workshop

If 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.