# Getopt in Bash

DevFeed: [Getopt in Bash](<https://devfeed.tech/articles/getopt-in-bash-40693.md>)

Original publisher: [Read original article](<https://radek.io/posts/getopt-in-bash/>)

Published: 2011-07-14T00:00:00Z

Content type: tutorial

Language: en

Sources: [Radek Pazdera](<https://devfeed.tech/sources/radek-pazdera.md>)

Topics: [Bash](<https://devfeed.tech/topics/bash.md>), [Command-line interface](<https://devfeed.tech/topics/cli.md>), [Scripting, bash](<https://devfeed.tech/topics/scripting-bash.md>), [Parsing](<https://devfeed.tech/topics/parsing.md>), [Script](<https://devfeed.tech/topics/script.md>)

Tags: [bash](<https://devfeed.tech/tags/bash.md>), [cli](<https://devfeed.tech/tags/cli.md>), [command](<https://devfeed.tech/tags/command.md>), [command-line](<https://devfeed.tech/tags/command-line.md>), [how-to](<https://devfeed.tech/tags/how-to.md>), [parsing](<https://devfeed.tech/tags/parsing.md>), [scripts](<https://devfeed.tech/tags/scripts.md>)

## AI overview

This tutorial explains two ways to parse command-line arguments in Bash: the external getopt utility and the built-in getopts tool. It compares their capabilities, including support for long options, shell compatibility, and ease of use.

## Source excerpt

How to parse CLI arguments in bash scripts