Skip to content

All Ollama Commands for Windows and Mac

Terminal commands 50

Everyday

ollama run gemma4
Downloads a model and starts a chat.
ollama run gemma4 "Why is the sky blue?"
Asks one question and exits.
ollama pull gemma4
Downloads or updates a model.
ollama list
Shows the models you have.
ollama ps
Shows models loaded in memory.
ollama stop gemma4
Unloads a model from memory.
ollama rm gemma4
Deletes a model.
ollama show gemma4
Shows a model's size and details.
ollama --version
Shows your Ollama version.
ollama help
Lists every command.

Run options

ollama run gemma4 --verbose
Shows the speed after each reply.
ollama run gemma4 --think=false
Turns thinking off.
ollama run gemma4 --think=high
Thinks harder, on models that can.
ollama run gemma4 --hidethinking
Hides the thinking text.
ollama run gemma4 --format json
Replies in JSON.
ollama run gemma4 --keepalive 30m
Keeps the model loaded for 30 minutes.
ollama run gemma4 --nowordwrap
Stops wrapping long lines.
cat notes.txt | ollama run gemma4 "Summarize this"Get-Content notes.txt | ollama run gemma4 "Summarize this"
Asks about a text file.Asks about a text file.
ollama run gemma4 "What's in this image? /Users/you/Desktop/photo.png"ollama run gemma4 "What's in this image? C:\Users\you\Desktop\photo.png"
Asks about a picture.Asks about a picture.

Special models

ollama run embeddinggemma "Hello world"
Turns text into embeddings.
ollama run phonon "Hello from Ollama."
Reads text out loud.
ollama run phonon --voice Zoey "Hi, this is Zoey."
Reads it in another voice.
ollama run nimble --ask "Is a refund being requested?" < ticket.txtGet-Content ticket.txt | ollama run nimble --ask "Is a refund being requested?"
Answers yes or no about a file.Answers yes or no about a file.
ollama run nimble --ask "Which team should handle this?" --choice billing="Payments" --choice technical="Software" < ticket.txtGet-Content ticket.txt | ollama run nimble --ask "Which team should handle this?" --choice billing="Payments" --choice technical="Software"
Picks a label for a file.Picks a label for a file.

Custom models

ollama create mymodel -f Modelfile
Makes your own model from a Modelfile.
ollama cp gemma4 my-gemma
Copies a model under a new name.
ollama show gemma4 --modelfile
Shows a model's Modelfile.
ollama show gemma4 --parameters
Shows its settings.
ollama show gemma4 --template
Shows its prompt template.
ollama show gemma4 --system
Shows its system message.
ollama show gemma4 --license
Shows its license.
ollama show gemma4 -v
Shows every detail.
ollama push yourname/mymodel
Uploads your model to ollama.com.

Apps and account

ollama launch
Opens a menu to pick a model or app.
ollama launch claude
Runs Claude Code on Ollama.
ollama launch claude --model qwen3.5
Runs it with a model you pick.
ollama launch codex
Runs Codex on Ollama.
ollama launch opencode
Runs OpenCode on Ollama.
ollama launch vscode
Sets up VS Code chat.
ollama launch droid --config
Sets up an app without opening it.
ollama launch codex --restore
Puts an app back to its own settings.
ollama signin
Signs in to ollama.com.
ollama signout
Signs out.

Install and server

curl -fsSL https://ollama.com/install.sh | shirm https://ollama.com/install.ps1 | iex
Installs Ollama.Installs Ollama.
ollama serve
Starts Ollama without the app.
open -a Ollama& "ollama app.exe"
Opens the Ollama app.Opens the Ollama app.
curl http://localhost:11434curl.exe http://localhost:11434
Checks if Ollama is running.Checks if Ollama is running.
curl http://localhost:11434/api/tagscurl.exe http://localhost:11434/api/tags
Lists your models through the API.Lists your models through the API.
curl http://localhost:11434/api/generate -d '{"model":"gemma4","prompt":"Why is the sky blue?","stream":false}'(Invoke-WebRequest -method POST -Body '{"model":"gemma4","prompt":"Why is the sky blue?","stream":false}' -uri http://localhost:11434/api/generate).Content | ConvertFrom-Json
Asks a question through the API.Asks a question through the API.
which ollamawhere.exe ollama
Shows where Ollama is installed.Shows where Ollama is installed.

Chat commands 36

Basics

