bash-insulter

Insults the user when typing wrong command
授权协议 MIT License
开发语言 SHELL
所属分类 应用工具、 终端/远程登录
软件类型 开源软件
地区 不详
投 递 者 杜俊远
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

bash-insulter

Randomly insults the user when typing wrong command.

Change insults as needed :)

noob@bender:~ $ sl

  Y u no speak computer???

-bash: sl: command not found
noob@bender:~ $ gti status

  This is why nobody likes you.

-bash: gti: command not found
noob@bender:~ $ sp aux

  Go outside.

-bash: sp: command not found

Compatibility

  • Bash v4 and newer
  • Zsh

Installation

# Method 1 - know what you are doing
git clone https://github.com/hkbakke/bash-insulter.git bash-insulter
sudo cp bash-insulter/src/bash.command-not-found /etc/

# Method 2 - I don't care, insult me!
sudo wget -O /etc/bash.command-not-found https://raw.githubusercontent.com/hkbakke/bash-insulter/master/src/bash.command-not-found

Then source the file automatically for new logins by adding the following to /etc/bash.bashrc or any of the other locations where you can configure your shell automatically during login:

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

Login again and type some invalid commands for the effects to be visible.

Note: You will have to add the script to .zshrc if you are using zsh

Configuration

bash-insulter can be customized, or even be made polite and nice, by populating CMD_NOT_FOUND_MSGS or CMD_NOT_FOUND_MSGS_APPEND environment variables. The values should be arrays. CMD_NOT_FOUND_MSGS replaces the default messages, while CMD_NOT_FOUND_MSGS_APPEND appends more messages to the existing ones.

It is probably cleanest to source a file populating the environment variable as needed. In this example I create a file /etc/bash.command-not-found-messages with the following content:

CMD_NOT_FOUND_MSGS=(
    "You are so smart!"
    "You look pretty today!"
    "I don't know what to say"
)

Then source this file before you source the script:

if [ -f /etc/bash.command-not-found-messages ]; then
    . /etc/bash.command-not-found-messages
fi

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

