---
title: "Auto Completion in Bash for Maven"
description: "Step 1 : Check if bashcompletion in enabled in your .bashrc. Step 2 : Add the file attached to /etc/bashcompletion.d/m2."
url: "https://h3manth.com/scribe/auto-completion-bash-maven/"
canonical_url: "https://h3manth.com/scribe/auto-completion-bash-maven/"
markdown_url: "https://h3manth.com/scribe/blog/auto-completion-bash-maven.md"
publishDate: "2009-12-24T00:00:00.000Z"
author: "Hemanth HM"
category: "linux"
tags: ["bash"]
word_count: 55
reading_time_minutes: 1
x_markdown_tokens: 183
content_signal: "ai-train=yes, search=yes, ai-input=yes"
---

# Auto Completion in Bash for Maven

> Step 1 : Check if bashcompletion in enabled in your .bashrc. Step 2 : Add the file attached to /etc/bashcompletion.d/m2.

**Step 1** : Check if bash_completion in enabled in your .bashrc. **Step 2** : Add the file attached to /etc/bash_completion.d/m2. Step 3 : Enjoy auto-completion for Maven.

_The Code Lines :**complete -F _m2_complete -o filenames mvn_** Indicates to apply m2_complete for command following mvn **compgen** Generate possible completion matches for word according to the options._
