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.mzph.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.使…