小编Rap*_*tor的帖子

grep :如何为 2 个关键字着色?

我知道如何使用 1 个命令 grep 2 个关键字,但我只能设法在 output 中为其中一个着色。这是我的命令:

grep 'keyword1' file.log | grep 'keyword2'
Run Code Online (Sandbox Code Playgroud)

只有keyword2突出显示。我怎样才能keyword1同时突出显示?

grep

12
推荐指数
2
解决办法
1万
查看次数

升级 MySQL 服务器问题

我升级 MySQL 服务器失败。这是我尝试过的:

我首先发出这个命令来更新包列表:

sudo apt-get update
Run Code Online (Sandbox Code Playgroud)

然后,通过以下方式升级:

sudo apt-get upgrade
Run Code Online (Sandbox Code Playgroud)

它显示以下错误:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
 mysql-server-5.5 : Depends: mysql-server-core-5.5 (= 5.5.28-0ubuntu0.12.04.2) but 5.5.31-0ubuntu0.12.04.1 is installed
E: Unmet dependencies. Try using -f.
Run Code Online (Sandbox Code Playgroud)

显然安装了更新的版本(但为什么?我没有手动安装)。好的,正如它所暗示的,我发出命令来尝试修复:

sudo apt-get -f install
Run Code Online (Sandbox Code Playgroud)

这是输出:

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Correcting dependencies... Done
The following extra packages …
Run Code Online (Sandbox Code Playgroud)

mysql apt

12
推荐指数
1
解决办法
3万
查看次数

标签 统计

apt ×1

grep ×1

mysql ×1