Bash-Insulter:一个在输入错误命令时嘲讽用户的脚本
创始人
2024-03-02 02:03:26
0

这是一个非常有趣的脚本,每当用户在终端输入错误的命令时,它都会嘲讽用户。

它让你在解决一些问题时会感到快乐。有的人在受到终端嘲讽的时候感到不愉快。但是,当我受到终端的批评时,我真的很开心。

这是一个有趣的 CLI 工具,在你弄错的时候,会用随机短语嘲讽你。此外,它允许你添加自己的短语。

如何在 Linux 上安装 Bash-Insulter?

在安装 Bash-Insulter 之前,请确保你的系统上安装了 git。如果没有,请使用以下命令安装它。

对于 Fedora 系统, 请使用 DNF 命令 安装 git。

$ sudo dnf install git

对于 Debian/Ubuntu 系统,请使用 APT-GET 命令 或者 APT 命令 安装 git。

$ sudo apt install git

对于基于 Arch Linux 的系统,请使用 Pacman 命令 安装 git。

$ sudo pacman -S git

对于 RHEL/CentOS 系统,请使用 YUM 命令 安装 git。

$ sudo yum install git

对于 openSUSE Leap 系统,请使用 Zypper 命令 安装 git。

$ sudo zypper install git

我们可以通过 克隆 clone 开发人员的 GitHub 存储库轻松地安装它。

首先克隆 Bash-insulter 存储库。

$ git clone https://github.com/hkbakke/bash-insulter.git bash-insulter

将下载的文件移动到文件夹 /etc 下。

$ sudo cp bash-insulter/src/bash.command-not-found /etc/

将下面的代码添加到 /etc/bash.bashrc 文件中。

$ vi /etc/bash.bashrc

#Bash Insulter
if [ -f /etc/bash.command-not-found ]; then
 . /etc/bash.command-not-found
fi

运行以下命令使更改生效。

$ sudo source /etc/bash.bashrc

你想测试一下安装是否生效吗?你可以试试在终端上输入一些错误的命令,看看它如何嘲讽你。

$ unam -a

$ pin 2daygeek.com

如果你想附加你自己的短语,则导航到以下文件并更新它。你可以在 messages 部分中添加短语。

# vi /etc/bash.command-not-found

