一个有个性的使用工具thefuck@Ubuntu
这个工具名字可能有些粗鄙,不过真的有让人眼前一亮的功能。
当用户输入错误的命令时,TheFuck会根据上下文自动推测并给出正确的命令建议。
安装
apt update
apt search thefuck
apt install thefuck
使用
在错误命令下面直接输入thefuck即可。
不过在FreeBSD jail Ubuntu下,使用的时候报错,不知道什么原因:
root@ubjail2:/# thefuck
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/psutil/_common.py", line 441, in wrapper
ret = self._cache[fun]
AttributeError: 'Process' object has no attribute '_cache'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/bin/thefuck", line 9, in <module>
from thefuck.entrypoints.main import main
File "/usr/share/thefuck/thefuck/entrypoints/main.py", line 11, in <module>
from ..shells import shell # noqa: E402
File "/usr/share/thefuck/thefuck/shells/__init__.py", line 52, in <module>
shell = _get_shell_from_env() or _get_shell_from_proc()
File "/usr/share/thefuck/thefuck/shells/__init__.py", line 31, in _get_shell_from_proc
proc = Process(os.getpid())
File "/usr/lib/python3/dist-packages/psutil/__init__.py", line 332, in __init__
self._init(pid)
File "/usr/lib/python3/dist-packages/psutil/__init__.py", line 361, in _init
self.create_time()
File "/usr/lib/python3/dist-packages/psutil/__init__.py", line 717, in create_time
self._create_time = self._proc.create_time()
File "/usr/lib/python3/dist-packages/psutil/_pslinux.py", line 1661, in wrapper
return fun(self, *args, **kwargs)
File "/usr/lib/python3/dist-packages/psutil/_pslinux.py", line 1873, in create_time
ctime = float(self._parse_stat_file()['create_time'])
File "/usr/lib/python3/dist-packages/psutil/_pslinux.py", line 1661, in wrapper
return fun(self, *args, **kwargs)
File "/usr/lib/python3/dist-packages/psutil/_common.py", line 444, in wrapper
return fun(self)
File "/usr/lib/python3/dist-packages/psutil/_pslinux.py", line 1723, in _parse_stat_file
ret['blkio_ticks'] = fields[39] # aka 'delayacct_blkio_ticks'
IndexError: list index out of range