echo $LANG : 显示目前所支持的语系[root@iZ23rd7ob4hZ ~]# echo $LANG en_US.UTF-8修改语系
[root@iZ23rd7ob4hZ ~]# LANG=zh_TW [root@iZ23rd7ob4hZ ~]# echo $LANG zh_TW [root@iZ23rd7ob4hZ ~]# LANG=en_US.UTF-8 [root@iZ23rd7ob4hZ ~]# echo $LANG en_US.UTF-8man: 查看命令帮助
进入man命令的功能后,你可以按下『空格键』往下翻页,可以按下『 q 』按键来离开man的环境[root@iZ23rd7ob4hZ ~]# man date DATE(1) User Commands DATE(1) NAME 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 display time described by STRING, not ‘now’ -f, --file=DATEFILE ....后续省略首先,在上个表格的第一行,你可以看到的是:『DATE(1)』,DATE我们知道是命令的名称, 那么(1)代表什么呢
代号 代表内容 1 使用者在shell环境中可以操作的命令或可运行文件 2 系统核心可呼叫的函数与工具等 3 一些常用的函数(function)与函式库(library),大部分为C的函式库(libc) 4 装置文件的说明,通常在/dev下的文件 5 配置文件或者是某些文件的格式 6 游戏(games) 7 惯例与协议等,例如Linux文件系统、网络协议、ASCII code等等的说明 8 系统管理员可用的管理命令 9 跟kernel有关的文件 上述的表格内容可以使用『man 7 man』来更详细的取得说明
鸟哥说:上表中的1, 5, 8这三个号码特别重要,也请读者要将这三个数字所代表的意义背下来喔!
man -f 和 man -k命令[root@iZ23rd7ob4hZ ~]# man -f date #查看date命令与上表对应的代号 date (1) - print or set the system date and time date (1p) - write the date and time [root@iZ23rd7ob4hZ ~]# man -k date #查找包含date关键字的命令info : 则是将文件数据拆成一个一个的段落,每个段落用自己的页面来撰写, 并且在各个页面中还有类似网页的『超链接』来跳到各不同的页面中,
每个独立的页面也被称为一个节点(node)
info与man的用途其实差不多
[root@iZ23rd7ob4hZ ~]# info info File: info.info, Node: Top, Next: Getting Started, Up: (dir) Info: An Introduction ********************* The GNU Project distributes most of its on-line manuals in the "Info format", which you read using an "Info reader". You are probably using an Info reader to read this now. There are two primary Info readers: `info', a stand-alone program designed just to read Info files (*note Stand-alone Info: (info-stnd)Top.), and the `info' package in GNU Emacs, a general-purpose editor. At present, only the Emacs reader supports using a mouse. If you are new to the Info reader and want to learn how to use it, type the command `h' now. It brings you to a programmed instruction sequence. To read about advanced Info commands, type `n' twice. This brings you to `Advanced Info Commands', skipping over the `Getting Started' chapter. * Menu: * Getting Started:: Getting started using an Info reader. * Advanced:: Advanced Info commands. * Expert Info:: Info commands for experts. * Index:: An index of topics, commands, and variables.里面的第一行显示了很多的信息
- File:代表这个info page的数据是来自info.info文件所提供的;
- Node:代表目前的这个页面是属于Top节点。 意思是info.info内含有很多信息,而Top仅是info.info文件内的一个节点内容而已;
- Next:下一个节点的名称为Getting Started,你也可以按『N』到下个节点去;
- Up:回到上一层的节点总揽画面,你也可以按下『U』回到上一层;
- Prev:前一个节点。但由于Top是info.info的第一个节点,所以上面没有前一个节点的信息。
/usr/share/doc: 说明文档目录
date: 目前Linux系统的时间
[root@iZ23rd7ob4hZ ~]# date Mon Mar 21 11:05:08 CST 2016
上面显示的是:星期一, 三月二十一日, 11:05 分, 08秒,在 2016年的 CST 时区!台湾在CST时区中!
date的格式化输出功能:
[root@iZ23rd7ob4hZ ~]# date +%Y-%m-%d 2016-03-21 [root@iZ23rd7ob4hZ ~]# date +%H:%M:%S 11:08:51
cal: 显示日历的命令
[root@iZ23rd7ob4hZ ~]# cal March 2016 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
基本上cal这个命令可以接的语法为:cal [month] [year]
[root@iZ23rd7ob4hZ ~]# cal 2 2016 February 2016 Su Mo Tu We Th Fr Sa 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 [root@iZ23rd7ob4hZ ~]# cal 2016 2016 January February March Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa Su Mo Tu We Th Fr Sa 1 2 1 2 3 4 5 6 1 2 3 4 5 3 4 5 6 7 8 9 7 8 9 10 11 12 13 6 7 8 9 10 11 12 10 11 12 13 14 15 16 14 15 16 17 18 19 20 13 14 15 16 17 18 19 17 18 19 20 21 22 23 21 22 23 24 25 26 27 20 21 22 23 24 25 26 24 25 26 27 28 29 30 28 29 27 28 29 30 31 31 ....后续省略
bc:计算器
其中scale=number ,那个number就是小数点位数
quit退出
[root@iZ23rd7ob4hZ ~]# bc bc 1.06.95 Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc. This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'. 1+2+3 6 1*2 2 scale=3 8/3 2.666 quit
两个[Tab]按键: Linux有多少命令
[root@iZ23rd7ob4hZ ~]# Display all 1563 possibilities? (y or n)
who: 目前有谁在在线
[root@iZ23rd7ob4hZ ~]# who root pts/0 2016-03-21 10:51 (211.95.57.198)
sync: 数据同步写入磁盘, 这个命令在系统关机或重新启动之前, 很重要喔!最好多运行几次!
fsck: 为文件系统检查的命令
权限一张图
其中: r:4 w:2 x:1
基本上就九个权限分别是(1)user (2)group (3)others三种身份啦!那么我们就可以藉由u, g, o来代表三种身份的权限!此外, a 则代表 all 亦即全部的身份
chmod u=rwx,go=rx .bashrc
查看linux版本
[root@iZ23rd7ob4hZ ~]# lsb_release -a LSB Version: :base-4.0-amd64:base-4.0-noarch:core-4.0-amd64:core-4.0-noarch Distributor ID: CentOS Description: CentOS release 6.5 (Final) Release: 6.5 Codename: Final
1024total visits,1visits today
Leave a Reply