回车的妙用

发布于 2023-02-08 19:33:36 字数 4241 浏览 103 评论 0

其中提到一个观点,在输入命令之前,应该多敲几下回车,以便将当前命令与上一命令的输出区分开来,这样可以方便操作者看会之前的操作内容。

比如,下面这一陀是没有分隔的输出:

root@server:~# apt-get update
Hit:1 http://mirror.memset.com/ubuntu xenial InRelease
Get:2 http://mirror.memset.com/ubuntu xenial-updates InRelease [102 kB]
Get:3 http://mirror.memset.com/ubuntu xenial-security InRelease [102 kB]
Fetched 204 kB in 0s (433 kB/s)
Reading package lists... Done
root@server:~# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  libgl1-mesa-dri sysstat
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
root@server:~# apt-get install openvpn
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libgd3 libjbig0
  libjpeg-turbo8 libjpeg8 liblua5.1-0 libtiff5 libvpx3 libxslt1.1 nginx-common nginx-core
Use 'apt autoremove' to remove them.
Suggested packages:
  easy-rsa
The following NEW packages will be installed:
  openvpn
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 0 B/421 kB of archives.
After this operation, 1026 kB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously unselected package openvpn.
(Reading database ... 22196 files and directories currently installed.)
Preparing to unpack .../openvpn_2.3.10-1ubuntu2.1_amd64.deb ...
Unpacking openvpn (2.3.10-1ubuntu2.1) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Processing triggers for systemd (229-4ubuntu21) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up openvpn (2.3.10-1ubuntu2.1) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
root@server:~# cd /etc/openvpn/
root@server:/etc/openvpn# ls
update-resolv-conf

然后是分隔后的输出:

root@server:~#
root@server:~#
root@server:~# apt-get update
Hit:1 http://mirror.memset.com/ubuntu xenial InRelease
Get:2 http://mirror.memset.com/ubuntu xenial-updates InRelease [102 kB]
Get:3 http://mirror.memset.com/ubuntu xenial-security InRelease [102 kB]
Fetched 204 kB in 0s (433 kB/s)
Reading package lists... Done
root@server:~#
root@server:~#
root@server:~#
root@server:~# apt-get upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
Calculating upgrade... Done
The following packages have been kept back:
  libgl1-mesa-dri sysstat
0 upgraded, 0 newly installed, 0 to remove and 2 not upgraded.
root@server:~#
root@server:~#
root@server:~#
root@server:~#
root@server:~# apt-get install openvpn
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
  apache2-bin apache2-data apache2-utils libapr1 libaprutil1 libaprutil1-dbd-sqlite3 libaprutil1-ldap libgd3 libjbig0
  libjpeg-turbo8 libjpeg8 liblua5.1-0 libtiff5 libvpx3 libxslt1.1 nginx-common nginx-core
Use 'apt autoremove' to remove them.
Suggested packages:
  easy-rsa
The following NEW packages will be installed:
  openvpn
0 upgraded, 1 newly installed, 0 to remove and 2 not upgraded.
Need to get 0 B/421 kB of archives.
After this operation, 1026 kB of additional disk space will be used.
Preconfiguring packages ...
Selecting previously unselected package openvpn.
(Reading database ... 22196 files and directories currently installed.)
Preparing to unpack .../openvpn_2.3.10-1ubuntu2.1_amd64.deb ...
Unpacking openvpn (2.3.10-1ubuntu2.1) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Processing triggers for systemd (229-4ubuntu21) ...
Processing triggers for ureadahead (0.100.0-19) ...
Processing triggers for man-db (2.7.5-1) ...
Setting up openvpn (2.3.10-1ubuntu2.1) ...
Processing triggers for libc-bin (2.23-0ubuntu9) ...
root@server:~#
root@server:~#
root@server:~# cd /etc/openvpn/
root@server:/etc/openvpn#
root@server:/etc/openvpn#
root@server:/etc/openvpn#
root@server:/etc/openvpn# ls
update-resolv-conf

恩,看起来分隔后的命令输出确实要容易阅读的多。

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据

关于作者

硪扪都還晓

暂无简介

文章
评论
27 人气
更多

推荐作者

櫻之舞

文章 0 评论 0

弥枳

文章 0 评论 0

m2429

文章 0 评论 0

野却迷人

文章 0 评论 0

我怀念的。

文章 0 评论 0

    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文