Linux簡單命令收錄(cal,passwd,clear)【下】

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

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/news/443908.shtml
繁體地址,請注明出處:http://hk.pswp.cn/news/443908.shtml
英文地址,請注明出處:http://en.pswp.cn/news/443908.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

web知識點大總結

#第一章 Web基礎知識 Web開發基本概念 1、萬維網是一個由許多相互鏈接的超文本組成的系統&#xff0c;通過互聯網訪問。 2、web&#xff1a;worldwideweb&#xff0c;萬維網&#xff0c;簡稱web&#xff0c;www&#xff0c;通常稱為網頁。 3、web開發&#xff1a;進行網頁頁…

Linux命令集—— cat AND more

1、cat NAME cat - concatenate files and print on the standard output 連接所有指定文件并將結果寫到標準輸出。【經常用來顯示文件的內容&#xff0c;類似DOS的TYPE 命令】 SYNOPSIS cat [OPTION]... [FILE]... cat [選項]... [文件]... With no FILE, or when FILE…

Linux簡單命令集——less

NAME less - opposite of more more的對立面 注意 與more命令類似&#xff0c;less命令也用來分屏顯示文件的內容&#xff0c;但是less命令允許用戶向前或向后瀏覽文件。例如&#xff0c;less命令顯示文件內容時&#xff0c;可以用?鍵和?鍵分別將屏幕內容下移一行和上移一…

《重構-改善既有代

重要列表 1、如果你發現自己需要為程序添加一個特性&#xff0c;而代碼結構使你無法很方便地達成目的&#xff0c;那就先重構哪個程序&#xff0c;使特性的添加比較容易的進行&#xff0c;然后再添加特性 2、重構前&#xff0c;先檢查自己是否有一套可靠的測試機制&#xff0…

Myeclipse 6.5 優化

1、取消自動validation validation有一堆&#xff0c;什么xml、jsp、jsf、js等等&#xff0c;我們沒有必要全部都去自動校驗一下&#xff0c;只是需要的時候才會手工校驗一下&#xff01; 取消方法&#xff1a; windows–>perferences–>MyEclipse Enterprise Workbench–…

Linux簡單命令集——head

NAME head - output the first part of files 輸出文件的第一部分SYNOPSIS head [OPTION]... [FILE]...head [選項]... [文件]...head命令在屏幕上顯示指定文件file的開頭若干行&#xff0c;行數由參數值來確定。顯示行數的默認值是10。-c, --bytes[-]NUM print the firs…

操作系統中避免死鎖的銀行家算法【表面C++實際C語言】一學就廢的菜雞代碼

文章目錄銀行家算法實驗原理數據結構初始化輸出資源分配量安全性算法銀行家算法完整代碼測試數據測試結果第一題第二題銀行家算法 銀行家算法是一種最有代表性的避免死鎖的算法。在避免死鎖方法中允許進程動態地申請資源&#xff0c;但系統在進行資源分配之前&#xff0c;應先…

GitHub 使用指南

目錄切換分支刪除已有文件只刪除遠程倉庫中的文件&#xff0c;不刪除本地倉庫中的文件同時刪除遠程倉庫和本地倉庫中的文件提交文件git查看本地分支連接的是哪個遠程分支切換分支 查看本地和遠程所有分支 git branch -a當前本地分支為綠色&#xff0c;當前所在分支前帶有“*”號…

百度EBG測試部AI測試工程師面經

百度EBG測試部AI測試工程師 1、自我介紹 自我介紹盡量多說一點&#xff0c;她會問你“還有嗎&#xff1f;” 2、項目介紹 簡歷上的項目都讓介紹了。會問這個項目是做什么的&#xff0c;是由誰開發&#xff0c;項目如何得到的&#xff0c;在測試過程中實現了什么。 3、自己…

一學就廢的并查集它來了

文章目錄題目描述輸入輸出樣例輸入樣例輸出提示算法思想代碼實現尋找根節點匯總連接情況完整代碼關于flag的初值題目描述 某省調查城鎮交通狀況&#xff0c;得到現有城鎮道路統計表&#xff0c;表中列出了每條道路直接連通的城鎮。省政府“暢通工程”的目標是使全省任何兩個城…

