[GH-ISSUE #1876] ollama list flags help #26834

Open
opened 2026-04-22 03:30:20 -05:00 by GiteaMirror · 13 comments
Owner

Originally created by @iplayfast on GitHub (Jan 9, 2024).
Original GitHub issue: https://github.com/ollama/ollama/issues/1876

There is no obvious way of seeing what flags are available for ollama list

ollama list --help
List models

Usage:
  ollama list [flags]

Aliases:
  list, ls

Flags:
  -h, --help   help for list

Originally created by @iplayfast on GitHub (Jan 9, 2024). Original GitHub issue: https://github.com/ollama/ollama/issues/1876 There is no obvious way of seeing what flags are available for ollama list ``` ollama list --help List models Usage: ollama list [flags] Aliases: list, ls Flags: -h, --help help for list ```
GiteaMirror added the clifeature request labels 2026-04-22 03:30:20 -05:00
Author
Owner

@pdevine commented on GitHub (Jan 9, 2024):

There's actually only the -h flag for ollama list right now. Was there anything in particular that you were looking for?

<!-- gh-comment-id:1883938584 --> @pdevine commented on GitHub (Jan 9, 2024): There's actually only the `-h` flag for `ollama list` right now. Was there anything in particular that you were looking for?
Author
Owner

@iplayfast commented on GitHub (Jan 10, 2024):

Yes there are several things that could be improved upon. Currently ollama list will display
Name,ID,Size and modified in the current format with no variation. This is problematic.

  1. Name is case sensitive alphabetical using -I or --ignorecase for ignore case would make it case insensitive alphabetical
  2. currently the size of the model is in human readable format which uses things like 637 MB, 4.1 GB. If I want to send it through a sort program that is a problem. I propose using the -s or --size of bytes, otherwise the default is human readable.
  3. The modified column has things like 6 days ago, or 8 weeks ago which is good for humans, but not so good for other things. I propose -t or --time in the HH:MM:SS format and -ts or --seconds in the total number of seconds format
  4. There is no default sorting method. I propose -o or --order followed by the column number or negative column number for reverse sorting.
  5. Lastly -h or --help to show the command options.
<!-- gh-comment-id:1884211317 --> @iplayfast commented on GitHub (Jan 10, 2024): Yes there are several things that could be improved upon. Currently ollama list will display Name,ID,Size and modified in the current format with no variation. This is problematic. 1. Name is case sensitive alphabetical using **-I or --ignorecase** for ignore case would make it case insensitive alphabetical 2. currently the size of the model is in human readable format which uses things like 637 MB, 4.1 GB. If I want to send it through a sort program that is a problem. I propose using the **-s or --size** of bytes, otherwise the default is human readable. 3. The modified column has things like 6 days ago, or 8 weeks ago which is good for humans, but not so good for other things. I propose **-t or --time** in the HH:MM:SS format and **-ts or --seconds** in the total number of seconds format 4. There is no default sorting method. I propose **-o or --order** followed by the column number or negative column number for reverse sorting. 5. Lastly **-h or --help** to show the command options.
Author
Owner

@jpummill commented on GitHub (Jul 24, 2024):

In Linux at least command output is usually in bytes and -h is used for "human readable" or MB/GB type output.

I also would like to see a sort/order option to be able to sort by the various list columns.

Another useful option would be a flag to change the output format. While the table is a good default, it might be helpful to offer other options like JSON, CSV, etc...

<!-- gh-comment-id:2248043279 --> @jpummill commented on GitHub (Jul 24, 2024): In Linux at least command output is usually in bytes and -h is used for "human readable" or MB/GB type output. I also would like to see a sort/order option to be able to sort by the various list columns. Another useful option would be a flag to change the output format. While the table is a good default, it might be helpful to offer other options like JSON, CSV, etc...
Author
Owner

@haydonryan commented on GitHub (Oct 26, 2024):

Came here to post that we need to be able to sort based on name. (I also think modified and size too) in both ascending and descending order.

I'd also like to see a shortcut for list (and other commands) be also added -

ollama l

Seems intuitive imo.

<!-- gh-comment-id:2439729079 --> @haydonryan commented on GitHub (Oct 26, 2024): Came here to post that we need to be able to sort based on name. (I also think modified and size too) in both ascending and descending order. I'd also like to see a shortcut for list (and other commands) be also added - ``` ollama l ``` Seems intuitive imo.
Author
Owner

@pdevine commented on GitHub (Oct 26, 2024):

@haydonryan you can use ollama list | sort to sort by name.

<!-- gh-comment-id:2439748401 --> @pdevine commented on GitHub (Oct 26, 2024): @haydonryan you can use `ollama list | sort` to sort by name.
Author
Owner

@keshavlingala commented on GitHub (Feb 19, 2025):

Came here to post that we need to be able to sort based on name. (I also think modified and size too) in both ascending and descending order.

I'd also like to see a shortcut for list (and other commands) be also added -

ollama l

Seems intuitive imo.

ollama ls

already works as shortcut for ollama list

<!-- gh-comment-id:2669482931 --> @keshavlingala commented on GitHub (Feb 19, 2025): > Came here to post that we need to be able to sort based on name. (I also think modified and size too) in both ascending and descending order. > > I'd also like to see a shortcut for list (and other commands) be also added - > > ``` > ollama l > ``` > > Seems intuitive imo. ```sh ollama ls ``` already works as shortcut for `ollama list`
Author
Owner

@chrico-bu-uab commented on GitHub (Mar 19, 2025):

Being able to sort by size would be really helpful as well.

<!-- gh-comment-id:2736430805 --> @chrico-bu-uab commented on GitHub (Mar 19, 2025): Being able to sort by size would be really helpful as well.
Author
Owner

@pdevine commented on GitHub (Mar 19, 2025):

@chrico-bu-uab to sort by size: ollama list | sort -k 3,3 -n (-k selects the column, -n to sort numerically). As @iplayfast mentioned this won't pick up the human readable sizes which might be nice to add.

<!-- gh-comment-id:2737529857 --> @pdevine commented on GitHub (Mar 19, 2025): @chrico-bu-uab to sort by size: `ollama list | sort -k 3,3 -n` (`-k` selects the column, `-n` to sort numerically). As @iplayfast mentioned this won't pick up the human readable sizes which might be nice to add.
Author
Owner

@rawzone commented on GitHub (Jul 15, 2025):

Would also love to see ollama ls output flags like: Embedding, Vision, Tools, Thinking to easy get an overview of which models have which capabilities.

When you have a lot of models downloaded it makes it hard and at least I have to go to the website to check which models does what.

<!-- gh-comment-id:3072598077 --> @rawzone commented on GitHub (Jul 15, 2025): Would also love to see `ollama ls` output flags like: `Embedding`, `Vision`, `Tools`, `Thinking` to easy get an overview of which models have which capabilities. When you have a lot of models downloaded it makes it hard and at least I have to go to the website to check which models does what.
Author
Owner

@somera commented on GitHub (Aug 22, 2025):

This alias ollama_list_models='ollama list | awk '\''NR==1; NR>1 {print | "sort -k1,1"}'\'' is my alias.

Example output is:

$ ollama_list_models
NAME                              ID              SIZE      MODIFIED
bge-m3:latest                     790764642607    1.2 GB    About a minute ago
deepseek-coder-v2:16b             63fb193b3a9b    8.9 GB    2 minutes ago
deepseek-coder-v2-fixed:latest    18245823b634    8.9 GB    3 months ago
deepseek-r1:32b                   edba8017331d    19 GB     2 minutes ago
devstral:24b                      9bd74193e939    14 GB     About a minute ago
gemma3:27b-it-qat                 29eb0b9aeda3    18 GB     2 minutes ago
gpt-oss:20b                       aa4295ac10c3    13 GB     2 minutes ago
llama2-uncensored:latest          44040b922233    3.8 GB    2 minutes ago
llama3.2:3b                       a80c4f17acd5    2.0 GB    2 minutes ago
llama3.2-vision:11b               6f2f9757ae97    7.8 GB    2 minutes ago
mistral:7b-instruct               6577803aa9a0    4.4 GB    2 minutes ago
mistral-small3.2:24b              5a408ab55df5    15 GB     2 minutes ago
mxbai-embed-large:latest          468836162de7    669 MB    2 minutes ago
nomic-embed-text:latest           0a109f422b47    274 MB    2 minutes ago
phi4:latest                       ac896e5b8b34    9.1 GB    2 minutes ago
phi4-mini:3.8b                    78fad5d182a7    2.5 GB    2 minutes ago
qwen3-coder:30b                   ad67f85ca250    18 GB     2 minutes ago
<!-- gh-comment-id:3213672584 --> @somera commented on GitHub (Aug 22, 2025): This `alias ollama_list_models='ollama list | awk '\''NR==1; NR>1 {print | "sort -k1,1"}'\''` is my alias. Example output is: ``` $ ollama_list_models NAME ID SIZE MODIFIED bge-m3:latest 790764642607 1.2 GB About a minute ago deepseek-coder-v2:16b 63fb193b3a9b 8.9 GB 2 minutes ago deepseek-coder-v2-fixed:latest 18245823b634 8.9 GB 3 months ago deepseek-r1:32b edba8017331d 19 GB 2 minutes ago devstral:24b 9bd74193e939 14 GB About a minute ago gemma3:27b-it-qat 29eb0b9aeda3 18 GB 2 minutes ago gpt-oss:20b aa4295ac10c3 13 GB 2 minutes ago llama2-uncensored:latest 44040b922233 3.8 GB 2 minutes ago llama3.2:3b a80c4f17acd5 2.0 GB 2 minutes ago llama3.2-vision:11b 6f2f9757ae97 7.8 GB 2 minutes ago mistral:7b-instruct 6577803aa9a0 4.4 GB 2 minutes ago mistral-small3.2:24b 5a408ab55df5 15 GB 2 minutes ago mxbai-embed-large:latest 468836162de7 669 MB 2 minutes ago nomic-embed-text:latest 0a109f422b47 274 MB 2 minutes ago phi4:latest ac896e5b8b34 9.1 GB 2 minutes ago phi4-mini:3.8b 78fad5d182a7 2.5 GB 2 minutes ago qwen3-coder:30b ad67f85ca250 18 GB 2 minutes ago ```
Author
Owner

@karmakaze commented on GitHub (Dec 10, 2025):

PR https://github.com/ollama/ollama/pull/13385 adds ls/list option flags, which also shows in ls --help:

List models

Usage:
  ollama list [flags]

Aliases:
  list, ls

Flags:
  -g, --grouped   Group models.
  -h, --help      help for list
  -i, --id        Sort by ID in alphabetical order.
  -U, --name      Sort by name in alphabetical order.
  -r, --reverse   Reverse the sort order.
  -S, --size      Sort by file size, smallest first.
  -t, --time      Sort by date/time, chronologically (default reversed).

Environment Variables:
      OLLAMA_HOST                IP Address for the ollama server (default 127.0.0.1:11434)
<!-- gh-comment-id:3635618911 --> @karmakaze commented on GitHub (Dec 10, 2025): PR https://github.com/ollama/ollama/pull/13385 adds `ls`/`list` option flags, which also shows in `ls --help`: ``` List models Usage: ollama list [flags] Aliases: list, ls Flags: -g, --grouped Group models. -h, --help help for list -i, --id Sort by ID in alphabetical order. -U, --name Sort by name in alphabetical order. -r, --reverse Reverse the sort order. -S, --size Sort by file size, smallest first. -t, --time Sort by date/time, chronologically (default reversed). Environment Variables: OLLAMA_HOST IP Address for the ollama server (default 127.0.0.1:11434) ```
Author
Owner

@bulrush15 commented on GitHub (Jan 24, 2026):

@chrico-bu-uab to sort by size: ollama list | sort -k 3,3 -n (-k selects the column, -n to sort numerically). As @iplayfast mentioned this won't pick up the human readable sizes which might be nice to add.

This does not work for Windows 11. It is for Unix.

<!-- gh-comment-id:3794545090 --> @bulrush15 commented on GitHub (Jan 24, 2026): > [@chrico-bu-uab](https://github.com/chrico-bu-uab) to sort by size: `ollama list | sort -k 3,3 -n` (`-k` selects the column, `-n` to sort numerically). As [@iplayfast](https://github.com/iplayfast) mentioned this won't pick up the human readable sizes which might be nice to add. This does not work for Windows 11. It is for Unix.
Author
Owner

@bulrush15 commented on GitHub (Jan 24, 2026):

Currently for Windows DOS window I use this .bat file to sort the models by name. It's not perfect but it gets me most of the way there:

@echo off

:: 1. Print the header (The row containing 'NAME')

ollama list | findstr "NAME"

:: 2. Print and sort the data (The rows NOT containing 'NAME')

(ollama list | findstr /v "NAME") | sort
<!-- gh-comment-id:3794545817 --> @bulrush15 commented on GitHub (Jan 24, 2026): Currently for Windows DOS window I use this .bat file to sort the models by name. It's not perfect but it gets me most of the way there: ``` @echo off :: 1. Print the header (The row containing 'NAME') ollama list | findstr "NAME" :: 2. Print and sort the data (The rows NOT containing 'NAME') (ollama list | findstr /v "NAME") | sort ```
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/ollama#26834