{"id":2000,"date":"2025-06-18T13:57:46","date_gmt":"2023-10-25T17:11:15","guid":{"rendered":""},"modified":"2025-02-02T00:46:17","modified_gmt":"2025-02-01T23:46:17","slug":"how-to-add-bash-completion-in-debian","status":"publish","type":"post","link":"https:\/\/netcloud24.com\/knowledgebase\/how-to-add-bash-completion-in-debian\/","title":{"rendered":"How To Add Bash Completion In Debian"},"content":{"rendered":"<p>\u00a0<\/p>\n<\/p>\n<header>\n<h1>\u00a0<\/h1>\n<\/header>\n<section>\n<p><strong>Bash completion<\/strong> is a feature that provides command-line autocompletion for bash commands, options, and file names, making terminal usage faster and more efficient. It\u2019s particularly useful for administrators managing servers, such as those hosted on a <strong>VPS server<\/strong>. In this guide, we will walk you through how to add bash completion on Debian.<\/p>\n<h2>Step 1: Update Your System<\/h2>\n<p>Before installing bash completion, it&#8217;s a good idea to ensure your Debian system is up to date. Run the following commands to update your package list and install any available updates:<\/p>\n<pre><code>sudo apt update &amp;&amp; sudo apt upgrade -y<\/code><\/pre>\n<h2>Step 2: Install Bash Completion<\/h2>\n<p>Bash completion may not be installed by default on your system. To install it, simply run the following command:<\/p>\n<pre><code>sudo apt install bash-completion -y<\/code><\/pre>\n<p>Once installed, bash completion should be automatically enabled. However, you can ensure that it&#8217;s loaded by editing the <code>.bashrc<\/code> file in your home directory.<\/p>\n<h2>Step 3: Enable Bash Completion<\/h2>\n<p>To enable bash completion, open your <code>.bashrc<\/code> file:<\/p>\n<pre><code>nano ~\/.bashrc<\/code><\/pre>\n<p>Look for the following lines, and if they are commented out (starting with a <code>#<\/code>), remove the <code>#<\/code> to uncomment them:<\/p>\n<pre><code>\r\n# enable bash completion in interactive shells\r\nif ! shopt -oq posix; then\r\n  if [ -f \/usr\/share\/bash-completion\/bash_completion ]; then\r\n    . \/usr\/share\/bash-completion\/bash_completion\r\n  elif [ -f \/etc\/bash_completion ]; then\r\n    . \/etc\/bash_completion\r\n  fi\r\nfi\r\n        <\/code><\/pre>\n<p>Save the file and exit the text editor. To apply the changes, either log out and log back in, or run the following command:<\/p>\n<pre><code>source ~\/.bashrc<\/code><\/pre>\n<h2>Step 4: Test Bash Completion<\/h2>\n<p>Now that bash completion is installed and enabled, you can test it by typing the beginning of a command and pressing <code>Tab<\/code> to see if the shell autocompletes the command or shows suggestions. For example, type <code>sudo ap<\/code> and press <code>Tab<\/code>\u2014it should complete the command to <code>sudo apt<\/code>.<\/p>\n<h2>Step 5: Add Bash Completion for Specific Programs<\/h2>\n<p>Some programs and scripts support bash completion but do not enable it by default. You can manually add bash completion for specific commands by downloading the completion script and sourcing it in your <code>.bashrc<\/code> file.<\/p>\n<p>For example, to enable git completion, download the completion script and source it:<\/p>\n<pre><code>\r\nwget https:\/\/raw.githubusercontent.com\/git\/git\/master\/contrib\/completion\/git-completion.bash -O ~\/.git-completion.bash\r\necho \"source ~\/.git-completion.bash\" &gt;&gt; ~\/.bashrc\r\nsource ~\/.bashrc\r\n        <\/code><\/pre>\n<p>You can do this for many other programs that support custom bash completions.<\/p>\n<h2>Running Bash Completion on a VPS Server<\/h2>\n<p>When managing a <strong>VPS server<\/strong>, having bash completion enabled significantly speeds up administrative tasks, such as managing packages, configuring services, or running scripts. It reduces typing errors and helps administrators navigate commands more efficiently on their VPS environment.<\/p>\n<h2>Looking for a Reliable VPS Solution?<\/h2>\n<p>If you&#8217;re looking for a reliable and scalable <strong>VPS server<\/strong> to run your projects or manage server tasks efficiently, consider using . With <strong>Windows VPS<\/strong>, you get high-performance VPS hosting with full control over your server, making it perfect for developers, sysadmins, and businesses alike.<\/p>\n<footer>\n<p>For more VPS server solutions and guides, visit <a href=\"https:\/\/ie.netcloud24.com\" target=\"_blank\" rel=\"follow\">netcloud24.com<\/a>.<\/p>\n<\/footer>\n<\/section>\n<div class=\"post-author-box\" style=\"border-top:1px solid #ddd;margin-top:20px;padding-top:15px;\">\n<p><strong>Author:<\/strong> \u0141ukasz Bodziony<\/p>\n<p><strong>Website:<\/strong> <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a><\/p>\n<p><em>\u0141ukasz Bodziony is the CEO and founder of <a href=\"https:\/\/netcloud24.com\" target=\"_blank\" rel=\"dofollow\">NETCLOUD24<\/a>, a global VPS hosting brand proudly originating from Poland. With extensive experience in cloud computing, virtualization, and server management, he delivers high-performance <strong>Windows VPS<\/strong> and <strong>Remote Desktop Services (RDS)<\/strong> solutions to clients across Europe, North America, and beyond.<\/em><\/p>\n<p><em>His expertise covers a wide range of technologies, including <strong>Microsoft Azure<\/strong>, <strong>Proxmox VE<\/strong>, <strong>Amazon Web Services (AWS)<\/strong>, and numerous other virtualization and cloud platforms.<\/em><\/p>\n<p><em>Beyond running his hosting business, \u0141ukasz also provides <strong>professional paid server configuration and optimization services<\/strong> for companies and individuals. Outside of work, he is dedicated to caring for his children and building a secure future for them.<\/em><\/p>\n<p><em>If you are interested in working with him or need expert assistance with your hosting, cloud environment, or server setup, feel free to reach out via <a href=\"https:\/\/ca.netcloud24.com\" target=\"_blank\" rel=\"dofollow\">Windows VPS<\/a>.<\/em><\/p>\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u00a0 Bash completion is a feature that provides command-line autocompletion for bash commands, options, and file names, making terminal usage faster and more efficient. It\u2019s particularly useful\u2026<\/p>\n","protected":false},"author":1,"featured_media":3421,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_seopress_robots_primary_cat":"","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[],"tags":[14,12,11,23,20,21,22,17,7,8,6,10,18,19,15,24,16,5,13,9],"class_list":["post-2000","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","tag-cheapvps","tag-cloudvps","tag-hostingvps","tag-rds","tag-rdscal","tag-remotedesktop","tag-remotedesktopvps","tag-servervps","tag-ukvps","tag-virtualserver","tag-vpshosting","tag-vpsserver","tag-vpssolutions","tag-vpswindows","tag-vpswithwindows","tag-windowsrds","tag-windowsserver","tag-windowsvps","tag-windowsvpshosting","tag-windowsvpsuk"],"jetpack_publicize_connections":[],"_links":{"self":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2000","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/comments?post=2000"}],"version-history":[{"count":0,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/posts\/2000\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media\/3421"}],"wp:attachment":[{"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/media?parent=2000"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/categories?post=2000"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netcloud24.com\/knowledgebase\/wp-json\/wp\/v2\/tags?post=2000"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}