> For the complete documentation index, see [llms.txt](https://johnpion.gitbook.io/admin-sky-blog/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://johnpion.gitbook.io/admin-sky-blog/linux/sort_by_column.md).

# sort by column

Sometimes you might need to sort a list, not by the first column, but by any other column:

```shell
sort -t : -k 3
```

This command will sort the list based on the third column. The "-t" flag specifies ":" as the field separator, and "-k" indicates which column to sort by.
