WolOS
Manual contents

Power user

What a terminal is

The window where you type instead of click: what the prompt, a command, an argument and a path are, how to copy and paste, Tab, Ctrl+C, and your first five commands.

On this page

What it is

A A window where you type commands instead of clicking. Super+Return opens one. is a window where you tell the computer what to do by typing a sentence instead of clicking a button. You type a One instruction you type in a terminal, such as ls (list the files here). Return runs it., press Return, and the answer appears as text right under it. Then the terminal waits for the next one.

Inside the terminal window a program called the The program inside a terminal that reads what you type and runs it. WolOS uses zsh unless you choose another. reads what you type and runs it. WolOS uses a shell called The shell WolOS uses in every terminal unless you choose another: it suggests from your history and completes names with Tab. unless you choose another; zsh basics is the next page.

You never need the terminal for everyday things on WolOS: every page above this one works with windows and buttons. The terminal is for when you want to do something many times, or exactly the same way every time, or something no button offers.

Why you might want one

A button does one thing. A command can be combined with others, repeated, saved in a file and run again tomorrow. "Rename these 300 photos by date", "make a copy of my Documents folder every Friday" or "show me what is using the disk" are one line each in a terminal. And when someone helps you on a forum, a command is easier to send and to follow than ten screenshots.

WolOS's own command, The WolOS command for the system: settings, updates, apps and checks, from a terminal or a script., can change most of what System Settings changes, so whatever you learn here also works in a A text file of commands that runs them in order, so a task you repeat becomes one command. later. A setting it changes can be undone like one changed in Settings, and anything that affects the whole computer still asks for your password on screen.

How

Open a terminal

Press Super+Return, or click Terminal in the Dock (the dark icon with >_), or press Super+Space, type "terminal" and press Return.

A terminal on the desktop: 1 marks Terminal in the menu bar, 2 the prompt, 3 the command ls, 4 its answer (the folders of the home folder), 5 the argument Documents in ls Documents, 6 the cursor waiting for the next command, 7 Terminal in the Dock.

The numbers in the picture:

  1. Terminal in the menu bar. Like any app, it has its name and its menus at the top while its window is in front.
  2. The prompt, ~ ❯. This is where the shell waits for you. The part before the arrow says which folder you are in: ~ (a tilde) is the short name of your home folder. The arrow turns red after a command that failed, so you notice.
  3. A command: ls, short for list. It lists what is in the folder you are in.
  4. The answer. The terminal prints it under the command. Folders are shown in colour, files in plain text.
  5. An argument. ls Documents lists the Documents folder instead. Words after the command are its Extra words after a command that tell it what to work on, such as Documents in ls Documents.: they tell it what to work on.
  6. The cursor. The block shows where the next letter you type will go.
  7. Terminal in the Dock, with a dot because it is running.

The parts of a command line

A command line is read from left to right, separated by spaces:

ls -l Documents

ls is the command. -l is an An argument that changes how a command works, usually starting with - or --, such as -l in ls -l.: an argument that starts with a dash and changes how the command works (here: one line per file, with its size and date). Documents is an argument: what to list. Most commands follow this pattern: the command, then options, then what to work on.

Capitals matter: ls works and LS does not, and documents is a different name from Documents.

Paths: the address of a file

Every file has an address called a The address of a file: the folders you go through to reach it, separated by /. For example /home/alice/Documents/notes.txt.: the folders you go through to reach it, separated by /. Your notes file has the path /home/aliceliddell/Documents/notes.txt (with your own account name instead of aliceliddell). Because the home folder is used so often, ~ stands for it: ~/Documents/notes.txt is the same file.

A path that starts with / or ~ is complete. A path without them starts from the folder you are in. Two special names help: .. is the folder one level up, and . is the folder you are in.