一道很簡單的貪心算法題~【貪心:我不要臉的伐?】

文章目錄題目描述輸入輸出樣例輸入樣例輸出C語言代碼實現思路排序處理完整代碼C代碼實現排序完整代碼彩蛋題目描述 小健有一家自己的商店&#xff0c;主營牛奶飲品&#xff0c;最近資金緊張&#xff0c;他想以盡可能低的價格進購足夠的牛奶以供日常的需要。所以小健想要求助你…

Eclipse 中修改java編譯版本

修改方法是&#xff1a; 1&#xff1a;Preferences-->Java-->Compiler->Compiler compliance level&#xff0c;選擇一個需要的版本&#xff0c;比如從默認的1.4改為5.0 2&#xff1a;如果只想修改一個工程的Compiler compliance level,就右單擊工程&#xff0c;選擇屬…

百戰c++(1)

Public和private的區別 public和private是類里的關鍵字&#xff0c;用于規定類內數據或者成員函數的訪問權限。private類型的數據或者函數&#xff0c;只能在相應的類內被訪問&#xff0c;而public類型的數據或者函數被訪問的權限比較寬&#xff0c;還可以在其它類或者其它函數…

一學就廢的三種簡單排序【冒泡、插入、選擇】

文章目錄其他排序算法冒泡排序算法實現代碼實例插入排序算法實現代碼實例選擇排序算法實現代碼實例其他排序算法 一學就廢的歸并排序 冒泡排序 排列順序從前到后或者從后往前都可&#xff0c;本文選擇從后到前的順序&#xff0c;升序排列&#xff1a;比較相鄰兩個元素&#x…

百戰c++(2)

delete 和 delete []的真正區別 delete 對應 new delete[]對應new[]對于簡單類型包括簡單類型數組&#xff0c;delete 與delete[]沒有區別。對于自定義類型數組&#xff0c;delete 只會刪除一個元素&#xff0c;delete 則會刪除所有元素。 指針和數組的區別 野指針是什么 野指…

shell預先定義的特殊變量

文章目錄$#$*$$$# 表示命令行上參數的個數&#xff0c;但不包括shell腳本名本身 為腳本ex1賦予兩個變量&#xff0c;測試$#的輸出結果 [cmybogon test2]$ . ex1 ma.c mb.c 2 # echo $# 7 # cat $1 $2 $3 | wc -l 2 # echo $#腳本ex1的具體內容 [rootlocalhost test]$ cat ex1…

Linux實驗一:常用的Linux命令

文章目錄一、實驗目的二、實驗要求三、實驗內容1、系統的使用2、命令的使用3、文件操作4、系統詢問與權限口令5、其它常用命令四、實驗操作1、基本命令的使用2、文件和目錄操作3、創建用戶帳戶一、實驗目的 1、熟悉Linux的桌面環境&#xff1b; 2、了解Linux所安裝的軟件包 3、…

Linux實驗二:vi編輯器的使用

文章目錄一、實驗目的二、實驗要求三、實驗內容1、創建文件2、編輯文件一、實驗目的 1、練習并掌握Linux提供的vi編輯器來編譯C程序 2、學會利用gcc、gdb編譯、調試C程序 3、本次實驗的目的是讓同學們了解如何使用vi編輯器進行創建和編輯文件 二、實驗要求 1、文件編輯器vi…

百戰c++(os1)

Linux中的鎖 互斥鎖&#xff1a;mutex&#xff0c;用于保證在任何時刻&#xff0c;都只能有一個線程訪問該對象。當獲取鎖操作失敗時&#xff0c;線程會進入睡眠&#xff0c;等待鎖釋放時被喚醒 讀寫鎖&#xff1a;rwlock&#xff0c;分為讀鎖和寫鎖。處于讀操作時&#xff0…

Linux實驗三:Shell編程

文章目錄一、實驗目的二、實驗要求三、實驗內容1、通配符的使用2、重定向3、管道4、shell變量5、建立下面的腳本&#xff0c;運行并分析輸出結果&#xff0c;并給出代碼注釋。6、編寫腳本一、實驗目的 1.為文件擴展名使用通配符 2.標準輸入、標準輸出和標準錯誤的重定向 3.使…