|
|
!! 是个神奇的东西
在Linux终端(bash),它代表上一条命令
那么什么时候会用到他呢?
举个例子
- $ apt update
- Reading package lists... Done
- W: chmod 0700 of directory /var/lib/apt/lists/partial failed - SetupAPTPartialDirectory (1: Operation not permitted)
- E: Could not open lock file /var/lib/apt/lists/lock - open (13: Permission denied)
- E: Unable to lock directory /var/lib/apt/lists/
- W: Problem unlinking the file /var/cache/apt/pkgcache.bin - RemoveCaches (13: Permission denied)
- W: Problem unlinking the file /var/cache/apt/srcpkgcache.bin - RemoveCaches (13: Permission denied)
复制代码
在非ROOT用户使用apt时,提示没有权限
这里只是一个update,手动敲也无妨,或者直接按方向上⬆,然后移动光标到开头添上"sudo"。但是可以更快,为何不用更快的方式呢。再者有时并不只是这短短几个字母
也许上一条敲的是apt install -y git vim wget curl gcc xxxxxxxxxxxxxxxxxxx
那么这种时候就再合适不过了
只需要敲
或者,有时候,我们并没有把一个软件添加进环境变量
到了该软件目录下,如下即可运行它
- ./xxxx
- ./xxxx -xx xxxx -ss ssss -y yyyy -b bbbb #有时还有很多参数
复制代码
但是,我一不小心,少敲了前面的./
直接就提示xxxx not found
同理,此时我只需要敲
非常好用
|
|