Bash-Utils

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

Bash Utils (miscellaneous small utils for the Bash shell)

New (Jan 9, 2017)! All scripts were updated to Python 3. The original Python 2 version (which is not maintained anymore) is tagged as "v0.1". You can find thatunder the "release" link.

Here I collect some small command-line utils.

dictionary/meaning.py

  • Look up the meaning of a word.
  • Usage: meaning pen
  • Meaning: what does the word pen mean?

dropbox/dropbox_permissions.py

  • Set directory/file permissions in your Dropbox folder in an intelligent way.
  • Intended audience: Linux users who also use Windows sometimes.
  • Usage: put the script in the root of your Dropbox folder and launch it.
  • blog post

dropbox/get_public_link.py

  • Show the public Dropbox link(s) of one (or several) file(s).
  • Dropbox made some changes in 2017, so it doesn't work anymore.
  • Usage: get_public_link [<file> | -a]
  • blog post

firefox/export_firefox_cookies.py

  • This script extracts cookies from Firefox's cookies.sqlite that are specific to a given host. The exported cookies are saved in cookies.txt. New! It also exports session cookies from Firefox's recovery.js file.The exported cookies are saved to session_cookies.txt.
  • The original script was written by Dirk Sohler.
  • Usage: export_firefox_cookies.py <host>
  • blog post

mouse/mousepos_gui.py

radio/radio.py

  • A minimalistic radio player.
  • Available stations: Slay Radio, goa, trance, chillout, etc.
  • Usage: radio.py

replace_accents/replace_latex_accents.pl

  • This script allows you to write special Hungarian and French characters in a simple way(using the ISO-8859-1 (Latin-1) charset), then convert them to their LaTeX-equivalents.
  • Example: La'szlo' => L'{a}szl'{o}
  • blog post

replace_accents/replace_french_accents_to_latex.pl

  • This script converts a French accented text to LaTeX replacing the funny characters with their LaTeX equivalents.
  • Example: é => '{e}
  • blog post

alarm.py

  • A simple alarm script that plays a list of MP3s at a given time.Very useful if you leave your computer switched on during the night.
  • Usage:
$ alarm -p
    Play music first to adjust volume.
$ alarm -t 7h5
    Set alarm time (5 past 7 in this example).

cb.py

  • Print the content of the clipboard to the standard output.
  • Usage: cb.py

fftabs.py

  • A command line program for manipulating Firefox tabs.
  • Requirements: Firefox + MozRepl add-on.
  • Help: fftabs -h

from_base64.py

  • Ask a base64 string and convert it back to a normal string (decode).
  • Usage: from_base64

get_alap.py

  • An interactive program to generate a skeleton source code.
  • Supported languages: Python, Go, Java, C, D.
  • Usage: get_alap.py

get_images.py

  • Extract image links from a web page.
  • Usage: get_images URL [URL]... [-l]

get_links.py

  • Extract all links from a web page.
  • Usage: get_links.py <URL>
  • blog post

github_user_email.py

  • An interactive program that figures out the email address of a GitHub user.
  • Usage: github_user_email.py

here.py and here.sh

  • Print just the name of the current directory. For instance, if you are in /home/students/solo, then this script will print just solo.
  • here.sh simply prints the output, while here.py, in addition, copies the output to the clipboards.
  • Usage: here

img_to_base64.py

  • Take an image file and encode it with BASE64. Put the encoded data in an "img" HTML tag.
  • Usage: img_to_base64 <image_file>
  • blog post

inout.py

  • An interactive script for 1) compressing a folder to another directory, and2) uncompressing an archive file to a destination directory.
  • Rationale: I always forget the order of parameters...
  • Usage: inout

is_net_back.py

  • Play a sound when the Internet connection is back.
  • Usage: is_net_back

myip.py

  • My external IP address.
  • Usage: myip

ocr.py

  • A wrapper script around the Tesseract OCR engine. Convert an image to string.
  • Usage: ocr <image_file>

open_in_tabs.py

  • Read URLs from the standard input and open them in separated browser tabs.
  • Usage: cat url_list.txt | open_in_tabs
  • blog post

