wiki-js/sysadmin/bash/bash-completion.html

21 lines
1.4 KiB
HTML
Raw Blame History

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

<!--
title: bash-completion автодополнение
description:
published: true
date: 2023-11-07T17:55:09.825Z
tags: bash, linux
editor: ckeditor
dateCreated: 2023-11-03T08:47:49.396Z
-->
<h3>Устанавливаем из официальных репозиториев</h3>
<pre><code class="language-plaintext">apt install bash-completion</code></pre>
<p>&nbsp;</p>
<h5><strong>Настройка автозаполнения Bash</strong></h5>
<p>Если все прошло успешно, то у вас должен появится файл <code><strong>bash_completion.sh</strong></code>. Он расположен в <code><strong>/etc/profile.d/</strong></code>&nbsp;</p>
<p>Чтобы убедиться в этом, выполните эту команду.</p>
<figure class="image"><img src="/image.png"></figure>
<p>Чтобы применить изменения и тем самым включить желаемое автозаполнение, нам требуется добавить несколько вещей в <code><strong>~/.bashrc</strong></code>.</p>
<p>Мы можем либо скопировать содержимое скрипта в конец упомянутого файла, либо просто перенести его в файл.</p>
<pre><code class="language-plaintext">echo "source /etc/profile.d/bash_completion.sh" &gt;&gt; ~/.bashrc</code></pre>