Skip to main content

Synopsis

ollama list [MODEL_PREFIX]
ollama ls [MODEL_PREFIX]

Description

The list command (alias: ls) displays all models currently available in your local library. It shows:
  • Model names
  • Model IDs (digest)
  • Size on disk
  • Last modified time
You can optionally filter the list by providing a model name prefix.

Arguments

MODEL_PREFIX
string
Optional prefix to filter models. Shows only models whose names start with this prefix.
ollama list llama  # Show only llama models

Options

The list command has no flags or options.

Examples

List All Models

Show all models in your library:
ollama list
Output:
NAME                    ID              SIZE      MODIFIED
llama3.2:latest         8934d96d3f08    4.7 GB    2 hours ago
mistral:7b-instruct     2e0493f67d0c    4.1 GB    1 day ago
codellama:7b            7c23fb36d801    3.8 GB    3 days ago
nomic-embed-text        42ba7f8a01dd    274 MB    1 week ago

Filter by Prefix

Show only models starting with “llama”:
ollama list llama
Output:
NAME                    ID              SIZE      MODIFIED
llama3.2:latest         8934d96d3f08    4.7 GB    2 hours ago
llama3.2:8b             a1b2c3d4e5f6    8.2 GB    1 day ago

Using the Alias

The ls alias works identically:
ollama ls
ollama ls mistral

Output Format

The output is formatted as a table with these columns:
NAME
string
Full model name including tag (e.g., llama3.2:latest)
ID
string
First 12 characters of the model’s SHA256 digest. Uniquely identifies the model.
SIZE
string
Disk space used by the model. Shown in human-readable format (MB, GB).For cloud models, displays ”-” since they’re not stored locally.
MODIFIED
string
When the model was last pulled or created:
  • “5 minutes ago”
  • “2 hours ago”
  • “3 days ago”
  • “1 week ago”
  • “Never” (for models that haven’t been updated)

Understanding Model Names

Model names follow this format:
name:tag
  • name: The model name (e.g., llama3.2, mistral)
  • tag: The variant or version (e.g., latest, 7b, 13b-instruct)
If no tag is specified, :latest is assumed.

Disk Usage

To see total disk space used by all models:
du -sh ~/.ollama/models
Or set a custom location:
du -sh $OLLAMA_MODELS

Scripting Usage

Extract model information for scripts:
# Check if a model exists
if ollama list | grep -q "llama3.2:latest"; then
    echo "Model exists"
fi

# Count total models
ollama list | tail -n +2 | wc -l

# List only model names
ollama list | tail -n +2 | awk '{print $1}'

# Get model ID
MODEL_ID=$(ollama list llama3.2 | tail -n +2 | awk '{print $2}')

Common Patterns

Find Large Models

Find models over 5GB:
ollama list | awk '$3 ~ /GB$/ && $3+0 > 5 {print $1, $3}'

List by Modification Time

Find recently updated models:
ollama list | grep "hour\|minute"

Check for Specific Tag

List all 7B parameter models:
ollama list | grep ":7b"

Model Storage Location

Models are stored in:
  • Linux/macOS: ~/.ollama/models
  • Windows: %USERPROFILE%\.ollama\models
  • Custom: Set via OLLAMA_MODELS environment variable

Cloud Models

Cloud models (models running on remote servers) appear in the list but show:
  • Size: - (not stored locally)
  • Different ID format
Example:
NAME                    ID              SIZE      MODIFIED
llama3.2:latest         8934d96d3f08    4.7 GB    2 hours ago
gpt-4-turbo:latest      cloud:abc123    -         Never

Empty Library

If no models are installed:
ollama list
Output:
NAME    ID    SIZE    MODIFIED
Solution: Pull a model:
ollama pull llama3.2
ollama list

Environment Variables

OLLAMA_HOST
string
default:"http://127.0.0.1:11434"
Ollama server address to query for the model list
OLLAMA_MODELS
string
default:"~/.ollama/models"
Directory where models are stored (affects local vs cloud display)

Exit Codes

  • 0 - Success
  • 1 - Error (server not running, etc.)

Troubleshooting

Server Not Running

Error: could not connect to ollama server
Solution: Start the Ollama server:
ollama serve

No Models Showing

If the command succeeds but shows no models, you haven’t pulled any yet:
ollama pull llama3.2

Comparison with Other Commands

CommandPurpose
ollama listShow all available models
ollama psShow currently running models
ollama show MODELShow detailed info about one model