print_message () {

    local messages
    local message

    messages=(
        "Boooo!"
        "Don't you know anything?"
        "RTFM!"
        "Haha, n00b!"
        "Wow! That was impressively wrong!"
        "Pathetic"
        "The worst one today!"
        "n00b alert!"
        "Your application for reduced salary has been sent!"
        "lol"
        "u suk"
        "lol... plz"
        "plz uninstall"
        "And the Darwin Award goes to.... ${USER}!"
        "ERROR_INCOMPETENT_USER"
        "Incompetence is also a form of competence"
        "Bad."
        "Fake it till you make it!"
        "What is this...? Amateur hour!?"
        "Come on! You can do it!"
        "Nice try."
        "What if... you type an actual command the next time!"
        "What if I told you... it is possible to type valid commands."
        "Y u no speak computer???"
        "This is not Windows"
        "Perhaps you should leave the command line alone..."
        "Please step away from the keyboard!"
        "error code: 1D10T"
        "ACHTUNG! ALLES TURISTEN UND NONTEKNISCHEN LOOKENPEEPERS! DAS KOMPUTERMASCHINE IST NICHT FÜR DER GEFINGERPOKEN UND MITTENGRABEN! ODERWISE IST EASY TO SCHNAPPEN DER SPRINGENWERK, BLOWENFUSEN UND POPPENCORKEN MIT SPITZENSPARKEN. IST NICHT FÜR GEWERKEN BEI DUMMKOPFEN. DER RUBBERNECKEN SIGHTSEEREN KEEPEN DAS COTTONPICKEN HÄNDER IN DAS POCKETS MUSS. ZO RELAXEN UND WATSCHEN DER BLINKENLICHTEN."
        "Pro tip: type a valid command!"
        "Go outside."
        "This is not a search engine."
        "(╯°□°)╯︵ ┻━┻"
        "¯\_(ツ)_/¯"
        "So, I'm just going to go ahead and run rm -rf / for you."
        "Why are you so stupid?!"
        "Perhaps computers is not for you..."
        "Why are you doing this to me?!"
        "Don't you have anything better to do?!"
        "I am _seriously_ considering 'rm -rf /'-ing myself..."
        "This is why you get to see your children only once a month."
        "This is why nobody likes you."
        "Are you even trying?!"
        "Try using your brain the next time!"
        "My keyboard is not a touch screen!"
        "Commands, random gibberish, who cares!"
        "Typing incorrect commands, eh?"
        "Are you always this stupid or are you making a special effort today?!"
        "Dropped on your head as a baby, eh?"
        "Brains aren't everything. In your case they're nothing."
        "I don't know what makes you so stupid, but it really works."
        "You are not as bad as people say, you are much, much worse."
        "Two wrongs don't make a right, take your parents as an example."
        "You must have been born on a highway because that's where most accidents happen."
        "If what you don't know can't hurt you, you're invulnerable."
        "If ignorance is bliss, you must be the happiest person on earth."
        "You're proof that god has a sense of humor."
        "Keep trying, someday you'll do something intelligent!"
        "If shit was music, you'd be an orchestra."
        "How many times do I have to flush before you go away?"
    )

via: https://www.2daygeek.com/bash-insulter-insults-the-user-when-typing-wrong-command/

作者:Magesh Maruthamuthu 选题:lujun9972 译者:zero-mk 校对:wxy

本文由 LCTT 原创编译,Linux中国 荣誉推出

相关内容

如何查看CentOS系统中...
掌控你的系统核心:CentOS查看CPU与内存信息指南 作为服务器...
2025-06-03 07:40:48
【云原生】k8s集群命令行...
kubectl应用部署命令详解一、准备工作1.1、Replicat...
2025-06-01 06:37:18
Raspbian命令行安装...
Raspbian命令行安装desktop界面1. 源由 & 介绍1...
2025-05-28 14:03:46
微软开源 Edit 命令行...
IT之家 5 月 20 日消息,微软昨日(5 月 19 日)发布博...
2025-05-20 08:16:36
CentOS Bash S...
CentOS Bash Shell:从入门到高效操作的全面指南 B...
2025-05-09 06:17:17
在CentOS系统执行纯文...
对于需要在服务器或低配置设备上部署操作系统的用户来说,选择文本模式...
2025-04-21 06:17:42

热门资讯

Helix:高级 Linux ... 说到 基于终端的文本编辑器,通常 Vim、Emacs 和 Nano 受到了关注。这并不意味着没有其他...
使用 KRAWL 扫描 Kub... 用 KRAWL 脚本来识别 Kubernetes Pod 和容器中的错误。当你使用 Kubernet...
JStock:Linux 上不... 如果你在股票市场做投资,那么你可能非常清楚投资组合管理计划有多重要。管理投资组合的目标是依据你能承受...
通过 SaltStack 管理... 我在搜索Puppet的替代品时,偶然间碰到了Salt。我喜欢puppet,但是我又爱上Salt了:)...
Epic 游戏商店现在可在 S... 现在可以在 Steam Deck 上运行 Epic 游戏商店了,几乎无懈可击! 但是,它是非官方的。...
《Apex 英雄》正式可在 S... 《Apex 英雄》现已通过 Steam Deck 验证,这使其成为支持 Linux 的顶级多人游戏之...
如何在 Github 上创建一... 学习如何复刻一个仓库,进行更改,并要求维护人员审查并合并它。你知道如何使用 git 了,你有一个 G...
2024 开年,LLUG 和你... Hi,Linuxer,2024 新年伊始,不知道你是否已经准备好迎接新的一年~ 2024 年,Lin...
什么是 KDE Connect... 什么是 KDE Connect?它的主要特性是什么?它应该如何安装?本文提供了基本的使用指南。科技日...
Opera 浏览器内置的 VP... 昨天我们报道过 Opera 浏览器内置了 VPN 服务,用户打开它可以防止他们的在线活动被窥视。不过...