# select

*noun*

say it: **“suh-LEKT”** **/səˈlɛkt/**

A bash command that shows a numbered menu of choices and stores the one the user picks.

## What does **select** do in bash?

`select` turns a list of words into a numbered menu. The person types a number, the chosen word goes into the variable, and the lines between `do` and `done` run. `PS3` sets the question, and `break` ends the menu after one choice.

```bash
PS3="Back up which file? "
select file in *.txt; do
  ./backup.sh "$file"
  break
done
```

## In a sentence

- “With **select**, the script lists the .txt files as a numbered menu.”
- “Sam typed 4 at the **select** menu, and the script backed up that file.”

Level: Apprentice · [More Unix terms at this level](https://www.ask-codey.com/glossary?category=unix&level=2)

Updated: November 10, 2026

## In other subjects

- [SELECT in SQL](https://www.ask-codey.com/glossary/select-database)

Source: https://www.ask-codey.com/glossary/select-unix