prettify.py

  • Prettify an HTML page, i.e. pretty print its HTML source.
  • The script prints the HTML source that is built by BeautifulSoup (BS). Idea: if you want to manipulate a page with BS, analyze the prettified source instead of the original because this is how BS stores it.
  • Usage: prettify <URL>
  • blog post

prettyjson.py

  • Prettify a JSON file.
  • Usage: prettyjson ugly.json

py2rtf.py

  • Transform a python source file to RTF.
  • Usage: py2rtf [-f] hello.py
  • Meaning: the output is written to hello.rtf
  • blog post

redirect_to.py

  • This script tells you where a webpage redirects.
  • Usage: redirect_to.py <URL>
  • blog post

rep.py

  • Repeat a bash command several times.
  • Usage: rep <rep> <cmd>
  • Example: rep 3 echo hello
  • Meaning: print the text "hello" three times.

slogan.py

  • Generate some slogans from a keyword.
  • Usage: slogan <keyword>

sp.py

  • Print the absolute path of a file. If no parameter is passed, show the current path. The name stands for "show path".
  • This is one of my most useful scripts :) I use it every day.
  • Usage: sp [<filename>]
  • blog post

to_base64.py

  • Ask a string and convert it to a base64 string (encode).
  • Usage: to_base64

to_md5.py

  • This scripts reads a text interactively and prints itsmd5-encoded version. The output is a 32-character longhexa string.
  • Usage: to_md5

to_utf8.py

  • Convert a text file to an UTF-8-encoded text. The output is printed to the screen.
  • Usage: to_utf8 input.txt

tocb.py

  • Copy the text from the standard input to ALL clipboards. Thus, you can use any paste method to insert your text (middle mouse button or Shift+Insert). The name stands for "to clipboard(s)".
  • Usage: cat file.txt | tocb
  • Options: with -t you can trim the text first (remove whitespaces from both ends of the text).
  • blog post

top10.py

  • Show the top 10 largest files in the current directory. Filesizes can be shown in a human-readable format with the -h option.
  • Usage: top10 [-h]

twitch2mp3.py

  • Grab a twitch video in mp3.
  • Usage: twitch2mp3 TWITCH_VIDEO_URL

userpass.py

  • Username and password generator.
  • Usage: userpass

us.py

  • Change spaces to underscores. Pass a string as a parameter OR pass iton the standard input.
  • Example #1: us "How to Think Like a Computer Scientist.pdf"
  • Result #1: How_to_Think_Like_a_Computer_Scientist.pdf
  • Example #2: echo "he he" | us
  • Result #2: he_he

