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表現出的效果一致?兩者的區別有待于在以后的實際操做中進行發現。