解决 ubuntu apt-get TAB 键不能自动补全

2023-11-17

Add Bash Completion In Debian

ash completion is a useful tool for completion of file paths, commands etc. By default it is enabled on Ubuntu but not on Debian. With two simple steps it can also be enabled on Debian.

1. Install bash-completion

First of all we need the install the according package:

apt-get install bash-completion

2. Add it to the bash profile

Either edit the ~/.bash_profile file to enable it only for a given user or edit /etc/profile to add it system-wide. Add the following code:
if [ -f /etc/bash_completion ]; then
. /etc/bash_completion
fi
3. Try it

In order for it to work you have to log out and relogin and then you can make use of bash completion the usual way. E.g. issue:
apt-g

and then press the TAB key once and the command will be completed to apt-get. Or issue this:
apt

and then press TAB key twice. You can also try with
apt-get install apa

and then press TAB key once to complete as far as possible and a second time to list all options.

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

解决 ubuntu apt-get TAB 键不能自动补全 的相关文章

  • ubuntu 的 CSS 更少(并且自动编译)? [关闭]

    很难说出这里问的是什么 这个问题是含糊的 模糊的 不完整的 过于宽泛的或修辞性的 无法以目前的形式得到合理的回答 如需帮助澄清此问题以便重新打开 访问帮助中心 help reopen questions 我尝试过 simples 但现在 l
  • Rstudio 更有意义的窗口标题

    我在 Ubuntu 16 04 下使用 R studio 版本 1 0 143 窗口标题仅显示一个非常无信息的 RStudio 我希望至少有当前选项卡的名称 或者最好是与此选项卡对应的文件的完整路径 在 Windows 下 完整路径似乎出现
  • Bash 和双引号传递给 argv

    我重新设计了这个示例以使其简单 但我想做的是在 bash shell 执行它时获取一个嵌套双引号字符串作为单个 argv 值 这是脚本示例 set x command1 key1 value1 key2 value2 key3 value3
  • dpkg 错误:pycompile:未找到

    sudo apt get remove purge mysql server mysql client mysql common 当我尝试使用上述命令删除 mysql 时 出现以下错误 Reading package lists Done
  • 使用 grep 查找所有匹配的模式

    In txt1 S01A1P2 S01A1P5 S01A1P4 In txt2 data train wave S01A1P3 mfc data train wave S01A1P7 mfc data train wave S01A1P8
  • OpenSSL 未签名证书静默

    遇到了麻烦 还有其他一些相关的帖子 但没有那么具体 我正在尝试为开发机器默默地生成证书 这些是我最初运行的命令 但被要求输入密码 openssl genrsa des3 out server key 1024 openssl req new
  • “检测到堆栈粉碎”消息打印到哪个流?

    考虑以下非常基本的程序 它在此处以多种形式出现在其他问题上 include
  • iCloud Drive 内用户选择的文件夹内的垃圾文件

    我的应用程序可在任何用户选择的文件夹内处理用户 txt 文件 创建 更改 删 除 我只是在内部存储书签以访问用户选择的文件夹和文件 现在 在 macOS Catalina 中 当源文件夹位于 iCloud Drive 内时 系统仍然允许我创
  • 不要将变量内容视为 sed 中的特殊字符

    我有以下内容sed命令 sed i 4i CHANGES CHANGELOG rst 然而 我的 CHANGES变量看起来像这样 title list elem elem 因此 上述命令失败并出现以下错误 sed e expression
  • Grep 递归和计数

    需要在具有大量子目录的目录中搜索文件内的字符串 我在用着 grep c r string here 我怎样才能找到总数量 如何仅输出至少具有一个实例的文件 使用 Bash 的进程替换 这给出了我认为是您想要的输出 如果不是 请澄清问题 gr
  • Bash 字符串之间的比较 - 相等但不相等

    我只想在 Bash 中的两个字符串之间进行非常简单的比较 stat curl Is url head n 1 echo stat if stat HTTP 1 1 200 OK then echo symbol is OK echo sta
  • 发布到列表 MVC3

    我试图让我的视图将列表发布回操作 但它始终为空 所以我的模型有一个 WeightEntry 对象列表 运动模型 public class Exercise public List
  • 嵌套 NumPy 数组并使用拆分等方法

    我是 NumPy 的新手 正在尝试在我的代码中使用它来处理某些表 我有一个如下所示的坐标列表 coordinates 2 0 0 1 3 4 并想这样写 coordinatesNumpy np array 2 0 0 1 3 4 在常规 P
  • 请检查 PPA 名称或格式是否正确

    在我的 Ubuntu 14 04 中 我尝试安装 Captiva 图标包 如上所列这个 omgubuntu 帖子 http www omgubuntu co uk 2014 09 4 gorgeous linux icon themes d
  • Bash touch - 非法选项 -d

    昨天我拍了很多照片 但我忘记更改相机中的时区 现在所有图片的修改日期都有错误 我想将特定目录中所有文件的修改日期更改为minus 10 hours bin sh for i in Users slick Desktop 100D5200 d
  • c 使用 lseek 以相反顺序复制文件

    我已经知道如何从一开始就将一个文件复制到另一个文件 但是我如何修改程序以按相反的顺序复制它 源文件应具有读取访问权限 目标文件应具有读写执行权限 我必须使用文件控制库 例如 FILE A File B should be ABCDEF FE
  • 如何获取列表的最后一个索引?

    假设我有以下列表 list1 1 2 33 51 indices 0 1 2 3 如何获取该列表的最后一个索引 在本例中为 3 len list1 1绝对是可行的方法 但如果您绝对需要list具有返回最后一个索引的函数 您可以创建一个继承自
  • 在 ubuntu 中找不到 .android 文件夹 [关闭]

    Closed 这个问题不符合堆栈溢出指南 help closed questions 目前不接受答案 我在哪里可以找到 android在 Ubuntu 中 我想使用debug keystore 转到您的主文件夹并按 ctrl h 瞧
  • 向前和向后迭代

    我们有一个双端结构列表 例如LinkedList 我需要向前和向后迭代元素 例如 向前 4 次 然后向后 2 次 然后向前 5 次 在 C 中它将是 iter iter iter 在 Rust 中 我只看到 next and rev 这很不
  • 将 bash 提示符下的当前命令复制到剪贴板

    我想要一个快速的键盘命令序列 将 bash 提示符处的当前命令复制到剪贴板 例如 要将最后一个 bash 命令复制到剪贴板 我会按 up some command sequence 复制它 或者 例如 要在 bash 历史记录中搜索命令 我

随机推荐