Guides › Desktop and apps
Terminal
Open the Terminal, type commands in the Sovereign shell, and write simple scripts.
The Terminal is a window where you type commands instead of clicking. It runs the Sovereign shell, the system's own command language. You never need the Terminal for everyday use, but it can be quicker for some jobs.
Open the Terminal
Do any one of these:
- Press Ctrl + Alt + T.
- Click Terminal on the taskbar, or find it in Start.
- Press Logo key + X and choose Terminal.
- Press Logo key + R, type
cmdand press Enter.
The Terminal shows a prompt like PS C:\Accounts\alex>. The part after PS is the folder you are in. Type a command after the > and press Enter.
Type your first commands
- Type
helpand press Enter. You see every command, grouped by what it does. - Type
dirand press Enter. You see the files and folders in the current folder. - Type
cd Documentsand press Enter. The prompt changes to show you are now in Documents. - Type
cd ..and press Enter to go back up one folder. - Type
clsto clear the screen.
Some tips:
- Command names ignore upper and lower case, so
DIRanddirare the same. - Paths use drive letters and backslashes, like
D:\Music. TypeD:alone to switch to drive D. See Files and drives. - Press Tab to finish a command or file name you started typing.
- Press Up and Down to bring back commands you typed before.
- Press Ctrl + C to cancel what you are typing, or to stop a command that is still running.
- Put quotes around paths with spaces:
cd "C:\Shared Data".
Common commands
Most commands have a long name and short names. Either works.
Files and folders
| Command | What it does |
|---|---|
dir (gci, Get-ChildItem) | List a folder. Add -Recurse for subfolders, -Filter *.txt for only some files |
cd (Set-Location) | Change folder: cd D:\Music, cd .., cd \ |
Get-Location (pwd) | Show the current folder |
type (Get-Content) | Show what is in a file. -Head 10 or -Tail 10 show the first or last lines |
copy FROM TO (Copy-Item) | Copy a file or folder |
move FROM TO (Move-Item) | Move a file or folder |
ren PATH NEWNAME (Rename-Item) | Rename a file or folder |
del (Remove-Item) | Delete files. -Recurse deletes a folder and everything in it |
md NAME | Make a folder |
rd NAME | Remove a folder (-Recurse when it is not empty) |
Test-Path PATH | Check whether a file or folder is there |
Get-PSDrive | List the drives, with used and free space |
start PATH | Open a file in its app, a folder in Files, or an app |
Text
| Command | What it does |
|---|---|
echo (Write-Output) | Print text. Add > file.txt to write it to a file, >> file.txt to add to the end |
findstr (Select-String) | Find text in files, or in what another command printed |
Measure-Object | Count lines, words and characters |
This computer
| Command | What it does |
|---|---|
systeminfo | A summary of this computer |
ver | The system version |
Get-Date, Get-Uptime | The date and time, and how long the computer has been on |
tasklist (Get-Process) | List running programs |
taskkill /PID ID (Stop-Process) | Stop a program by its number |
hostname, whoami | The computer name, and who you are signed in as |
Get-History | Commands typed so far |
Restart-Computer, Stop-Computer, Suspend-Computer | Restart, shut down or sleep |
Network
| Command | What it does |
|---|---|
ipconfig | Your network addresses (/all for more) |
ping HOST | Check that another computer answers |
Get-NetAdapter (net) | Network adapters and addresses |
Invoke-WebRequest URL -OutFile FILE | Download a file |
Commands only Sovereign OS has
| Command | What it does |
|---|---|
ask QUESTION (Invoke-Assistant) | Ask the Assistant |
Get-Model, Find-Model, Save-Model, Set-Model | List, search, download and switch language models |
Set-KeyboardLayout, Set-DisplayLanguage | Keyboard layouts and display language |
Get-DeveloperMode | Whether Developer Mode is on |
distro | List, install, start and stop Linux distros |
Type help for the full list, and where NAME to see what a command name runs.
Use tabs
- Click the plus button in the tab strip, or press Ctrl + Shift + T, for a new tab.
- Press Ctrl + Shift + W to close a tab, or click its close mark.
- Press Ctrl + Tab to move to the next tab, or Alt + 1 to 9 to jump to one.
- Right-click the plus button, or press Ctrl + Shift + P, for a list of shells to open in a new tab.
- Press Ctrl + Shift + V to paste text.
- Scroll with the mouse wheel, or Shift + Page Up and Shift + Page Down.
Run a command as administrator
Some commands change the whole system and need an administrator. This is off until you turn it on.
- Open Settings > System > Advanced.
- Turn on Run as administrator in the Terminal.
- In the Terminal, type
elevate, a space, and then the command you want to run. - A box asks Allow this change? Choose an administrator, type their password and click Yes.
The password is remembered for 5 minutes, in that tab only. elevate -Shell makes the whole tab an administrator shell until you type exit. elevate -Help lists the other options.
Write and run a script
A script is a text file with commands, one per line, that run in order. Scripts end in .ps1.
- Open Text Editor.
- Type the three lines shown below, each on its own line.
- Save the file as
hello.ps1in your Documents folder.
The three lines:
$name = Read-Host "What is your name"echo "Hello $name"Start-Sleep 2
Now run it:
- In the Terminal, type
cd Documentsand press Enter. - Type
.\hello.ps1and press Enter. - The script asks for your name. Type it and press Enter. The script greets you.
What the lines mean:
$name = valuekeeps a value under a name.$nameuses it later.Read-Hostasks you to type something.Start-Sleep 2waits two seconds.
You can also run a script by its full path with & "C:\path\script.ps1". Running it with . .\script.ps1 keeps its values in your shell after it ends.
Developer tools
The Terminal also has kpkg to install Store apps by typing, kdbg to debug a program and kprof to see where a program spends its time. See Developer tools in the Terminal.
Linux commands
Commands like ls, grep or sudo are Linux commands, not commands of this shell. If you type one, the Terminal tells you so.
Once a Linux distro is installed and running, the tab strip shows a Connect to Linux button. It opens a new tab in that distro's own shell, where Linux commands and paths work as usual. To make new Terminals open the Linux shell, open Settings > System > Advanced and set Terminal to Linux distro shell. See Linux programs.
If something goes wrong
- "Running commands as administrator from the Terminal is off." Turn on Run as administrator in the Terminal as shown above.
- A command seems stuck. Press Ctrl + C.
- A file name is not found. Check the folder with
Get-Location, and use quotes around names with spaces.
Still stuck? Search the help center or contact support.