xml2json.py

  • Convert an XML file to JSON.
  • This is a wrapper around the excellent xmltodict library.
  • Usage: xml2json <input.xml>
  • 一、dig命令不存在(-bash: dig: command not found) [root@linux ~]# dig www.baidu.com -bash: dig: command not found 解决方法: 安装bind-utils即可:yum -y install bind-utils [root@linux ~]# yum -y install bind-utils Load

  • 写shell脚本断断续续也有1年了, 平时零零碎碎和写法一直没想起来整理. 在github上开了个项目bash-utils, 收集一些常用的工具函数, 命名方面和php的函数名称尽量保持一致. 项目地址: https://github.com/GerryLon/bash-utils 欢迎大家学习, 交流, 提PR!

  • 问题描述` 在做ARM平台开发摄像头时,需要使用v4l2工具,执行apt-get install v4l-utils时报错 root@tegra-ubuntu:~# apt-get install v4l-utils Reading package lists... Done Building dependency tree Reading state information...

  • 问题报错 PS D:\Work\学习\轻云\light-cloud - 副本> npm run serve > lightcloud@0.2.1 serve D:\Work\学习\轻云\light-cloud - 副本 > vue-cli-service serve internal/modules/cjs/loader.js:968 throw err; ^ Error: Cann

  • ✈前些天发现了一个巨牛的人工智能学习网站,通俗易懂,风趣幽默,忍不住分享一下给大家:床长人工智能教程 yum-utils模块 yum-utils模块: gdb find-repos-of-install package-cleanup repo-graph repoclosure repomanage repoquery yum-debug-dump zless yum-debug

  • Bash详解   http://www.linuxmine.com/3855.html 作者:linux宝库 (http://www.linuxmine.com) 来自:linux宝库 (http://www.linuxmine.com) 联系:linuxmine#gmail.com 最简单的例子 —— Hello World! 几乎所有的讲解编程的书给读者的第一个例子都是 Hello World

  • 什么是shell 简单点理解,就是系统跟计算机硬件交互时使用的中间介质,它只是系统的一个工具。实际上,在shell和计算机硬件之间还有一层东西那就是系统内核了。打个比方,如果把计算机硬件比作一个人的躯体,而系统内核则是人的大脑,至于shell,把它比作人的五官似乎更加贴切些。回到计算机上来,用户直接面对的不是计算机硬件而是shell,用户把指令告诉shell,然后shell再传输给系统内核,接着内

  • [root@localhost ~]#  echo $SHELL /bin/bash 一,补全 1.命令补全 shell程序在接受到用户执行命令的请求,分析完成之后,最左侧的字符串会被当做命令;查找内部命令;根据PATH环境变量中设定的目录,自左而右逐个搜索目录下的文件名; 在给定的一个打头的字符串,如果这个字符串能够唯一的标识程序文件,直接补全;如果不能唯一标定,需要再次敲击Tab键,会给出列表

  • 很久没更新博客了,最近在波士顿访学,开始了学习Linux之旅。     首先了解下shell: 在介绍bash之前,需要先介绍它的起源——shell。shell俗称壳,它是指UNIX系统下的一个命令解析器;主要用于用户和系统的交互。UNIX系统上有很多种Shell。首个shell,即Bourne Shell,于1978年在V7(AT&T的第7版)UNIX上推出。后来,又演变出C shell、bas

  • 目录 bash是一个shell bash shell的内置命令:type shell的变量功能 bash是一个shell shell是提供用户操作系统的一个接口,通过这个接口可以调用其他软件,比如man、chmod、vi等命令都是独立的应用程序,可以通过shell来操作这些应用程序,让这些应用程序调用内核来运行所需要的工作。内核(比如CPU进程、磁盘输入输出等)可以控制硬件来工作。 bash sh

  • sh 和 bash GNU/Linux 操作系统中的 /bin/sh 本是 bash (Bourne-Again Shell) 的符号链接,但鉴于 bash 过于复杂,有人把 bash 从 NetBSD 移植到 Linux 并更名为 dash (Debian Almquist Shell),并建议将 /bin/sh 指向它,以获得更快的脚本执行速度。Dash Shell 比 Bash Shell

  • shell  命令解释器:用户进入系统执行的第一个程序 1.使用shell的两种方式  (1)输入命令  (2)shell Script 脚本 2.命令 查看主机名  hostname  查看日期  date 显示用户  whoami 清屏  ctrl+l 注意: .bashrc   点开始的文件是隐藏文件 调历史命令   :  (1)Ctrl+r                         

  • bash 配置文件 用户的宿主目录下执行命令: [xxx@wfsb]$ cd ~ [xxx@wfsb ~]$ ls -rtlh .bash* -rw-r--r-- 1 xxx 510 124 Mar 13 2007 .bashrc -rw-r--r-- 1 xxx 510 176 Mar 13 2007 .bash_profile -rw-r--r-- 1 xxx 510 18 Mar 13

  • bash 全名是Bourne-Again Shell,是Bourne shell的二代. 该shell是许多linux发行版的默认shell   shell shell就是一个壳.连接人类和计算机内核的一个壳.相当于命令传输器,执行者不是shell,执行者是计算机内核.   使用cat /etc/passwd 最后一行可以看到当前使用的shell,linux一般都是bash aaa:x:1000:

 相关资料
  • 好了,现在我们换了一个遥控器,感觉顺手多了。现在来操练一下,下载一首 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