1、cal
NAME
cal - display a calendar 显示日历
SYNOPSIS
cal [options] [[[day] month] year]
cal [options] [timestamp|monthname]
用法:
cal [选项] [[[日] 月] 年]
cal [选项] <时间戳|月份名>
OPTIONS
-1, --one
Display single month output. (This is the default.)
只显示一个月(默认)
-3, --three
Display three months spanning the date.
显示该日期前后三个月(上个月,这个月,下个月)
-n 【数字】, --months number
Display number of months, starting from the month containing the date.
显示以日期所在月份开始的若干个月
-S, --span
Display months spanning the date.
显示多个月份时的日期范围
-s, --sunday
Display Sunday as the first day of the week.
将星期日显示为一周的第一天。
-m, --monday
Display Monday as the first day of the week.
将星期一显示为一周的第一天。
--iso
Display the proleptic Gregorian calendar exclusively. See --reform below.
只显示公历。参见下面的改革。
-j, --julian
Use day-of-year numbering for all calendars. These are also called ordinal days.
Ordinal days range from 1 to 366. This option does not switch from the Gregorian to
the Julian calendar system, that is controlled by the --reform option.
对所有日历使用日期编号(显示在当年中的第几天,从1月1号算起,默认显示当前月在一年中的天数)
-y, --year
Display a calendar for the whole year.
显示全年的日历。
-Y, --twelve
Display a calendar for the next twelve months.
显示未来12个月的日历。
-w, --week[=number]
Display week numbers in the calendar (US or ISO-8601).
在日历中显示周数。
--color[=when]
Colorize the output. The optional argument when can be auto, never or always. If the
when argument is omitted, it defaults to auto. The colors can be disabled; for the
current built-in default see the --help output. See also the COLORS section.
消息彩色显示(auto, always 或 never)默认启用颜色
-V, --version
Display version information and exit.
显示版本信息并退出。
-h, --help
Display help text and exit.
显示帮助文本并退出。
详解:
cal命令显示公元1~9999年中任意一年或任意一个月的日历。若使用该命令时不带任何参数,则显示当前月份的日历。若在cal命令之后只有一个参数,则该参数被解释为年份,而不是月份。例如:
$ cal 10
当有两个参数时,第一个参数表示月份,第二个表示年份,在两个参数之间要有空格。例如:
$ cal 9 2020
注意,表示年份的参数必须使用年份的完整形式,如2020年要写成“2021”,不能简写成“21”,因为“cal 10 49”将显示公元49年10月的日历。
另外,月份可以使用英文缩写形式,例如“cal Oct 2020”。
2、passwd
NAME
passwd - update user's authentication tokens 更新用户的身份验证令牌
SYNOPSIS
passwd [-k] [-l] [-u [-f]] [-d] [-e] [-n mindays] [-x maxdays] [-w warndays] [-i inactive‐
days] [-S] [--stdin] [-?] [--usage] [username]
-k, --keep-tokens
The option -k is used to indicate that the update should only be for expired authenti‐
cation tokens (passwords); the user wishes to keep their non-expired tokens as before.
保持身份验证令牌不过期
-l, --lock
This option is used to lock the password of specified account and it is available to
root only. The locking is performed by rendering the encrypted password into an
invalid string (by prefixing the encrypted string with an !). Note that the account is
not fully locked - the user can still log in by other means of authentication such as
the ssh public key authentication. Use chage -E 0 user command instead for full
account locking.
锁定指名帐户的密码(仅限 root 用户)
--stdin
This option is used to indicate that passwd should read the new password from standard
input, which can be a pipe.
从标准输入读取令牌(只有 root 用户才能进行此操作)
-u, --unlock
This is the reverse of the -l option - it will unlock the account password by removing
the ! prefix. This option is available to root only. By default passwd will refuse to
create a passwordless account (it will not unlock an account that has only "!" as a
password). The force option -f will override this protection.
解锁指名帐户的密码(仅限 root 用户)
-d, --delete
This is a quick way to delete a password for an account. It will set the named account
passwordless. Available to root only.
Note that if the password was locked, this implicitly removes the password lock as
well.
删除命名帐户的密码(仅限 root用户);也删除密码锁(如果有)
-e, --expire
This is a quick way to expire a password for an account. The user will be forced to
change the password during the next login attempt. Available to root only.
终止指名帐户的密码(仅限 root 用户)
-f, --force
Force the specified operation.
强制执行操作
-n, --minimum DAYS
This will set the minimum password lifetime, in days, if the user's account supports
password lifetimes. Available to root only.
密码的最短有效时限(只有 root 用户才能进行此操作)
-x, --maximum DAYS
This will set the maximum password lifetime, in days, if the user's account supports
password lifetimes. Available to root only.
密码的最长有效时限(只有 root 用户才能进行此操作)
-w, --warning DAYS
This will set the number of days in advance the user will begin receiving warnings
that her password will expire, if the user's account supports password lifetimes.Available to root only.
在密码过期前多少天开始提醒用户(只有 root用户才能进行此操作)
-i, --inactive DAYS
This will set the number of days which will pass before an expired password for this
account will be taken to mean that the account is inactive and should be disabled, if
the user's account supports password lifetimes. Available to root only.
当密码过期后经过多少天该帐号会被禁用(只有 root用户才能进行此操作)
-S, --status
This will output a short information about the status of the password for a given
account. The status information consists of 7 fields. The first field is the user's
login name. The second field indicates if the user account has a locked password (LK),
has no password (NP), or has a usable password (PS). The third field gives the date of
the last password change. The next four fields are the minimum age, maximum age, warn‐
ing period, and inactivity period for the password. These ages are expressed in days.
Notes: The date of the last password change is stored as a number of days since epoch.
Depending on the current time zone, the passwd -S username may show the date of the
last password change that is different from the real date of the last password change
by ±1 day.
This option is available to root only.
报告已命名帐号的密码状态(只有 root用户才能进行此操作)
-?, --help
Print a help message and exit.
显示帮助信息并退出
--usage
Print a short usage message and exit.
显示简短的使用说明并退出
详解:
Linux的安全特性允许用户控制自己的口令,决定用户是否可以修改分派给他的口令,必须多长时间更改自己的口令,以及用户的口令中而已使用什么字符串。
为了把原来的口令改为一个更安全的字符串,可以使用passwd命令,其交互过程如下:
$ passwd
更改用户 cmy 的密码 。 【用户名是cmy】
Current password: 【提示输入老密码】
输入新的UNIX密码: 【要求输入新密码】
重新输入新的UNIX密码: 【重新输入一遍新密码。如果两次输入的密码完全一样,那么系统就接受这个
密码作为下次登陆时的密码】
passwd:所有的身份验证令牌已经成功更新。
系统处于安全考虑,输入的所有口令都不在屏幕上显示。如果输入的口令不对,那么系统会发出提示,要求重复以上步骤。
3、clear
NAME
clear - clear the terminal screen 清除终端屏幕
SYNOPSIS
clear [-Ttype] [-V] [-x]
OPTIONS
-T type
indicates the type of terminal. Normally this option is unnecessary, because the default is
taken from the environment variable TERM. If -T is specified, then the shell variables LINES
and COLUMNS will also be ignored.
指示端子的类型。通常此选项是不必要的,因为默认值是取自环境变量项。如果指定了-T,则shell变量行列也将被忽略。
-V reports the version of ncurses which was used in this program, and exits. The options are as
follows:
显示版本信息并退出。
-x do not attempt to clear the terminal's scrollback buffer using the extended “E3” capability.
不要试图使用扩展的“E3”功能清除终端的滚动缓冲区。
详解:
clear命令清除屏幕上的信息。清屏后,提示符移到屏幕的左上角。
在实际测试中,clear的效果和clear -x表现出的效果一致?两者的区别有待于在以后的实际操做中进行发现。