Then logout and in again. The end result is that you will now use your messages instead of the default ones.

  • linux下的shell命令学习笔记007 # --------------------------------------- # alias # (举例就不用了,太常用了) # unalias # # --------------------------------------- # history  # -c #将目前shell中的所有History清除 # -w #将当前shell中的his

  •    /etc/profile:此文件为系统的每个用户设置环境信息,当用户第一次登录时,该文件被执行. 并从/etc/profile.d目录的配置文件中搜集shell的设置. /etc/bashrc:为每一个运行bash shell的用户执行此文件.当bash shell被打开时,该文件被读取. ~/.bash_profile:每个用户都可使用该文件输入专用于自己使用的shell信息,当用户登录时

  • shell managar计算机硬件的是 操作系统的核心(kernel) 通过shell跟核心沟通 1. what is shell? case. music 1.硬件:声卡 2.核心管理:声卡芯片的驱动程序 3.应用程序:user输入指令 shell桥 指令 and 核心 文字接口的shell 1.各家distribution一个样 2.远程管理

  •   自动打开多个窗口命令: 一个terminal窗口里打开两个Tab,-t是title,-t在window/tab前或后,貌似都行,需要再研究: gnome-terminal -t "xx" -t "xx" --window  --tab -t "xx" 打开两个独立的terminal窗口: gnome-terminal -t "xx" --window  --window   bsub的调用:

  • 我的/root/.bashrc alias apache_start='cd /etc/init.d && ./httpd start' alias apache_stop='cd /etc/ini.d && ./httpd stop' alias apache_restart='apache_stop && apache_start'   别人的作为参考: # .bashrc # User sp

  • Bash 命令 前言Shell有很多内置在其源代码中的命令。这些命令是内置的,所以Shell不必到磁盘上搜索它们,执行速度因此加快。不同的Shell内置命令有所不同。 内置命令包含在 bash shell 本身里面。我该如何在 Linux / Apple OS X / *BSD / Unix 类操作系统列出所有的内置 bash 命令,而不用去读大篇的 bash 操作说明页? shell 内置命令就

  • 翻译自《Bash Guid for Beginners》@2008,www.tldp.org/guides.html UNIX 的shell程序解释执行用户命令,这些命令或者是用户直接输入的命令,或者是shell程序从一个被称为shell脚本的文件/程序读取的命令。shell脚本是直接解释执行的,而不会进行编译。shell程序从脚本文件读取命令(每次一行),然后在系统中搜索这些命令,这些搜索到的命

  • 出处 https://agoop.slack.com/apps/new/A0F7XDUAZ--incoming-webhook- https://qiita.com/tt2004d/items/50d79d1569c0ace118d6 bash webhooks.sh #!/bin/sh set -eu #Incoming WebHooksのURL WEBHOOKURL="ここにIncomin

  • bash是shell的一种,所谓的shell(壳)是一个接口,这个接口提供给用户操纵系统的能力,广义的shell包括图形界面和命令行界面,狭义的shell是指命令行界面的接口,这里的bash就是一种狭义的shell。Shell可以调用其他的程序,也可以执行一些自己本身支持的命令。 bash是Bourne Again Shell的简称,是Linux的默认shell。系统一般会提供多个可用的shell

  • $( ) 的用途和反引号``一样,用来表示优先执行命令,比如ls -l $(locate build.xml),表示优先找到build.xml然后再列出详细的信息。 ${ } 就是取到变量了,比如echo $(PATH),打印出变量PATH的值. $ basename --help可以查看basename的用法. 该命令的用法为显示文件名: 为basename指定一个路径,basename命令会删

  • #!/bin/sh ##!/usr/bin/env bash 改写文件 如果你刚刚创建了一个文件,比如touch a.txt,a 里面现在是空的。你想要往里面加上一句话,怎么操作。你可以打开文件,用 vim,用 atom 都可以。但你要可以用 shell 命令直接插入一句话。 echo 'I want to instert a sentence' > a.txt 这里面的意思是,把 echo 的返

  • 1、shell 在Unix/Linux操作系统中,shell俗称壳,区别于kernel内核。shell有双重功能,一方面,shell是一个命令解释器,用于处理shell内置的命令或者用户自定义的命令,可以在shell终端与用户交互,等待用户输入一个命令或者一串命令,然后以用户指定的方式执行命令;另一方面,shell是一种程序设计语言,更确切地说是一种脚本语言,一种解释型语言,类似于Python,有

  • find . -name "dest_file" | xargs perl -pi -e "s|str_src|str_replaced|g" 查找当前目录所有名字为dest_file的文件,把其中所有str_src替换为str_replaced shopt -s cdspell 让bash自动纠正cd命令的错误路径输入

 相关资料
  • 好了,现在我们换了一个遥控器,感觉顺手多了。现在来操练一下,下载一首 mp3: 我们使用 wget 这个程序,它非常可靠,完全值得您信赖。 首先找到一个可以下载的地址,复制链接,在终端窗口内点击鼠标中键,把它粘贴进去。 现在终端中大概是这种情形: http://linuxtoy.org/xxx.mp3 按下 Ctrl+a 组合键,我们发现光标移动到了行首。输入 wget 和 空格 wget ht

  • 语法 基本语法 名称 语法 描述 示例 interpreter #!/bin/bash Bash shell 脚本的第一行以 #! 开头,通常也称为 sharp-bang 或缩写版本 sha-bang。后面的路径名称是命令解释器,也就是应该用于执行脚本的程序。 echo echo "arbitrary text" echo "arbitrary text" >&2 文本定向到标准输出 (STDOU

  • bash 是一个为GNU项目编写的Unix shell。它的名字是一系列缩写:Bourne-Again SHell — 这是关于Bourne shell(sh)的一个双关语(Bourne again / born again)。Bourne shell是一个早期的重要shell,由Stephen Bourne在1978年前后编写,并同Version 7 Unix一起发布。bash则在1987年由B

  • Bash++ 是一个将 bash 提升到一个新水平的框架,为 bash 引入了新功能。它的设计是为了让人们能够建立更复杂的应用程序,创造更好的产品。 请注意,这个项目是为有 bash 经验的人准备的(不多,只是简单的理解和事情通常如何运作)。 运行示例 (确保你已经安装bash++) cd 进入示例目录。 对你想运行的脚本进行chmod。 chmod +x [SCRIPT.sh] 运行该脚本 ./[SCRIPT].sh

  • Bash-it 是一款针对bash使用进行优化的软件,提供了终端显示的主题优化、命令补全、命令别名、插件、版本控制目录状态实时显示等实用功能,能让bash更好用!正如软件readme说的那样,本款软件是模仿 http://www.oschina.net/p/oh-my-zsh 的,只不过是使用在bash环境中。 安装本软件需要有bash(这个大多数类Unix系统都具备)、git(如果下载zip包也

  • Bash-Snippets 这个项目完全是为重度终端用户而生的,里面包含了大量的 Bash 脚本,而且无需任何依赖。 示例: Crypt 封装了 openssl,可用于快速加密和解密文件 crypt -e [original file] [encrypted file] # encrypts filescrypt -d [encrypted file] [output file] # decryp

  • 黑客对linux发展贡献是非常多的。Bash命令自动完成功能只不过是收集各种黑客指定参数是如何通过Readline使用内置完成来完成的。该功能在其他linux分支是启用的,如ubuntu、debian等等。然而,基于RHCE分支发布的linux版本却没有安装和启用,如CentOS。 如果你使用过ubuntu系统,bash命令自动补齐会觉得非常方便高效。再使用RHCE或CentOS的话,你肯定会吐槽

  • bash-handbook This document is written for those who want to learn Bash without diving in too deeply. Tip: Try learnyoubash — an interactive workshopper based on this handbook! Node Packaged Manuscrip