Terminal Basics on your Device
This guide covers the essential Unix commands you need to navigate the file system and edit files directly in the obacht web terminal. No prior Linux experience is required.
1. Open the Terminal
Navigate to the device in obacht and confirm it is Online.
Go to the Terminal tab and click Connect.
Once connected you have a full shell as the obacht user. The prompt looks like this:
obacht@raspberrypi:~ $
Everything to the left of $ tells you who you are (obacht), which machine you are on (raspberrypi), and where in the file system you currently are (~, which means your home directory). You type your commands after the $.
2. Copy and Paste in the Web Terminal
The obacht terminal runs in your browser. Standard keyboard shortcuts (Ctrl + C / Ctrl + V) behave differently here — Ctrl + C in a terminal cancels a running command, not copies text.
Pasting text into the terminal
The easiest way to paste something from your clipboard (for example, a command you copied from a documentation page) is to use the clipboard manager built into the terminal toolbar. Look for the clipboard icon (📋) at the top of the terminal panel. Click it, paste your text into the field that appears, and confirm — the text is sent to the terminal as if you had typed it.
Alternatively, most browsers support right-click → Paste directly in the terminal area.
Tip: This is especially useful when following the steps in Advanced: Clone GitHub — you can copy the
gh repo clonecommand from the docs and paste it in without retyping.
Copying text from the terminal
Select any text in the terminal with your mouse. In most browsers the selection is automatically copied to your clipboard, or you can right-click and choose Copy.
3. Where Am I? (pwd)
pwd stands for print working directory. It tells you your current location in the file system.
pwd
The output will look something like:
/home/obacht
This is the home directory of the obacht user — your default starting point every time you connect.
4. What Is Here? (ls)
ls lists the contents of the current directory.
ls
To see more detail — file sizes, permissions, and hidden files — add the -la flags:
ls -la
Files and folders whose names begin with . are hidden (configuration files, for example). The -a flag makes them visible; -l adds one line per entry with details.
5. Moving Around (cd)
cd stands for change directory. Use it to move between folders.
cd my-project
This moves you into the folder my-project inside the current directory. After cloning a repository with gh repo clone, the repository folder appears here and you can cd into it.
To go up one level (back toward the root):
cd ..
To jump straight back to your home directory from anywhere:
cd ~
After every cd you can run pwd to confirm where you landed, or just check the prompt — the part between : and $ updates automatically.
6. Reading Files (cat and less)
cat — print a file in one go
cat README.md
cat outputs the entire file directly in the terminal. Good for short files.
less — scroll through longer files
less README.md
less lets you scroll up and down with the arrow keys. Press q to quit and return to the prompt.
7. Editing Files (nano)
nano is a simple text editor that runs inside the terminal. It is pre-installed on Raspberry Pi OS.
nano README.md
This opens the file for editing. The bottom of the screen shows the available keyboard shortcuts:
| Shortcut | Action |
|---|---|
Ctrl + O | Save the file (O for Output / Write Out) |
Enter | Confirm the filename when saving |
Ctrl + X | Exit nano |
Ctrl + K | Cut the current line |
Ctrl + U | Paste the cut line |
Ctrl + W | Search within the file |
To create a new file, call nano with a filename that does not yet exist:
nano notes.txt
Type your content, press Ctrl + O to save, and Ctrl + X to exit.
Note: All shortcuts shown in nano use the
^symbol forCtrl.^OmeansCtrl + O.
8. Making a File Executable (chmod)
When you run a script — for example a shell script that starts your web app — Linux needs to know that the file is allowed to run as a program. By default, newly created or cloned files are not executable. You grant this permission with chmod.
chmod +x start.sh
+x means add execute permission. After this command, you can run the script directly:
./start.sh
The ./ at the beginning means "this file, in the current directory". Linux requires it when running a script directly so it knows to look here rather than in the system-wide command paths.
You can confirm the permission was applied with ls -la:
ls -la start.sh
The output will show something like:
-rwxr-xr-x 1 obacht obacht 42 Jun 3 12:00 start.sh
The x characters in the permission string (rwx) confirm the file is now executable.
9. A Typical Workflow
After cloning your repository to the device (see Advanced: Clone GitHub), a common sequence of commands looks like this:
ls # confirm the cloned folder is here
cd my-project # move into the project folder
ls -la # see all files including hidden ones
cat .env # read a configuration file
nano .env # edit the configuration file
cd .. # go back up when done
10. Quick Reference
| Command | What it does |
|---|---|
pwd | Show current location |
ls | List files and folders |
ls -la | List with details and hidden files |
cd folder | Move into folder |
cd .. | Move up one level |
cd ~ | Go home |
cat file | Print file contents |
less file | Scroll through a file (q to quit) |
nano file | Open file in editor |
Ctrl + O | Save in nano |
Ctrl + X | Exit nano |
chmod +x file | Make a file executable |
./file | Run an executable in the current directory |