概要
现在,我们学习了怎样输入命令,那我们执行一些简单的命令吧。
第一个命令是 date
。这个命令显示系统当前时间和日期。
[root@VM-0-13-centos]$ date
Fri Jun 11 22:09:37 CST 202
一个相关联的命令,cal
,它默认显示当前月份的日历。
[root@VM-0-13-centos]$ cal
June 2021
Su Mo Tu We Th Fr Sa
1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30
查看磁盘剩余空间的数量,输入 df
。
[root@VM-0-13-centos]$ df
Filesystem 1K-blocks Used Available Use% Mounted on
devtmpfs 1929584 0 1929584 0% /dev
tmpfs 1940092 24 1940068 1% /dev/shm
tmpfs 1940092 516 1939576 1% /run
tmpfs 1940092 0 1940092 0% /sys/fs/cgroup
/dev/vda1 51473868 2460720 46690028 6% /
tmpfs 388020 0 388020 0% /run/user/0
同样地,显示空闲内存的数量,输入命令 free
。
[root@VM-0-13-centos]$ free
total used free shared buff/cache available
Mem: 3880184 164956 3459484 540 255744 3499496
Swap: 0 0 0
结束终端会话 exit
我们可以通过关闭终端仿真器窗口,或者是在 shell
提示符下输入 exit
命令来终止一个终端会话:
[root@VM-0-13-centos]$ exit
拓展阅读
- 想了解更多关于 Steve Bourne 的故事,Bourne Shell 之父,读一下这篇文章:
http://en.wikipedia.org/wiki/Steve_Bourne
; - 这是一篇关于在计算机领域里,shells 概念的文章:
http://en.wikipedia.org/wiki/Shell_(computing)
;