Linux小工具推荐

Linux实用小工具推荐

偶然发现几个挺有意思的小工具,推荐下

htop

首先是top的替代品,个人感觉比top好用,界面更好看,支持键盘方向键左右移动,支持一键增减任务优先级(nice%)

安装:

1
2
yum -y install epel-release
yum -y install htop

和top一样用,直接htop即可

mycli

一个可以在控制台里面进行SQL联想的客户端工具,界面也更好看,比普通在控制台敲SQL爽多了

效果:

1
2
3
4
mysql root@localhost:accrual_minth> show databases; 
databases
create database
procedure status

安装:
首先是服务器上要有python,如果是python3更好,装了pip最好;python2.7也行,下面演示python2.7安装
安装gcc,更新yum

1
yum -y update && yum -y install gcc 

安装pip

1
2
3
wget https://bootstrap.pypa.io/get-pip.py

python get-pip.py && yum -y install python-devel

安装mycli

1
pip install mycli

可能会有报错:
Cannot uninstall 'configobj'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall

那就把安装命令替换成:

1
pip install --ignore-installed mycli

使用:

1
mycli -uroot

thefuck

这个工具,个人觉得是最有意思,简直就是在抒发敲命令的人的心声。想一下,当你敲一个命令,然后提示你xxx command not found是不是很想骂街,然后,国外的某团队就做了个这玩意,当你敲错命令时候,敲个fuck自动帮你纠正命令

效果:

1
2
3
4
5
6
7
8
9
10
[root@localhost ~]# yun install aaa
-bash: yun: command not found
[root@localhost ~]# fuck
​​​​​​​​​​yum install aaa [enter/↑/↓/ctrl+c]
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: mirrors.aliyun.com
* epel: mirrors.tuna.tsinghua.edu.cn
* extras: mirrors.aliyun.com
* updates: mirrors.aliyun.com

上述实例,原来敲的是yun install很明显是手残敲错了,然后敲个fuck,自动纠正成了yum install直接回车就可以执行了

安装:

1
pip install thefuck

配置:
编辑bashrc配置文件

1
2
3
4
5
6
cd ~

vim .bashrc

#在文件尾加入一行给thefuck重命名为fuck
eval "$(thefuck --alias fuck)"

隐藏文件,可以ls -al看见

文件生效

1
source ~/.bashrc

完成~

文章目录
  1. htop
  2. mycli
  3. thefuck
|