先来了解一下Linux有多少命令呢?在文本模式下,你可以直接按下两个[Tab]按键,看看总共有多少命令可以让你用?
[knife@www ~]$ <==在这里不要输入任何字符,直接输入两次[tab]按键
Display all 2093 possibilities? (y or n) <==如果不想要看,按 n 离开
从上图,我们可以看出在这个linux系统中,有2093个命令可以让knife这个账号使用。这么多的命令要怎样才可以记住啊?不过,还是要以理解『在什么情况下,应该要使用哪方面的命令』为准的!既然说不需要背命令,那么我们如何知道每个命令的详细用法?还有,某些配置文件的内容到底是什么? 这个可就不需要担心了!因为在Linux上开发的软件大多数都是自由软件,而这些软件的开发者为了让大家能够了解命令的用法, 都会自行制作很多的文件,而这些文件也可以直接在在线就能够轻易的被使用者查询出来!
1)man page
啊?不知道怎么使用date这个命令?不要担心,Linux上面的在线求助系统已经都帮你想好要怎么办了,所以你只要使用简单的方法去寻找一下说明的内容,马上就清清楚楚的知道该命令的用法了!怎么看呢?就是找男人(man)呀!这个man是manual(操作说明、使用手册)的简写!只要下达:『man date』 马上就会有清楚的说明出现在你面前。如下所示:
[knife @www ~]$ LANG="en" # 还记得这个咚咚的用意吧?前面提过了,是为了『语系』的需要啊!下达过一次即可! [knife @www ~]$ man date DATE(1) User Commands DATE(1) # 请注意上面这个括号内的数字 NAME <==这个命令的完整全名,如下所示为date且说明简单用途为配置与显示日期/时间 date - print or set the system date and time SYNOPSIS <==这个命令的基本语法如下所示 date [OPTION]... [+FORMAT] date [-u|--utc|--universal] [MMDDhhmm[[CC]YY][.ss]] DESCRIPTION <==详细说明刚刚语法谈到的选项与参数的用法 Display the current time in the given FORMAT, or set the system date. -d, --date=STRING <==左边-d为短选项名称,右边--date为完整选项名称 display time described by STRING, not 'now' -f, --file=DATEFILE like --date once for each line of DATEFILE -r, --reference=FILE display the last modification time of FILE ....(中间省略).... # 找到了!底下就是格式化输出的详细数据! FORMAT controls the output. The only valid option for the second form specifies Coordinated Universal Time. Interpreted sequences are: %% a literal % %a locale's abbreviated weekday name (e.g., Sun) %A locale's full weekday name (e.g., Sunday) ....(中间省略).... ENVIRONMENT <==与这个命令相关的环境参数有如下的说明 TZ Specifies the timezone, unless overridden by command line parameters. If neither is specified, the setting from /etc/localtime is used. AUTHOR <==这个命令的作者啦! Written by David MacKenzie. REPORTING BUGS <==有问题请留言给底下的email的意思! Report bugs to <bug-coreutils@gnu.org>. COPYRIGHT <==受到著作权法的保护!用的就是 GPL 了! Copyright ? 2006 Free Software Foundation, Inc. This is free software. You may redistribute copies of it under the terms of the GNU General Public License <http://www.gnu.org/licenses/gpl.html>. There is NO WARRANTY, to the extent permitted by law. SEE ALSO <==这个重要,你还可以从哪里查到与date相关的说明文件之意 The full documentation for date is maintained as a Texinfo manual. If the info and date programs are properly installed at your site, the command info date should give you access to the complete manual. date 5.97 May 2006 DATE(1)