[dmtsai@study ~]$ command [-options] parameter1 parameter2 …
[dmtsai@study ~]$ | command | [-options] | parameter1 | parameter2 |
---|---|---|---|---|
指令 | 选项 | 参数(1) | 参数(2) |
上述指令详细书说明:
mofei@DESKTOP-3F64ED5:~$ date
Mon Jun 1 11:11:28 CST 2020
上面显示的是:星期一, 六月一日, 11:11 分, 28秒,在 2020 年的 CST 时区
其他格式的书写形式:
mofei@DESKTOP-3F64ED5:~$ date +%Y/%m/%d
2020/06/01
mofei@DESKTOP-3F64ED5:~$ date +%H:%M
11:17
mofei@DESKTOP-3F64ED5:~$ cal
June 2020
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
cal指令可以接的语法为:
[dmtsai@study ~]$ cal [month] [year]
mofei@DESKTOP-3F64ED5:~$ cal 7 2020
July 2020
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 31
mofei@DESKTOP-3F64ED5:~$ bc
bc 1.07.1
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006, 2008, 2012-2017 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
1+2
3
3-2
1
2*3
6
4/2
2
1/2
0
10^2
100
quit
在上述中,输入bc之后,显示版本新信息并进入bc的工作环境中,离开bc工作环境务必要输入“quit”;而 1/2 的结果为0,因为bc默认输出整数,如果要输出小数点下位数,那么要执行 scale=number (number就是小数点的位数)例如:
mofei@DESKTOP-3F64ED5:~$ bc
bc 1.07.1
Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006, 2008, 2012-2017 Free Software Foundation, Inc.
This is free software with ABSOLUTELY NO WARRANTY.
For details type `warranty'.
2/3
0
scale=3
2/3
.666
3/2
1.500
quit
mofei@DESKTOP-3F64ED5:~$ ca[Tab][Tab] <==[Tab]按键是紧跟在a字母的后面
cabapi.dll cal canbusutil.exe capisp.dll cat catsrvps.dll
cabinet.dll calc.exe canonurl.dll capsh catchsegv catsrvut.dll
cabview.dll calendar capauthz.dll captoinfo catman cautious-launcher
cacls.exe caller capiprovider.dll case catsrv.dll
[Tab] 接在一串指令的第一个字的后面,则为“命令补全”;
[Tab] 接在一串指令的第二个字以后时,则为“文件补齐”;