/?
Shows the chat commands.
/? shortcuts
Shows the keyboard shortcuts.
/bye
Leaves the chat.
/clear
Forgets the chat so far.
"""
Starts and ends a message on many lines.
/load gemma4
Switches to another model.
/save mychat
Saves the chat as a new model.

Chat settings

/set system "Talk like a pirate."
Gives the model a role.
/set think
Turns thinking on.
/set think high
Sets how hard it thinks.
/set nothink
Turns thinking off.
/set verbose
Shows the speed after each reply.
/set quiet
Hides the speed again.
/set format json
Replies in JSON.
/set noformat
Goes back to plain replies.
/set wordwrap
Wraps long lines.
/set nowordwrap
Stops wrapping long lines.
/set history
Remembers what you type.
/set nohistory
Stops remembering what you type.

Model parameters

/set parameter num_ctx 8192
Lets it remember more of the chat.
/set parameter temperature 0.7
Higher is more creative.
/set parameter seed 42
Gives the same answer every time.
/set parameter num_predict 500
Limits how long replies get.
/set parameter top_k 40
Picks from fewer likely words.
/set parameter top_p 0.9
Picks from the most likely words.
/set parameter min_p 0.05
Skips very unlikely words.
/set parameter repeat_penalty 1.1
Repeats itself less.
/set parameter repeat_last_n 64
How far back it checks for repeats.
/set parameter num_gpu 20
Puts this many layers on the GPU.
/set parameter stop "User:"
Stops the reply at this word.

Model info

/show info
Shows the model's details.
/show parameters
Shows its settings.
/show system
Shows its system message.
/show template
Shows its prompt template.
/show modelfile
Shows its Modelfile.
/show license
Shows its license.

Keyboard shortcuts 12

Typing

Ctrl + A
Jumps to the start of the line.
Ctrl + E
Jumps to the end of the line.
Esc then BAlt + B
Moves back one word.Moves back one word.
Esc then FAlt + F
Moves forward one word.Moves forward one word.
Ctrl + W
Deletes the word before the cursor.
Ctrl + U
Deletes everything before the cursor.
Ctrl + K
Deletes everything after the cursor.
Up and Down arrows
Brings back earlier messages.

Chat

Ctrl + C
Stops the reply.
Ctrl + D
Leaves the chat.
Ctrl + L
Clears the screen.
Ctrl + G
Writes your message in a text editor.

Settings 15

Change a setting

Quit and reopen Ollama after a change.

launchctl setenv OLLAMA_HOST "0.0.0.0:11434"setx OLLAMA_HOST "0.0.0.0:11434"
Lets other devices on your network use it.Lets other devices on your network use it.
launchctl setenv OLLAMA_MODELS "/Volumes/External/ollama-models"setx OLLAMA_MODELS "D:\ollama-models"
Saves models to another drive.Saves models to another drive.
launchctl setenv OLLAMA_CONTEXT_LENGTH "8192"setx OLLAMA_CONTEXT_LENGTH "8192"
Lets models remember longer chats.Lets models remember longer chats.
launchctl setenv OLLAMA_KEEP_ALIVE "24h"setx OLLAMA_KEEP_ALIVE "24h"
Keeps models loaded for a day.Keeps models loaded for a day.
launchctl setenv OLLAMA_FLASH_ATTENTION "1"setx OLLAMA_FLASH_ATTENTION "1"
Uses less memory on long chats.Uses less memory on long chats.
launchctl setenv OLLAMA_KV_CACHE_TYPE "q8_0"setx OLLAMA_KV_CACHE_TYPE "q8_0"
Cuts chat memory use in half.Cuts chat memory use in half.
launchctl setenv OLLAMA_NUM_PARALLEL "2"setx OLLAMA_NUM_PARALLEL "2"
Answers more requests at once.Answers more requests at once.
launchctl setenv OLLAMA_MAX_LOADED_MODELS "2"setx OLLAMA_MAX_LOADED_MODELS "2"
Sets how many models stay loaded.Sets how many models stay loaded.
launchctl setenv OLLAMA_ORIGINS "chrome-extension://*,moz-extension://*,safari-web-extension://*"setx OLLAMA_ORIGINS "chrome-extension://*,moz-extension://*,safari-web-extension://*"
Lets browser extensions connect.Lets browser extensions connect.
launchctl setenv OLLAMA_NO_CLOUD "1"setx OLLAMA_NO_CLOUD "1"
Turns off cloud models and web search.Turns off cloud models and web search.
launchctl setenv OLLAMA_NOHISTORY "1"setx OLLAMA_NOHISTORY "1"
Stops saving what you type in chats.Stops saving what you type in chats.
launchctl setenv OLLAMA_DEBUG "1"setx OLLAMA_DEBUG "1"
Adds more detail to the logs.Adds more detail to the logs.

Check or undo a setting

launchctl getenv OLLAMA_HOST[Environment]::GetEnvironmentVariable("OLLAMA_HOST", "User")
Shows a setting's value.Shows a setting's value.
launchctl unsetenv OLLAMA_HOST[Environment]::SetEnvironmentVariable("OLLAMA_HOST", $null, "User")
Removes a setting.Removes a setting.
OLLAMA_HOST=0.0.0.0:11434 ollama serve$env:OLLAMA_HOST="0.0.0.0:11434"; ollama serve
Tries a setting once without saving it.Tries a setting once without saving it.

Files and logs 9

Logs

cat ~/.ollama/logs/server.logGet-Content "$env:LOCALAPPDATA\Ollama\server.log"
Shows the server log.Shows the server log.
tail -f ~/.ollama/logs/server.logGet-Content "$env:LOCALAPPDATA\Ollama\server.log" -Wait
Watches the log live.Watches the log live.
open ~/.ollama/logsexplorer "$env:LOCALAPPDATA\Ollama"
Opens the logs folder.Opens the logs folder.
OLLAMA_DEBUG=1 ollama serve$env:OLLAMA_DEBUG="1"; & "ollama app.exe"
Starts Ollama with detailed logs.Starts Ollama with detailed logs.

Models folder

open ~/.ollama/modelsexplorer "$env:USERPROFILE\.ollama\models"
Opens the models folder.Opens the models folder.
du -sh ~/.ollama/models"{0:N1} GB" -f ((Get-ChildItem "$env:USERPROFILE\.ollama\models" -Recurse | Measure-Object Length -Sum).Sum / 1GB)
Shows how much space models use.Shows how much space models use.
rm -rf ~/.ollamaRemove-Item -Recurse -Force "$env:USERPROFILE\.ollama"
Deletes every model and setting.Deletes every model and setting.

Uninstall

sudo rm -rf /Applications/Ollama.appstart ms-settings:appsfeatures
Removes the Ollama app.Opens Installed apps to remove Ollama.
sudo rm /usr/local/bin/ollama
Removes the ollama command.