Moving between folders: 1 cd Documents/Recipes goes into the Recipes folder, 2 the prompt now shows ~/Documents/Recipes, 3 cat ../notes.txt reads a file one folder up, 4 cd with nothing after it goes home, 5 pwd prints the full path of the home folder.

  1. cd Documents/Recipes (change directory) moves you into the Recipes folder inside Documents. It prints nothing; silence means it worked.
  2. The prompt now reads ~/Documents/Recipes ❯, so you always know where you are. pwd (print working directory) says the same in full.
  3. cat ../notes.txt shows the file notes.txt from one folder up: .. is Documents.
  4. cd with nothing after it takes you home from anywhere.
  5. pwd prints /home/aliceliddell, the full path of the home folder.

Tab finishes names for you

Type the start of a name and press Tab: the shell completes it. That saves typing and, more important, spelling mistakes.

Tab completion: 1 marks Documents/, finished by Tab after typing cd Doc, 2 the grey suggestion Recipes from an earlier command.

  1. After cd Doc and Tab, the line reads cd Documents/ (1): the only name starting with Doc is filled in.
  2. The grey text after it (2) is a suggestion from the commands you typed before. Press the Right arrow key to take it, or keep typing to ignore it.

When several names fit, Tab shows them all; press Tab again to move through them and Return to pick one.

Tab with several matches: 1 marks the line cd Desktop/, 2 the list Desktop/, Documents/ and Downloads/ with Desktop/ highlighted.

Stop a command: Ctrl+C

Some commands run until you stop them. ping localhost checks that the computer answers itself, once a second, for ever. Ctrl+C stops whatever is running and gives you the prompt back.

Stopping a command: 1 marks ping localhost, 2 its answers, one a second, 3 ^C where Ctrl+C was pressed, 4 the prompt back again.

In a terminal, Ctrl+C means stop, not copy. That is why copying uses Super:

Copy and paste in a terminal

ToPress
Copy what you selectedSuper+C (or Ctrl+Shift+C)
PasteSuper+V (or Ctrl+Shift+V)
Stop the running commandCtrl+C
Clear the windowCtrl+L
Bring back an earlier commandUp arrow (then Return to run it again, or edit it first)
Close the windowSuper+W

Select text with the mouse as anywhere else: drag over it, or double-click a word.

Your first five commands

TypeWhat it does
lsLists the files and folders where you are.
cd DocumentsGoes into the Documents folder. cd .. goes up one, cd alone goes home.
pwdPrints the full path of the folder you are in.
cat notes.txtShows what is in a text file.
wol helpLists what WolOS's own command can do; see The terminal and the wol command.

A worked example

Alice wants to know how many photos she has from her holiday. She opens a terminal with Super+Return, types cd Pic, presses Tab (the line becomes cd Pictures/), types Hol, presses Tab again (cd Pictures/Holiday/) and presses Return. The prompt now reads ~/Pictures/Holiday ❯. She types ls and sees every photo. To count them she types ls | wc -l: the bar | hands the list to wc -l, which counts lines, and the terminal prints 214. She presses Up twice to get back ls, and Super+W to close the window.

If something goes wrong

The shell tells you in one line what it did not understand, and the arrow of the next prompt turns red.

Common messages: 1 zsh: command not found: lss, 2 cd: no such file or directory: Documnets, 3 cat: notes.txt: No such file or directory, because notes.txt is in Documents, 4 cat Documents/notes.txt, which works.

What you seeWhat it means and what to do
zsh: command not found: lss (1)No command has that name. Check the spelling; ls was meant. If the spelling is right, the program is not installed.
cd: no such file or directory: Documnets (2)No folder has that name where you are. Press Tab after the first letters instead of typing the whole name.
cat: notes.txt: No such file or directory (3)The file is not in the folder you are in. Give its path, as in (4), or cd to its folder first.
Nothing happens and there is no promptA command is still running or waiting for you to type. Press Ctrl+C.
> or quote> at the start of the lineThe shell thinks a sentence is not finished, usually because of an unpaired quote mark. Press Ctrl+C and type the line again.
Permission deniedThe file belongs to the system or to another account. Your own files are in your home folder.
A command asks for a password and nothing appears as you typeThat is on purpose: password letters are not shown. Type it and press Return.
The window is full of textCtrl+L clears it. Nothing is lost; scroll up to see it again.