zoukankan      html  css  js  c++  java
  • llinux day02 基础操作 帮助 文件管理 马

    免密码登录(只是为了方便教学,免了图形界面的密码)

    1,Linux免密自动以root身份登录图形化界面,修改etc/gdm/custom.conf 在deamon下面添加两行,注意区分大小写

    [daemon]
    AutomaticLoginEnable=true
    AutomaticLogin=root

    2,windows查看地址,除了ipconfig,还可以使用ip a来查看。

    3,图形编辑工具,gedit工具可以在图形界面下使用。但是远程登录的界面是没有办法使用的,图形编辑是有保存按钮的

    4,文本编辑工具:nano  AutomaticLoginEnable = true,AutomaticLogin = root 注意区分大小写,字符界面编辑器,不支持鼠标确定保存,只可以用按键来实现退出保存。

    用户登录

    1,系统中判断是管理员还是其他用户,看的是唯一编号UID,为0得话就是root

    2,查看uid命令,6版本普通用户从500开始,但是7版本从1000开始,id可以默认也可以自由指定

    id -u 
    id -u lisa

    终端

    1,终端有很多很多种,图形终端默认只有一个,字符终端可以打开很多个

    2,图形界面切换到字符终端 ctrl+alt+f2

    3,alt + f1就又切换回图形界面了

    4,图形界面下alt + f*又可以打开新的字符终端了,*号代表按的是F几,tty命令也可以查看

    5,如何查看当前有哪些人登录了界面,分别在哪个终端,使用who命令

    6,通常来说带tty这种的都是本地登录的,pts这种的就是远程登录的

    7,临时切换到字符界面得话,图形界面不会关闭的,init 3 执行这个命令会自动切换到字符界面,并且关闭图形界面,这种切换也叫做模式切换

    8,查看当前的运行模式 runlevel,运行结果,刚才的模式,现在的模式

    9,init 5代表切换回图形,5代表图形

    10,字符界面切换回图形界面,还有另外一种方式,就是startx,startx不认为是模式切换,只不过是开启了一个图形终端,图形界面而已

    11,Linux里面的图形,只是一个软件,不是操作系统必须的,但是Windows的图形界面是必须要有的,属于核心的东西

    12,startx打开的图形界面,按一下ctrl+z就关闭了,就是相当于把这个程序关闭了而已

    13,模式切换只可以用init命令,模式切换不只是开始图形,也会开启一些后台的服务,

    14,工作中尽量避免切换,容易切换死机,毕竟是个比较大的动作

    15,切换的话ctrl+alt+f2,如果已经在字符界面了可以不用按ctrl了就,就可以切换到一个新的字符终端了

    16,如果按键有问题,可以用命令来切换终端,chvt 1/chvt 6 change virtual terminal

    17,切换模式的话,必须要root权限,普通用户不可以的 init不可以执行,但是startx是可以的

    [root@red-hat-enterprise-linux ~]# id
    uid=0(root) gid=0(root) groups=0(root) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
    [root@red-hat-enterprise-linux ~]# id lisa
    uid=1000(lisa) gid=1000(lisa) groups=1000(lisa),10(wheel)
    [root@red-hat-enterprise-linux ~]# id -u
    0
    [root@red-hat-enterprise-linux ~]# id -u root
    0
    [root@red-hat-enterprise-linux ~]# id -u lisa
    1000
    [root@red-hat-enterprise-linux ~]# who
    root     :0           Apr 16 21:12 (:0)
    root     pts/0        Apr 16 21:11 (10.211.55.2)
    root     pts/1        Apr 16 21:12 (:0)
    root     tty2         Apr 16 21:10
    root     tty5         Apr 16 21:10
    root     tty6         Apr 16 21:16
    [root@red-hat-enterprise-linux ~]# tty
    /dev/pts/0
    [root@red-hat-enterprise-linux ~]# who am i
    root     pts/0        Apr 16 21:11 (10.211.55.2)
    [root@red-hat-enterprise-linux ~]# whoami
    root
    [root@red-hat-enterprise-linux ~]# tty
    /dev/pts/0
    [root@red-hat-enterprise-linux ~]# who am i
    root     pts/0        Apr 16 21:11 (10.211.55.2)
    [root@red-hat-enterprise-linux ~]# whoami
    root
    [root@red-hat-enterprise-linux ~]# who a b
    root     pts/0        Apr 16 21:11 (10.211.55.2)
    [root@red-hat-enterprise-linux ~]# who i m
    root     pts/0        Apr 16 21:11 (10.211.55.2)
    [root@red-hat-enterprise-linux ~]# who
    root     :0           Apr 16 21:12 (:0)
    root     pts/0        Apr 16 21:11 (10.211.55.2)
    root     pts/1        Apr 16 21:12 (:0)
    root     tty2         Apr 16 21:10
    root     tty5         Apr 16 21:10
    root     tty6         Apr 16 21:16
    [root@red-hat-enterprise-linux ~]# w
     21:20:36 up  1:02,  6 users,  load average: 0.00, 0.04, 0.08
    USER     TTY      FROM             LOGIN@   IDLE   JCPU   PCPU WHAT
    root     :0       :0               21:12   ?xdm?  34.59s  0.07s gdm-session-wor
    root     pts/0    10.211.55.2      21:11    4.00s  0.05s  0.01s w
    root     pts/1    :0               21:12    8:12   0.02s  0.02s /bin/bash
    root     tty2                      21:10   10:20   0.01s  0.01s -bash
    root     tty5                      21:10    9:40   0.01s  0.01s -bash
    root     tty6                      21:16    3:56   0.05s  0.05s -bash
    [root@red-hat-enterprise-linux ~]#
    [root@red-hat-enterprise-linux ~]# init 3
    PolicyKit daemon disconnected from the bus.
    We are no longer a registered authentication agent.
    [root@red-hat-enterprise-linux ~]# runlevel
    5 3
    [root@red-hat-enterprise-linux ~]# chvt 4
    [root@red-hat-enterprise-linux ~]# chvt 5

    Shell介绍

    1,翻译官 command interpreter

    2,bash是一直在运行的,把我们敲的命令,转化成计算机能识别的,默认的shell类型

    3,不同的shell翻译的也有一些差别的,我们掌握最基本的就好

    4,shell会捕获我们输入的命令,shell的接口是隐藏的,我们看不见的

    5,shell可以翻译,同时shell也是一种编程语言,可以实现一些稍微复杂的逻辑关系

    6,bash默认都有的,即使没有,只要装上就可以用了,就是一个软件而已

    7,Linux只是显示最后一层,window的console会显示完整的路径

    8,波浪符号代表家目录,#代表的是root

    9,提示符号可以根据需要修改,从删库到跑路 哈哈哈

    10,命令提示符号是可以修改的,但是有个小问题就是,如果修改完,exit,再进来,之前的修改就无效了,如果想要保存得住的话,那么就需要保存在一个文件里面

    11,除了修改命令提示符的内容,还可以修改颜色,闪烁,背景色,字体颜色

    12,字体颜色总共就7个数 31-37,31红,32绿,34蓝,35紫色

    /etc/shell

    13,最后的e 0m代表颜色到此结束 Shell Variables

    [root@red-hat-enterprise-linux ~]# echo $SHELL
    /bin/bash
    [root@red-hat-enterprise-linux ~]# cat /etc/shells
    /bin/sh
    /bin/bash
    /sbin/nologin
    /usr/bin/sh
    /usr/bin/bash
    /usr/sbin/nologin
    /bin/tcsh
    /bin/csh
    [root@red-hat-enterprise-linux ~]# /bin/csh
    [root@red-hat-enterprise-linux ~]# echo $SHELL  
    /bin/bash
    [root@red-hat-enterprise-linux ~]# enable   enable bash是内置的
    enable: Command not found.
    [root@red-hat-enterprise-linux ~]# /bin/csh
    [root@red-hat-enterprise-linux ~]# exit
    exit
    [root@red-hat-enterprise-linux ~]# ls
    Desktop    Downloads  Pictures  Templates  anaconda-ks.cfg
    Documents  Music      Public    Videos
    [root@red-hat-enterprise-linux ~]# > f1
    [root@red-hat-enterprise-linux ~]# ls
    Desktop    Downloads  Pictures  Templates  anaconda-ks.cfg
    Documents  Music      Public    Videos     f1
    [root@red-hat-enterprise-linux ~]# /bin/csh
    [root@red-hat-enterprise-linux ~]# > f1
    Invalid null command.
    [root@red-hat-enterprise-linux ~]# ls
    [root@red-hat-enterprise-linux ~]# ll f1    # 大小是0
    -rw-r--r--. 1 root root 0 Apr 16 21:31 f1
    [root@red-hat-enterprise-linux ~]# echo {$SHELL}
    /bin/bash
    [root@red-hat-enterprise-linux ~]# hostname
    red-hat-enterprise-linux.shared
    [root@red-hat-enterprise-linux ~]# echo $PS1
    [u@h W]$
    [root@red-hat-enterprise-linux ~]# man bash search PS1 then prompting
    [root@red-hat-enterprise-linux ~]# echo $PS1  #自己改的井号没有了
    [u@h W]$
    [root@red-hat-enterprise-linux ~]# PS1="{u@H 	}"
    {root@red-hat-enterprise-linux.shared 21:41:00}
    {root@red-hat-enterprise-linux.shared 21:41:05}

    命令提示符

    1,# 管理员 $普通用户

    2,PS1 e 33  u前用户  h主机名简称  H主机名 w当前工作目录  W当前工作目录基名 24小时时间格式  T 12小时工作格式 !命令数历史  #开机后命令历史

    3,PS1=“[e[1;5;41;33m][u@h W]\$[e[0m]”

    4,PS1="[e[31m][u@h W]\$[e[0m]"我最终执行的命令

    5,之前的#出不来是因为在$符号的后面多了一个空格,脚本的严谨性,见识了

    执行命令

    1,命令分为两种,内部命令和外部命令,所谓内部命令指是和shell密切相关的命令

    2,系统只要一登陆,账号只要一登陆,bash就会运行,所谓运行就是已经加载到内存中了

    3,bash程序对应的文件是/bin/bash,bash除了有翻译功能,另外呢bash里面自身还有一些工具,集成在里面,由于bash,开机就运行,那也就意味着,这些程序也开始运行了就,这一部分程序,就叫做内部命令,例如enable

    4,内部命令是集成在shell里面的,也就是bash里面,不同的shell,系统集成的内部命令是不同的

    5,内部命令有哪些呢?敲击enable,列出的所有命令列表,就是所有的内部命令列表

    6,因为内部命令直接在内存中,所以运行内部命令速度非常快的

    7,有很多命令不是在内存中的,他只是在磁盘上的一个文件,就好比/bin/bash,他对应的也是磁盘上的一个物理文件

    8,bin目录里面还有很多绿色的可执行文件,这些文件是需要用户人为的操作的时候才会运行,不会自动加载到内存,所以这部分文件又叫做外部命令

    例如:who,如何查看一个命令是内部命令还是外部命令,我们可以用type命令来看,如果能给出具体的路径就是外部命令,内部命令会给出,是一个shell buildin命令

    [root@red-hat-enterprise-linux ~]$ type who
    who is /usr/bin/who
    [root@red-hat-enterprise-linux ~]$ type enable
    enable is a shell builtin

    9,外部命令既然能直接找到命令的可执行文件,如何办到的呢,肯定不是一个文件一个文件的执行的

    10,找到外部命令确实用到了搜索,但是不是全部去搜索,而是去几个固定路径里面去搜索的,这几个固定路径保存在$PATH变量里面,按照顺序搜索

    [root@red-hat-enterprise-linux ~]$ echo $PATH
    /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin

    11,有个有意思的命令,yes,作用就是不停的敲击y

    12,yes hello它就会不停的敲击hello,这个命令就是干这个的

    13,禁用内部命令 enable -n type,禁用只有再敲击enable就没有这个命令了

    [root@red-hat-enterprise-linux ~]$ enable -n type
    [root@red-hat-enterprise-linux ~]$ type who
    bash: type: command not found...
    [root@red-hat-enterprise-linux ~]$ enable -n  # 查看所有禁用的命令
    enable -n type
    [root@red-hat-enterprise-linux ~]$ enable type
    [root@red-hat-enterprise-linux ~]$ type who
    who is /usr/bin/who

    14,如果一个命令即是内部命令,也是外部命令,那么他会优先去使用内部命令的

    15,help 会列出所有内部命令的基本用法,如果命令前面有星号,就代表该命令已经被禁用了

    16,时间不准确是一个很严重的问题,尤其是到了后面大规模的集群环境的时候,时间非常的关键

    17,同步时间 ntpdate 同步完如果出现offset之类的字样,说明同步成功了

    ntpdate 192,168,X.X  这儿显示的是ntp server 地址
    [root@red-hat-enterprise-linux ~]$ date
    Tue Apr 16 22:11:21 CST 2019
    [root@red-hat-enterprise-linux ~]$ type date
    date is hashed (/usr/bin/date) 

    18,为何修改了外部命令的路径无效呢?缓存,这个动作叫做hash,下次运行的时候,如果内存中有的话,就直接去内存运行而不再去找了,只有第一次修改路径会生效

    19,如何查看已经缓存到内存的命令呢? hash命令 hash -r清除缓存 -l  -p -d

    [root@red-hat-enterprise-linux ~]$ hash
    hash: hash table empty
    [root@red-hat-enterprise-linux ~]$ hash - p /usr/bin/yes no
    [root@red-hat-enterprise-linux ~]$ date
    Tue Apr 16 22:11:21 CST 2019
    [root@red-hat-enterprise-linux ~]$ type date
    date is hashed (/usr/bin/date)
    [root@red-hat-enterprise-linux ~]$ hash
    hits    command
       2    /usr/bin/date
    [root@red-hat-enterprise-linux ~]$ who
    root     pts/0        Apr 16 21:56 (10.211.55.2)
    root     tty2         Apr 16 21:10
    root     tty5         Apr 16 21:10
    root     tty1         Apr 16 21:23
    root     tty6         Apr 16 21:16
    [root@red-hat-enterprise-linux ~]$ hash   
    hits    command
       2    /usr/bin/date
       1    /usr/bin/who
    [root@red-hat-enterprise-linux ~]$ hash
    hits    command
       2    /usr/bin/date
       1    /usr/bin/who
    [root@red-hat-enterprise-linux ~]$ hash -d date   删除
    [root@red-hat-enterprise-linux ~]$ hash
    hits    command
       1    /usr/bin/who

    20,当然hash有效期只限于本次登录,退出再登录就无效了

    21,which命令查看外部命令对应的路径 -a所有路径,不加-a也就是默认只搜索一个

    [root@red-hat-enterprise-linux ~]$ which who
    /usr/bin/who
    [root@red-hat-enterprise-linux ~]$ which -a who
    /usr/bin/who
    [root@red-hat-enterprise-linux ~]$ where is who
    bash: where: command not found...
    [root@red-hat-enterprise-linux ~]$ whereis who
    who: /usr/bin/who /usr/share/man/man1p/who.1p.gz /usr/share/man/man1/who.1.gz

    22,要求上课听懂就行,用得多了,自然就记住了

    23,命令提示符:prompt。# 管理员 ¥ 普通用户

    PS1="{u@H 	}"   #必须有引号
    "/etc/profile.d/env.sh"   # 环境变量
    {root@red-hat-enterprise-linux.shared 21:50:26}PS1='[e[1;5;41;33m][u@h W]\$[e[0m]'
    [root@red-hat-enterprise-linux ~]$
    $PS1='[e[31m][u@h W]\$ [e[0m]'。 最后面一部分不可以少,不然就全部变色了

    24,搜索和使用外部命令的时候,注意缓存的影响,再次登陆,缓存清空

    命令别名

    1,别名也是用的非常多的

    [root@red-hat-enterprise-linux network-scripts]$ alias cdnet ="cd /etc/sysconfig/network-scripts/"  #等号前面有个空格所以失败
    -bash: alias: cdnet: not found
    -bash: alias: =cd /etc/sysconfig/network-scripts/: not found
    [root@red-hat-enterprise-linux network-scripts]$ alias cdnet="cd /etc/sysconfig/network-scripts/"
    [root@red-hat-enterprise-linux network-scripts]$ alias
    alias cdnet='cd /etc/sysconfig/network-scripts/'# 新定义的别名出现了
    alias cp='cp -i'
    alias egrep='egrep --color=auto'
    alias fgrep='fgrep --color=auto'
    alias grep='grep --color=auto'
    alias l.='ls -d .* --color=auto'
    alias ll='ls -l --color=auto'
    alias ls='ls --color=auto'
    alias mv='mv -i'
    alias rm='rm -i'
    alias which='alias | /usr/bin/which --tty-only --read-alias --show-dot --show-tilde'
    [root@red-hat-enterprise-linux network-scripts]$ cd /
    [root@red-hat-enterprise-linux /]$ cdnet
    [root@red-hat-enterprise-linux network-scripts]$

    2,自己定义的别名退出之后再次登陆,就又没有了,要想把变量永久生效,就要写到文件里面,写到规定的文件里面,每个用户的家目录里面有一个点bashrc文件

    3,.bashrc这个文件里面一般会写别名,但是新加入的那一行别名,不会马上生效,最简单的办法,退出再次登陆,可以生效,还有另外一种,就是用点或者source文件使其生效

    [root@red-hat-enterprise-linux ~]$ ls -a
    .              .bash_logout   .cshrc      .ssh       Downloads  Videos
    ..             .bash_profile  .history    .tcshrc    Music      anaconda-ks.cfg
    .ICEauthority  .bashrc        .lesshst    .viminfo   Pictures   f1
    .Xauthority    .cache         .local      Desktop    Public
    .bash_history  .config        .parallels  Documents  Templates
    [root@red-hat-enterprise-linux ~]$ vim .bashrc 
    # .bashrc
    
    # User specific aliases and functions
    
    alias rm='rm -i'
    alias cp='cp -i'
    alias mv='mv -i'
    alias cdnet='/etc/sysconfig/network-scripts/'  #这儿双引号,单引号都可以
    # Source global definitions
    if [ -f /etc/bashrc ]; then
            . /etc/bashrc
    fi

    4,点或者source命令,可以简单的理解成去读取这个文件,读取里面的内容,放到内存里面,放到内存了都,肯定也就生效了

    [root@red-hat-enterprise-linux ~]$ vim .bashrc
    [root@red-hat-enterprise-linux ~]$ . .bashrc
    [root@red-hat-enterprise-linux ~]$ type .
    . is a shell builtin
    [root@red-hat-enterprise-linux ~]$ enable
    enable .
    enable :
    enable [
    enable alias
    enable bg
    enable bind
    enable break
    enable builtin
    enable caller
    [root@red-hat-enterprise-linux ~]$ source .bashrc

    5,点本身是命令吗?是的,是一个内部命令的,查看enable可以看到的

    6,优先级:别名》内部〉外部,尽可能不要让他冲突

    [root@red-hat-enterprise-linux ~]$ alias enable=who
    [root@red-hat-enterprise-linux ~]$ who
    root     :0           Apr 17 14:38 (:0)
    root     pts/0        Apr 17 15:09 (10.211.55.2)
    [root@red-hat-enterprise-linux ~]$ enable
    root     :0           Apr 17 14:38 (:0)
    root     pts/0        Apr 17 15:09 (10.211.55.2)
    [root@red-hat-enterprise-linux ~]$ enable -n who
    who: invalid option -- 'n'
    Try 'who --help' for more information.
    [root@red-hat-enterprise-linux ~]$ unalias enable
    [root@red-hat-enterprise-linux ~]$ enable -n who
    -bash: enable: who: not a shell builtin

    7,echo不是所有的shell都内置,只是保证无论何时都能正常运行echo,所以外部也准备好了

    [root@red-hat-enterprise-linux ~]$ unalias enable
    [root@red-hat-enterprise-linux ~]$ enable -n who
    -bash: enable: who: not a shell builtin
    [root@red-hat-enterprise-linux ~]$ type echo
    echo is a shell builtin
    [root@red-hat-enterprise-linux ~]$ enable -n echo
    [root@red-hat-enterprise-linux ~]$ type echo
    echo is /usr/bin/echo
    [root@red-hat-enterprise-linux ~]$ echo 'hello'
    hello

    /etc/bashrc和及目录的.bashrc

    8,.bashrc默认是放在root的家目录下的,所以只对root账号生效,如果想对所有用户都生效,需要放在/etc/bashrc里面,但是一般不建议更改这个文件,因为这个文件是全局性的文件,影响太大,一般修改影响自己就可以了

    9,别名有时候和原来的命令名称是一样的,输入命令默认是调用别名的,那如何使用原来的命令呢?敲入命令全路径就可以了,但是这种方法只适合外部命令,因为内部命令根本就没有路径可言

    [root@red-hat-enterprise-linux ~]$ alias ls
    alias ls='ls --color=auto'
    [root@red-hat-enterprise-linux ~]$ which ls 别名和原来命令一样
    alias ls='ls --color=auto'
        /usr/bin/ls
    [root@red-hat-enterprise-linux ~]$ /usr/bin/ls    #使用原始的命令,而不是别名
    Desktop    Downloads  Pictures    Templates  anaconda-ks.cfg
    Documents  Music      Public    Videos       f1
    [root@red-hat-enterprise-linux ~]$ /usr/bin/ls --color=auto
    Desktop    Downloads  Pictures  Templates  anaconda-ks.cfg
    Documents  Music      Public    Videos     f1

    10,内部如何使用原始内部命令呢?可以用两个单引号引起原来的命令也可以,或者用斜线也可以的

    [root@red-hat-enterprise-linux ~]$ 'ls'
    Desktop    Downloads  Pictures    Templates  anaconda-ks.cfg
    Documents  Music      Public    Videos       f1
    [root@red-hat-enterprise-linux ~]$ ls
    Desktop    Downloads  Pictures    Templates  anaconda-ks.cfg
    Documents  Music      Public    Videos       f1
    [root@red-hat-enterprise-linux ~]$ "ls"
    Desktop    Downloads  Pictures    Templates  anaconda-ks.cfg
    Documents  Music      Public    Videos       f1
    [root@red-hat-enterprise-linux ~]$ command ls
    Desktop    Downloads  Pictures    Templates  anaconda-ks.cfg
    Documents  Music      Public    Videos       f1

    11,取消别名 unalias ,取消所有别名 unalias -a 当然不要担心,取消只是针对当前这一个terminal的,关掉再次打开,就全都回来了

    [root@red-hat-enterprise-linux ~]$ unalias -a
    [root@red-hat-enterprise-linux ~]$ alias
    [root@red-hat-enterprise-linux ~]$

    12,which 命令默认会显示别名和命令,如果不想显示别名,可以用一个参数 --skip-alias,这些方法在特定的场景都会用到的

    [root@red-hat-enterprise-linux ~]$ which ls
    alias ls='ls --color=auto'
        /usr/bin/ls
    [root@red-hat-enterprise-linux ~]$ which ls --skip-alias
    /usr/bin/ls
    [root@red-hat-enterprise-linux ~]$ which --skip-alias ls  # 不关心别名,只关心路径
    /usr/bin/ls

    命令格式

    1,命令 选项 参数  ,长格式,短格式

    [root@red-hat-enterprise-linux ~]$ ls --all  
    .              .bash_logout   .cshrc      .ssh       Downloads  Videos
    ..             .bash_profile  .history    .tcshrc    Music      anaconda-ks.cfg
    .ICEauthority  .bashrc        .lesshst    .viminfo   Pictures   f1
    .Xauthority    .cache         .local      Desktop    Public
    .bash_history  .config        .parallels  Documents  Templates
    [root@red-hat-enterprise-linux ~]$ ls -a
    .              .bash_logout   .cshrc      .ssh       Downloads  Videos
    ..             .bash_profile  .history    .tcshrc    Music      anaconda-ks.cfg
    .ICEauthority  .bashrc        .lesshst    .viminfo   Pictures   f1
    .Xauthority    .cache         .local      Desktop    Public
    .bash_history  .config        .parallels  Documents  Templates

    2,命令参数有的时候前后顺序是限制的,有的时候无所谓的

    3,命令一直执行不停止,可以按ctrl c 或者ctrl z可以停止,老师说ctrl d有一些命令也可以,例如cat

    4, 不敲击任何命令,按ctrl d相当于退出当前终端,相当于logout,exit

    5,ctrl c是比较强硬的退出,有可能会丢失数据,如果能ctrl d最好ctrl d退出

    6,多个命令可以写在一行,分号隔开就可以了

    [root@red-hat-enterprise-linux ~]$ ls;hostname;id
    Desktop    Downloads  Pictures  Templates  anaconda-ks.cfg
    Documents  Music      Public    Videos     f1
    red-hat-enterprise-linux.shared
    uid=0(root) gid=0(root) groups=0(root) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

    7,一条命令写在多行里面,加 斜线就可以了,命令比较长的话,可以这么干

    [root@red-hat-enterprise-linux ~]$ hos
    > tname
    red-hat-enterprise-linux.shared

    8,换行别忘了加空格

    日期和时间

    1,Linux里面的时间有两个地方会记录下来,一个是系统时钟,Linux内核通过CPU频率记录,一个是硬件时钟,这个大家了解的是,即使不启动Windows,但是开机的时候进入到bios里,时间也是对的,这个就是硬件时钟,这两个时间有可能是不一致的

    2,date命令看到的是当前的系统时间,内核的,说白了也就是软件时间

    3,看主板的硬件时间,需要使用clock命令

    [root@red-hat-enterprise-linux ~]$ date
    Fri Apr 19 10:34:41 CST 2019
    [root@red-hat-enterprise-linux ~]$ clock
    Fri Apr 19 10:34:45 2019  -0.611484 seconds

    4,date是可以改时间的,月日时钟年

    [root@red-hat-enterprise-linux ~]$ date 041910362019.29
    Fri Apr 19 10:36:29 CST 2019

    5,clock -s硬件时间为准,同步系统时间 --hctosys  长格式

    [root@red-hat-enterprise-linux ~]$ date 031003052018.15
    Sat Mar 10 03:05:15 CST 2018
    [root@red-hat-enterprise-linux ~]$ date
    Sat Mar 10 03:05:20 CST 2018
    [root@red-hat-enterprise-linux ~]$ clock
    Fri Apr 19 10:39:22 2019  -0.627667 seconds
    [root@red-hat-enterprise-linux ~]$ clock -s
    [root@red-hat-enterprise-linux ~]$ date
    Fri Apr 19 10:39:32 CST 2019
    [root@red-hat-enterprise-linux ~]$ clock
    Fri Apr 19 10:39:35 2019  -0.252533 seconds

    6,clock -w系统时间为准,硬件时间来进行同步

    7,date +%s当前时间距离1970年1月1日过了多少秒,因为69年unix诞生,所以把70年1月1号作为标准

    [root@red-hat-enterprise-linux ~]$ date +%s
    1555641671

    8,也可以反过来转换

    [root@red-hat-enterprise-linux ~]$ date -d @1555641671
    Fri Apr 19 10:41:11 CST 2019

    时区/etc/localtime

    1,/etc/localtime这个文件里面定义的就是时区,这个文件不是一个文本文件,他不可以直接看的cat无效

    [root@red-hat-enterprise-linux ~]$ ll /etc/localtime
    -rw-r--r--. 1 root root 388 Oct  2  2015 /etc/localtime
    
    [root@red-hat-enterprise-linux ~]$ cat /etc/localtime
    TZif����'p�����Z��6ip ~h�!Iap"^J�#)Cp$Gg%_�&'I&�A�(+(�#�~�p�CDTCSTTZif2
                                                                             ����~6C)������������'p�������������Z��6ip ~h�!Iap"^J�#)Cp$Gg%_�&'I&�A�(+(�#�q�~�pLMTCDTCST
    CST-8

    2,CentOS7上面有一个查 看所有时区命令,叫做timedatectl

    [root@red-hat-enterprise-linux ~]$ timedatectl list-timezones

    3,timedatectl status 查看当前的时区

    [root@red-hat-enterprise-linux ~]$ timedatectl status
          Local time: Fri 2019-04-19 10:46:30 CST
      Universal time: Fri 2019-04-19 02:46:30 UTC
            RTC time: Fri 2019-04-19 02:46:30
           Time zone: n/a (CST, +0800)
         NTP enabled: yes
    NTP synchronized: yes
     RTC in local TZ: no
          DST active: n/a

    4,timedatectl set-timezone 可以设置时区,大小写敏感

    [root@red-hat-enterprise-linux ~]$ timedatectl set-timezone Africa/Juba
    [root@red-hat-enterprise-linux ~]$ timedatectl status
          Local time: Fri 2019-04-19 10:48:10 CST
      Universal time: Fri 2019-04-19 02:48:10 UTC
            RTC time: Fri 2019-04-19 02:48:10
           Time zone: Africa/Juba (CST, +0800)
         NTP enabled: yes
    NTP synchronized: yes
     RTC in local TZ: no
          DST active: n/a

    5,这个命令指示7上面才有的,6上面是没有的

    6,6上面命令是tzselect,先选洲,再选城市,去挑就可以了,其实他和7是一样的,最终修改的都是etc/localtime这个文件

    7,其实时区他对应的真正的文件是/usr/share/zoneinfo/Asia

    [root@red-hat-enterprise-linux share]$ cd zoneinfo
    [root@red-hat-enterprise-linux zoneinfo]$ ls
    Africa      Canada   GB         Indian     Mexico    ROK        iso3166.tab
    America     Chile    GB-Eire    Iran       NZ        Singapore  posix
    Antarctica  Cuba     GMT        Israel     NZ-CHAT   Turkey     posixrules
    Arctic      EET      GMT+0      Jamaica    Navajo    UCT        right
    Asia        EST      GMT-0      Japan      PRC       US         zone.tab
    Atlantic    EST5EDT  GMT0       Kwajalein  PST8PDT   UTC
    Australia   Egypt    Greenwich  Libya      Pacific   Universal
    Brazil      Eire     HST        MET        Poland    W-SU
    CET         Etc      Hongkong   MST        Portugal  WET
    CST6CDT     Europe   Iceland    MST7MDT    ROC       Zulu
    [root@red-hat-enterprise-linux zoneinfo]$ pwd
    /usr/share/zoneinfo

    8,发现后面这两个文件时一样大的,其实就是设时区的时候,把文件指向需要的那个时区文件而已,实际上就是软连接或者硬连接实现的,后面会讲

    [root@red-hat-enterprise-linux zoneinfo]$ ll /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
    -rw-r--r--. 1 root root 388 Oct  2  2015 /etc/localtime
    -rw-r--r--. 5 root root 388 Oct  2  2015 /usr/share/zoneinfo/Asia/Shanghai
    [root@red-

    日历

    1,这个月的日历cal

    [root@red-hat-enterprise-linux zoneinfo]$ cal
         April 2019
    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

    2,查看某一年的日历cal 2019

    3,过去某一年某一月的日历cal 8 2018

    [root@red-hat-enterprise-linux zoneinfo]$ cal 8 2013
         August 2013
    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

    4,cal 9 1752这个月是有误差的,因为他要靠这个月来调整误差的中间一下子少了好多天,我们现在可能也有误差,累积很多年就要调整了

    [root@red-hat-enterprise-linux zoneinfo]$ cal 9 1752
       September 1752
    Su Mo Tu We Th Fr Sa
           1  2 14 15 16
    17 18 19 20 21 22 23
    24 25 26 27 28 29 30

    简单命令

    1,之前讲过关机就是halt,shutdown,

    2,重启reboot,其实reboot也可以用来关机,加一个参数 reboot -p  强制关机时 reboot -f

    3,比较专业的关机命令:shutdown 可以关机-h,重启-r,取消关机-c

    4,window也有shutdown命令,如果在下载一个大文件,很久才可以下载完,可以执行一个命令,两个小时后关机

    5,设定了5分钟后关机,终端一直执行这个命令不退出得话,可以执行ctrl c退出 shutdown -r +5,不加默认为+1,立刻的话是now,

    [root@red-hat-enterprise-linux zoneinfo]$ shutdown -r +5
    Shutdown scheduled for Fri 2019-04-19 11:00:55 CST, use 'shutdown -c' to cancel.
    [root@red-hat-enterprise-linux zoneinfo]$
    Broadcast message from root@red-hat-enterprise-linux.shared (Fri 2019-04-19 10:55:55 CST):
    
    The system is going down for reboot at Fri 2019-04-19 11:00:55 CST!
    [root@red-hat-enterprise-linux ~]$ shutdown -r 18:30 'reboot at time 18:30'
    Shutdown scheduled for Sat 2019-04-20 18:30:00 CST, use 'shutdown -c' to cancel.
    [root@red-hat-enterprise-linux ~]$

    6,设定了关机,所有打开的终端都能看到的

    System is going down.
    
    Last login: Fri Apr 19 10:23:08 2019 from 10.211.55.2
    -bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
    [root@red-hat-enterprise-linux ~]$
    Broadcast message from root@red-hat-enterprise-linux.shared (Fri 2019-04-19 10:56:55 CST):
    
    The system is going down for reboot at Fri 2019-04-19 11:00:55 CST!
    
    shutdown -c
    
    Broadcast message from root@red-hat-enterprise-linux.shared (Fri 2019-04-19 10:57:12 CST):
    
    The system shutdown has been cancelled at Fri 2019-04-19 10:58:12 CST!
    
    [root@red-hat-enterprise-linux ~]$

    7,可以通过命令 shutdown -c 来取消关机

    8,也可以明确指定几点几分关机

    9,关机时可以➕提示消息,比方说,机器在几点几分要关机了,请大家及时保存手头的工作内容

    [root@red-hat-enterprise-linux ~]$ shutdown -r +5 'system is going to poweroff in 5mins'
    Shutdown scheduled for Fri 2019-04-19 11:04:06 CST, use 'shutdown -c' to cancel.
    [root@red-hat-enterprise-linux ~]$
    Broadcast message from root@red-hat-enterprise-linux.shared (Fri 2019-04-19 10:59:06 CST):
    
    system is going to poweroff in 5mins
    The system is going down for reboot at Fri 2019-04-19 11:04:06 CST!

    10,一般维护工作得话,还是加上提示消息比较好

    11,如果提示消息为中文,那么可能secureCRT显示正常,但是原来系统终端不可以,那是因为,原系统不支持中文,但是SecureCRT是支持中文的

    12,打印现在系统语言 echo $LANG

    [root@red-hat-enterprise-linux zoneinfo]$ echo $LANG
    en_US.UTF-8

    /etc/sysconfig/i18n

    13,有个文件记录了系统的语言/etc/sysconfig/i18n

    14,修改为zh_CN.UTF-8

    15,让刚修改的变量生效 点运行一下

    16,wall命令是用来发广播的,发通知的,只要登陆到这台机器的人,都可以收到

    [root@red-hat-enterprise-linux zoneinfo]$ wall '你好'
    
    Broadcast message from root@red-hat-enterprise-linux.shared (pts/2) (Fri Apr 19 11:00:45 2019):
    
    你好

    17,如果没有安装中文包得话显示还是有问题的,即使设置字体是中文的

    screen

    1,一个有意思的命令,screen,以后工作中可能会用到

    2,远程协助,Windows可以用QQ,Windows还可以用VNC,这个Linux也支持的,VNC只可以支持图形界面,字符界面就不可以了

    3,字符界面远程协助

    4,screen软件需要单独进行安装的,图形方式老师就不介绍了,先说命令形式安装

    5,所有的安装包都在光盘里面呢,sr0 找到他的挂载目录,也就是挂载点,df或者lsblk,里面的packages

    6, df -- display free disk space 查看此盘列表

    [root@red-hat-enterprise-linux zoneinfo]$ df -h
    Filesystem                    Size  Used Avail Use% Mounted on
    /dev/mapper/VolGroup-lv_root   50G  3.7G   43G   8% /
    devtmpfs                      480M     0  480M   0% /dev
    tmpfs                         495M  8.0K  495M   1% /dev/shm
    tmpfs                         495M  6.8M  488M   2% /run
    tmpfs                         495M     0  495M   0% /sys/fs/cgroup
    /dev/sda1                     477M  133M  315M  30% /boot
    /dev/mapper/VolGroup-lv_home   12G   41M   11G   1% /home
    Home                          466G   72G  395G  16% /media/psf/Home
    iCloud                        466G   72G  395G  16% /media/psf/iCloud
    tmpfs                          99M   28K   99M   1% /run/user/0
    /dev/sr0                      152M  152M     0 100% /run/media/root/CDROM
    [root@red-hat-enterprise-linux zoneinfo]$ lsblk
    NAME                 MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
    sda                    8:0    0   64G  0 disk
    |-sda1                 8:1    0  500M  0 part /boot
    `-sda2                 8:2    0 63.5G  0 part
      |-VolGroup-lv_root 253:0    0   50G  0 lvm  /
      |-VolGroup-lv_swap 253:1    0    2G  0 lvm  [SWAP]
      `-VolGroup-lv_home 253:2    0 11.5G  0 lvm  /home
    sr0                   11:0    1  152M  0 rom  /run/media/root/CDROM
    sr1                   11:1    1 1024M  0 rom

    7,package里面有很多红色的rpm后缀的安装包文件

    8,直接敲击这个命令 rpm -ivh screen 后面的敲击TAB键补全就行,也可以敲击全路径安装

    9,图形界面必须登陆才会自动挂载的,不登陆不会自动挂载的,登陆Lisa,路径里面就不会显示root了

    10,如果上来登陆的不是图形界面,不会自动挂载的,除非是图形界面才可以

    11,另外6和7的自动挂载路径是不一致的

    12,screen -S 会话名称,创建一个新回话,注意S必须是大写,加入会话screen -ls ,screen -x 加入到某个会话名称

    [root@redhat7 ~]#screen -ls
    There are screens on:
            17868.lisa      (Attached)
            17626.l (Attached)
    2 Sockets in /var/run/screen/S-root.

    13,退出全部会话,exit,如果只是想退出自己的会话,这时候screen就不存在了,ctrl a然后同时按d,那么当前的终端就临时detach了其他的这个终端还在,如果所有的终端都临时退出,就是显示detach状态,只要有一个终端还连着就不是 detach的

    [root@redhat7 ~]#screen -S lisa
    [detached from 20258.lisa]
    [root@redhat7 ~]#screen -ls
    There is a screen on:
        20258.lisa    (Attached)
    1 Socket in /var/run/screen/S-root.
    
    [root@redhat7 ~]#screen -ls
    There is a screen on:
        20258.lisa    (Detached)
    1 Socket in /var/run/screen/S-root.

    14,临时退出的话,会话其实还保留着的,只不过没有人在里面了

    15,这时候查看screen -ls 回现实detach的状态,这时候想要再加进来,screen  r就又回来了

    [root@redhat7 ~]#screen -r lisa

    16,screen的另外一个好处,比方说我想要一个备份,需要一小时或者半小时,不希望中间断网,怎么办呢?开个回话就好了

    [root@redhat7 ~]#screen -ls
    There is a screen on:
        17868.lisa    (Dead ???)
    Remove dead screens with 'screen -wipe'.
    1 Socket in /var/run/screen/S-root.

    17,避免连接中断无法执行

    18,彻底退出screen 用exit命令,临时退出一会还想要进去的是ctrl a 同时按下d

    echo

    1,echo最基本的功能就是显示字符串

    2,这个字符串也可以显示一些扩展功能,需要加一个e选项开启扩展功能

    [root@red-hat-enterprise-linux zoneinfo]$ echo 'hello'
    hello
    [root@red-hat-enterprise-linux zoneinfo]$ echo 'hello
    '
    hello
    
    [root@red-hat-enterprise-linux zoneinfo]$ echo -e 'hello
    '
    hello
    
    [root@red-hat-enterprise-linux zoneinfo]$

    3,回显,就是把后面跟的字符串重新显示一遍,类似雷达

    4,echo v c(取消换行)

    [root@red-hat-enterprise-linux zoneinfo]$ echo -e 'helloc'
    hello[root@red-hat-enterprise-linux zoneinfo]$
    [root@red-hat-enterprise-linux zoneinfo]$ echo -e 'hel	lo'
    hel    lo
    [root@red-hat-enterprise-linux zoneinfo]$ echo -e 'helvlovmam'
    hel
       lo
         mam

    5,还可以发出声音 a,可以加在一个长时间任务的后面,用来提醒任务已经完成了,前提声卡要打开的,

    [root@red-hat-enterprise-linux zoneinfo]$ echo -e 'a'
    [root@red-hat-enterprise-linux zoneinfo]$ echo -e 'aaa
    bb'
    bba
    [root@red-hat-enterprise-linux zoneinfo]$ echo -e 'aaa
    bb'
    aaa
    bb

    6,bc是一个linux里面的计算器,可以指定ibash obash输入输出运算,可以做简单运算,也可以做指数运算,quit可以退出

    7,hexdump这儿的0a其实AscII码是10,10代表的是换行

    [root@red-hat-enterprise-linux zoneinfo]$ whatis hexdump
    whatis: can't set the locale; make sure $LC_* and $LANG are correct
    hexdump (1)          - display file contents in ascii, decimal, hexadecimal, ...
    [root@red-hat-enterprise-linux zoneinfo]$ hexdump -c f1
    0000000   a  
       b  
       c  
       d  
      
    
    0000009
    [root@red-hat-enterprise-linux zoneinfo]$ hexdump -C f1
    00000000  61 0a 62 0a 63 0a 64 0a  0a                       |a.b.c.d..|
    00000009
    [root@red-hat-enterprise-linux zoneinfo]$ man hexdump
    man: can't set the locale; make sure $LC_* and $LANG are correct

    8,nnn八进制,xhh十六进制

    [root@red-hat-enterprise-linux ~]$ whatis bc
    whatis: can't set the locale; make sure $LC_* and $LANG are correct
    bc (1p)              - arbitrary-precision arithmetic language
    bc (1)               - An arbitrary precision calculator language
    [root@red-hat-enterprise-linux ~]$ 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'.
    ibase=16
    97
    151
    [root@red-hat-enterprise-linux ~]$ 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'.
    2+3
    5
    2^4
    16
    [root@red-hat-enterprise-linux ~]$ echo -e '141'
    a
    [root@red-hat-enterprise-linux ~]$ echo -e '142'
    b
    [root@red-hat-enterprise-linux ~]$ echo -e 'x61'
    a

    9,echo还可以打印带有颜色的

    /etc/motd

    10,每次登陆到系统,我们希望有一些提示信息,如何操作呢?这个有个文件可以实现的,叫做/etc/motd,这个文件默认是空的,但是你可以往里面写东西的,写进去再次登陆就可以有提示信息了

    Last login: Fri Apr 19 10:56:46 on ttys000
    ➜  ~ ssh root@10.211.55.4
    root@10.211.55.4's password:
    Last login: Fri Apr 19 10:56:51 2019 from 10.211.55.2
    welcome,lisa,nice day
    -bash: warning: setlocale: LC_CTYPE: cannot change locale (UTF-8): No such file or directory
    [root@red-hat-enterprise-linux ~]$

    11,这个在etc下的,是一个统一的登陆提示,所有用户登陆都可以有提示的

    12,佛祖保佑,上传新的motd文件可以修改登录后的显示

    echo命令行扩展:¥()或者‘’  ``

    1,最后这个符号大家可能不怎么常用,反向单引号

    2,echo echo

    3,只是打印单纯的普通字符串 不加,加单引号,加双引号,加反向单引号

    4,要善于运用反向单引号,当一个命令调用另外一个命令的输出的时候,用反向单引号,他和$符号是等价的

    5,生成一个日期为名称的文件, 命名套命令,反向单引号是非常好用的

    6,总结,双引号,不加得话相当于双引号:命令不管,变量会识别,不加相当于单引号,单引号:都不认,最傻,老老实实字符串,反向单引号:都可以识别,最聪明

    [root@red-hat-enterprise-linux ~]$ echo echo '1'
    echo 1
    [root@red-hat-enterprise-linux ~]$ echo `echo '1'`
    1 
    [root@red-hat-enterprise-linux ~]$ echo myhostname is $(hostname)
    myhostname is red-hat-enterprise-linux.shared
    [root@red-hat-enterprise-linux ~]$ touch `date +%F`.log
    [root@red-hat-enterprise-linux ~]$ ls
    2019-04-19.log  Documents  Music     Public     Videos
    Desktop         Downloads  Pictures  Templates  anaconda-ks.cfg
    [root@red-hat-enterprise-linux ~]$ cp `which ls --skip-alias` /data
    [root@red-hat-enterprise-linux ~]$ ls
    2019-04-19.log  Documents  Music     Public     Videos
    Desktop         Downloads  Pictures  Templates  anaconda-ks.cfg
    [root@red-hat-enterprise-linux ~]$ cd /date
    -bash: cd: /date: No such file or directory
    [root@red-hat-enterprise-linux ~]$ cd /data
    -bash: cd: /data: Not a directory
    [root@red-hat-enterprise-linux ~]$ cd /
    [root@red-hat-enterprise-linux /]$ ls
    bin   data  etc   lib    lost+found  mnt  proc  run   srv  tmp  var
    boot  dev   home  lib64  media       opt  root  sbin  sys  usr
    [root@red-hat-enterprise-linux /]$ vim data
    [root@red-hat-enterprise-linux /]$ file data
    data: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.32, BuildID[sha1]=51a5b306835b4cf6517b22651245266ee0d8a8da, stripped

    echo括号扩展{}

    1,打印重复字符串的简化形式

    2,表示范围{a..e},中间必须是两个点{20..10},{0..10}

    3,还可以设置步长{0..10..2}

    4,{a..Z}按照Ascii码把中间的显示出来

    [root@red-hat-enterprise-linux /]$ echo {a,b,c}
    a b c
    [root@red-hat-enterprise-linux /]$ echo {a..h}
    a b c d e f g h
    [root@red-hat-enterprise-linux /]$ echo {1..10}
    1 2 3 4 5 6 7 8 9 10
    [root@red-hat-enterprise-linux /]$ echo {10..1}
    10 9 8 7 6 5 4 3 2 1
    [root@red-hat-enterprise-linux /]$ echo {10..1..2}
    10 8 6 4 2
    [root@red-hat-enterprise-linux /]$ echo {10..1..-2}
    10 8 6 4 2
    [root@red-hat-enterprise-linux /]$ echo {a..F}
    a ` _ ^ ]  [ Z Y X W V U T S R Q P O N M L K J I H G F
    [root@red-hat-enterprise-linux /]$

    5,echo file{a,b,c}

    [root@red-hat-enterprise-linux /]$ echo file{a..d}
    filea fileb filec filed

    6,echo还支持笛卡尔成绩

    [root@red-hat-enterprise-linux /]$ echo file{a..d}.{1..3}
    filea.1 filea.2 filea.3 fileb.1 fileb.2 fileb.3 filec.1 filec.2 filec.3 filed.1 filed.2 filed.3

    7,touch /data/file{a,b,c}.{log,txt} ,注意不要多加空格

    [root@red-hat-enterprise-linux /]$ touch /data/file{1..3}
    [root@red-hat-enterprise-linux /]$ ls /data
    file1  file2  file3
    [root@red-hat-enterprise-linux /]$ rm -f file*

    Tab键补全

    1,有一些命令当你把命令敲全了,这时候,再按两个TAB键,他会把相关的子命令用法给出来,例如nmcli,不需要刻意记,会TAB键,一按就都出来了

    [root@red-hat-enterprise-linux /]$ en
    enable         enchant-lsmod  env
    enchant        enscript       envsubst
    [root@red-hat-enterprise-linux /]$ nmcli
    agent       device      help        radio
    connection  general     networking

    2,根下面,也就是斜杠下面敲两个TAB键,会显示出根目录下的所有文件

    3,./2TAB键显示当前目录下的所有文件,包含隐藏,它显示的是文件夹,没有显示文件

    [root@red-hat-enterprise-linux ~]$ ./。包含隐藏
    .cache/     Documents/  Music/      Public/     Videos/
    .config/    Downloads/  .parallels/ .ssh/
    Desktop/    .local/     Pictures/   Templates/
    [root@red-hat-enterprise-linux ~]$ *   不包含隐藏文件
    Desktop    Downloads  Pictures   Templates
    Documents  Music      Public     Videos
    

    4,~两个TAB列出用户账户

    [root@red-hat-enterprise-linux ~]$ ~
    ~abrt/                ~lisa/                ~root/
    ~adm/                 ~lp/                  ~rpc/
    ~avahi/               ~mail/                ~rpcuser/
    ~avahi-autoipd        ~nfsnobody/           ~rtkit/
    ~bin/                 ~nobody/              ~saslauth
    ~chrony/              ~nscd/                ~setroubleshoot/
    ~colord/              ~nslcd/               ~shutdown/
    ~daemon/              ~ntp/                 ~sshd/
    ~dbus/                ~operator/            ~sssd/
    ~ftp                  ~oprofile             ~sync/
    ~games/               ~pcp/                 ~systemd-bus-proxy/
    ~gdm/                 ~polkitd/             ~systemd-network/
    ~geoclue/             ~postfix/             ~tcpdump/
    ~gnome-initial-setup  ~pulse                ~tss
    ~halt/                ~qemu/                ~unbound/
    ~libstoragemgmt/      ~radvd/               ~usbmuxd/

    5,$2TAB显示所有变量

    [root@red-hat-enterprise-linux ~]$ 
    $_
    $ABRT_DEBUG_LOG
    $_backup_glob
    $BASH
    $BASH_ALIASES
    $BASH_ARGC
    $BASH_ARGV
    $BASH_CMDS
    $BASH_COMMAND
    $BASH_COMPLETION_COMPAT_DIR
    $BASH_LINENO
    $BASHOPTS
    $BASHPID
    $BASH_REMATCH

    6,*2TB,列出所有,不保存隐藏文件

    命令行历史

    1,history是一个内部命令

    [root@red-hat-enterprise-linux ~]$ type history
    history is a shell builtin

    2,HISTSIZE,决定默认只保留历史的1000条,多了就开始丢了

    3,如果想要修改,需要修改一个文件 /etc/profile,也可以直接给变量赋值修改,但是这样该下次登陆就没了,需要改文件才可以的

    4,命令历史记录在一个文件中,新输入的只是存在缓存里,只有退出时,会存入这个文件,

    5,这个文件在家目录的.bash_history,这个文件不是实时更新的

    6,如果不正常关机,突然断电,那么这个历史就不会正常写入了,就会丢一部分信息了,所以我们要正常关机

    7,利用历史重复前面的操作,有四种方法:!n  正着数,!-n倒着数

    [root@red-hat-enterprise-linux ~]$ !-5
    ls
    2019-04-19.log  Documents  Music     Public     Videos
    Desktop         Downloads  Pictures  Templates  anaconda-ks.cfg

    8,重复上一条命令四种方法:上下方向键,!!,  !-1, ctrl+p

    9,!:0  上一条命令,去除掉参数

    [root@red-hat-enterprise-linux ~]$  id -u lisa
    1000
    [root@red-hat-enterprise-linux ~]$ id
    uid=0(root) gid=0(root) groups=0(root) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
    [root@red-hat-enterprise-linux ~]$  id -u lisa
    1000
    [root@red-hat-enterprise-linux ~]$ !:0
    id
    uid=0(root) gid=0(root) groups=0(root) context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023

    10,!string,最近的以string开头的命令

    [root@red-hat-enterprise-linux ~]$ !ty
    type history
    history is a shell builtin

    11,!?string,最近的包含string的命令

    [root@red-hat-enterprise-linux ~]$ !? lisa
     id -u lisa
    1000

    12,!string:p  打印命令历史不执行

    13,!$:p  打印上一条命令的最后一个参数,如果最后一个参数超级长,这种方式可以大大提高工作效率,但是执行的时候要慎用

    [root@red-hat-enterprise-linux ~]$ ll /etc/motd
    -rw-r--r--. 1 root root 22 Apr 19 11:27 /etc/motd
    [root@red-hat-enterprise-linux ~]$ cat !$
    cat /etc/motd
    welcome,lisa,nice day

    14,!*:p 打印上一条命令的所有参数

    15,^string 删除上一条命令的第一个 string

    [root@red-hat-enterprise-linux ~]$ echo a,b,c
    a,b,c
    [root@red-hat-enterprise-linux ~]$ ^a
    echo ,b,c
    ,b,c
    [root@red-hat-enterprise-linux ~]$ ^echo
     ,b,c
    bash: ,b,c: command not found...

    16,^string1^string2 将上一条命令的string1替换为string2,只替换一个

    [root@red-hat-enterprise-linux ~]$ touch /data/f1 /data/f2
    [root@red-hat-enterprise-linux ~]$ touch /root/f1 /root/f2
    [root@red-hat-enterprise-linux data]$ touch /data/f1 /data/f2
    [root@red-hat-enterprise-linux data]$ ^data^root
    touch /root/f1 /data/f2
    [root@red-hat-enterprise-linux data]$ ls
    f1  f2  file1  file2  file3
    [root@red-hat-enterprise-linux data]$ cd /root
    [root@red-hat-enterprise-linux ~]$ l
    bash: l: command not found...
    [root@red-hat-enterprise-linux ~]$ ls
    2019-04-19.log  Documents  Music     Public     Videos           f1
    Desktop         Downloads  Pictures  Templates  anaconda-ks.cfg
    [root@red-hat-enterprise-linux ~]$

    17,!:gs/string1/string2 所有string1替换为string2,命令长的时候用,如果命令比较短,还不如直接改一下

    [root@red-hat-enterprise-linux ~]$ !:gs/data/mnt # 没有空格,注意一下
    touch /mnt/f1 /mnt/f2

    18,ctrl + r 在命令历史中搜索,ctrl + g退出命令搜索

    19,调用前一个命令的最后一个参数 !$,还有两种 ESC松手然后点击点键,第二种,ALT不松手按点

    20,SecureCRT有时候ALT键没有启用,需要终端设置一下,用的多了就记住了

    调用历史参数

    1,!^   !$  !*  !:n   利用上一个命令的第一个,最后一个,全部,第n个参数

    2,!n:^  !n:$  !n:m  !m:*  调用第n条命令的第一个,最后一个,全部,第n个参数

    3,!string:^   !string:$   !string:n  !string:*  从命令历史中搜索以string开头的第一个,最后一个,全部,第n个参数

    获得帮助

    1,获取帮助的能力决定了技术的能力

    2,多种方法

    1,whatis

    1,外部命令,命令的简要说明

    [root@red-hat-enterprise-linux ~]$   type whatis
    whatis is /usr/bin/whatis
    [root@red-hat-enterprise-linux ~]$ whatis rm
    whatis: can't set the locale; make sure $LC_* and $LANG are correct
    rm (1p)              - remove directory entries
    rm (1)               - remove files or directories

    2,刚装好的系统,whatis可能不好用,因为whatis显示的这些信息是从数据库里面取出来的

    3,这个数据库装好系统后需要等一段时间才可以,可以手工创建数据库,版本6,makewhatis 版本7   mandb

    4,whatis cal 和man -f cal这两个写法是一致的

    [root@red-hat-enterprise-linux ~]$ whatis cal
    whatis: can't set the locale; make sure $LC_* and $LANG are correct
    cal (1p)             - print a calendar
    cal (1)              - display a calendar
    [root@red-hat-enterprise-linux ~]$ man -f cal
    man: can't set the locale; make sure $LC_* and $LANG are correct
    cal (1p)             - print a calendar
    cal (1)              - display a calendar

    2,命令帮助

    内部命令

    1,help command

    2,history  -c 这个清空的只是内存,缓存,并没有清空点bash_history这个文件,当用户登陆的时候,会再次去读取这个文件,但是会丢掉一部分,丢的那部分就是还没有来得及写入文件的那部分

    3,因为这个文件并不是实时的,只有退出的时候,才会写入

    4,删除得话,先删除文件,在清空缓存,姿势很重要

    5,history -d offset删除那条历史

    [root@red-hat-enterprise-linux ~]$ history -d 203

    6,history -a,追加本次会画新执行的命令历史列表至历史文件

    7,-r 读取历史文件,追加到内存中,比如你清空了历史,又想写回来

    8,-w 也是把命令历史写入历史文件,并读入内存

    9,-n 把历史中没有读入内存的命令,读入内存,比方说又另外一个人在另外一个客户端执行写入文件的命令我也想看就可以遮掩个操作的

    10,history n 显示n条命令

    11,-p 无痕执行命令

    [root@red-hat-enterprise-linux ~]$  history -c
    [root@red-hat-enterprise-linux ~]$ history -p `id` `whoami`
    uid=0(root)
    gid=0(root)
    groups=0(root)
    context=unconfined_u:unconfined_r:unconfined_t:s0-s0:c0.c1023
    root
    [root@red-hat-enterpri

    12,-s  伪造历史,没执行但是写入历史

    [root@red-hat-enterprise-linux ~]$ history -s 'rm -rf /*'
    [root@red-hat-enterprise-linux ~]$ history
        1  history
        2  rm -rf /*
        3  history

    13,内部命令有个缺点就是给出的帮助有时候不是很全,最全面的我们要去man bash查看

    外部命令

    1,bash本身是个外部命令,外部命令我们一般都是用man来帮助

    2,--help或者-h,有的支持有的不支持

    3,[option]中括号表示的是可选项

    4,[a|b|c]竖线表示的是选其中的一个

    5,ls [OPTION]...[FILE]...代表选项可以加多个,文件也可以选多个

    6,[+FORMAT] 中括号还是可选项的意思,FORMAT的格式后面会有详细介绍 {} 表示分组 CAPS或<>,表示变化的数据

    7,date

    [root@red-hat-enterprise-linux ~]$ date -d now
    Fri Apr 19 13:06:38 CST 2019
    [root@red-hat-enterprise-linux ~]$ date --date=now
    Fri Apr 19 13:06:45 CST 2019
    [root@red-hat-enterprise-linux ~]$ date
    Fri Apr 19 13:06:50 CST 2019

    8,显示昨天的日期

    [root@red-hat-enterprise-linux ~]$ touch `date -d 'yesterday' +%F`.log
    [root@red-hat-enterprise-linux ~]$ touch `date -d '-10 day' +%F`.log
    [root@red-hat-enterprise-linux ~]$ touch `date -d '+10 day' +%F`.log
    [root@red-hat-enterprise-linux ~]$ ls
    2019-04-09.log  2019-04-29.log  Downloads  Public     anaconda-ks.cfg
    2019-04-18.log  Desktop         Music      Templates  f1
    2019-04-19.log  Documents       Pictures   Videos

    9,设置为昨天的时间

    [root@red-hat-enterprise-linux ~]$ date -s '-1 day'

    10,显示当前时间

    [root@red-hat-enterprise-linux ~]$ date '+%F %T'
    2019-04-19 13:12:24
    [root@red-hat-enterprise-linux ~]$ date +'%F %T'
    2019-04-19 13:12:47

    11,显示前天是星期几

    [root@red-hat-enterprise-linux ~]$ date -d '-2 day'  '+%A'
    Wednesday

    12,设置当前的日期

    [root@red-hat-enterprise-linux ~]$ date 080706052019.10
    Wed Aug  7 06:05:10 CST 2019

    查看帮助信息

    1,Linux里面不同类型的命令,或者不同类型的资源,他是放在不同的章节里面的,whatis 除了给出命令功能的简单介绍,也给出了章节编号

    2,系统在man帮助里面分成了九大章节,

    3,2章,3章是开发人员才会关心的

    4,4章设备文件以特殊文件,类似/dev/sda下面很多硬件相关的文件,就是设备相关的文件,/dev/sda就是一个设备文件,颜色都不一样

    5,配置文件格式,这个是运维人员比较关心的文件,类似/etc/passwd这样的文件

    6,6章游戏,7章杂项,8章管理类的命令,9章,Linux内核API相关的

    7,文件本身是压缩文件,我们直接man 命令就可以了

    8,内部命令帮助 help command,man bash

    9,外部命令帮助 只可以用 command --help 或者-h但是短格式有时候有特殊含义,需要注意

    10,所有的外部命令,最常用的帮助形式是 man command

    11,我们以前敲过这个命令 whereis ls 它比which ls给出来的多的那部分,就是man帮助信息文档路径

    12,man帮助文档再/usr/share/man里面,里面所有的带有P和X的就是开发相关的,我们不需要关心他的

    13,理论上来说,我们写帮助的时候,要写上对应的章节号码,但是很多命令都只有一章里面才有,所以就不需要再写上章节号了

    14,打开后,看帮助的最做上方,会给出数字,这个数字就是对应的章节号码,命令简介,格式,参数,包括退出状态都会有

    passwd

    1,这个命令用来修改用户自己的口令,输入这个命令回车,输入新密码即可

    2,这个命令除了可以改自己的口令,也可以改别人的口令,前提要是管理员 passwd lisa

    3,man passwd 再有些场景下查询是有问题的,因为passwd 他本身是个命令,而且他也是个文件名称 /etc/passwd

    4 ,前者是个二进制的程序,后者是一个文本文件

    5,man帮助文档的信息在第五章,所以/etc/passwd前面需要加上参数5,用whatis passwd就可以看出来区别了,man 5 passwd

    6,章节号必要的时候要指定,但是我怎么知道这个章节号码什么时候有呢?用whatis可以查询章节号

    man帮助段落说明

    /etc/issue

    1,登陆前的提示信息文件:/etc/issue,上午的大佛是登陆后的提示信息etc/motd

    2, 对应于内核版本,m对英语CPU架构,所以看来这个issue文件还是有一定的格式的,我们可以通过man来查看一下

    3,man 5 issue不过这个帮助信息太简单了,只说会包含一些信息,但是具体哪些信息,又没有说

    4,see also 给出了别的文件,就是说我们可以参考别的文件的帮助信息来查看一下

    5,还没登陆的先别欢迎,黑客,官司输了

    6,改完不需要重新登陆,ctrl d刷新一下就可以了

    7,中括号可选内容,尖括号必选内容,打括号分组,点点点 同一内容出现多次

    8,name:名称以及简要说明,SYNOPSIS用法格式说明,description详细说明,options选项参数说明,files相关文件,see also 其他帮助参考

    man -a passwd列出所有帮助,比如第一章,第五章都有的话

    1,这个他也不是一下子全部列出来,先列出第一章,然后Q退出列第五章,在Q才会完整退出

    man -k  password 

    1,只要命令或者说明里面带有password的,就全部给列出来,他回去搜索整个数据库,简单做一个过滤,可以看一下,哪些是想得到的,哪些不是

    2,相当于whatis ,注意和whereis区分,man -w ls 也是一个意思,打印 man 帮助路径,whereis 后面的那一部分

    [root@red-hat-enterprise-linux ~]$ man -w ls
    man: can't set the locale; make sure $LC_* and $LANG are correct
    /usr/share/man/man1/ls.1.gz
    [root@red-hat-enterprise-linux ~]$ whereis ls
    ls: /usr/bin/ls /usr/share/man/man1p/ls.1p.gz /usr/share/man/man1/ls.1.gz

    3,bash的帮助信息,就超级多了,需要那个去搜索就好了

    man命令历史相关环境变量

    etc/profile

    1,HISTSIZE,etc/profile里面有一行记录,如果把profile里面的这个变量删除了,他默认就是500了,这个500是在history的帮助里面介绍的,至于500哪儿定义的,老师还没有说,查看etc的帮助的时候,必须写成/etc/profile,即使已经进了该目录,只写profile也是不行的

    [root@redhat7 etc]$ man profile
    man: can't set the locale; make sure $LC_* and $LANG are correct
    No manual entry for profile
    [root@redhat7 etc]$ man /etc/profile
    man: can't set the locale; make sure $LC_* and $LANG are correct

    2,HISTTIMEFORMAT默认就是数字加上时间,我们可以对其进行修改,加上时间啥的

    etc/profile.d/env.sh

    etc/profile.d/env.sh

    3,修改的格式想要永久生效,需要写入env.sh etc/profile.d/env.sh

    ~/.bash_history

    4,HISTFILE格式修改以后,~/.bash_history 格式也变了,历史文件默认往这个文件写,当然也可以对其进行修改

    5,HISTFILESIZE这个改的是文件里面记录的历史记录条数

    6,HISTIGNORE=‘hostname:w*’,忽略hostname历史,或者以w开头的历史,就是有些不想记入历史,这个是一个冒号colon分割的列表,逗号comma

    7,家里这条,后面再敲击的hostname就不会记录进历史了

    8,想要永久生效,需要写入env注意, 后缀必须是sh,但是文件名称可以随便起

    9,HISTCONTROL其实和HISTIGNORE是差不多的,他们都是为了控制哪些写入历史,哪些不写入

    10,默认的是ignoredups,忽略重复的,所谓的重复,指的是,连着敲击几条一模一样的是不会记录的

    11,ignorespace是以空格开头的命令不计入历史

    12,如果觉得有些命令比较敏感,不想让人看到,就加空格就好了

    13,ignoreboth 相当于前面两个之和,相当于重复命令不计入,以空格开头的也不计入

    14,erasedups删除重复命令,他的意思是说,只要是history里面有重复的命令,他就给你删除了,只留一个

    15,这些变量想要让他永久生效,都要写在文件里面,但是不建议写入到/etc/profile,我们建议自己建一个文件,因为自己建立一个文件的话,到时候管理起来方便,删除添加啥的都没问题,不会影响别人

    16,如果直接改/etc/profile 这个文件,这个文件呢,内容特别多,万一不小心改错了,都不知道原来啥样

    17,man帮助里面的帮助,他列出了所有和内部命令相关的帮助,因为bash里面就集成了内部命令

    18,所以有时间,建议大家把这个man帮助好好的看一下,这个文件不小,很大,可以尝试打印出来自己翻译一下,以前有个学生从头到尾翻译了一遍

    19,/ 和?keyword一个是向上搜索,一个是向下搜索,

    man命令快捷键

    1,空格,向下翻一屏,b向上翻一屏幕,d 向下翻半屏幕,u 向上翻半屏,

    2,enter向下翻一行,y向上翻一行,数字,直接跳转到对应行,1G回到首部,G翻至尾部

    man搜索

    1,/keyword,不区分大小写,向尾部搜索,n:下一个,N上一个

    2,?keyword,不区分大小写,向首部搜索,n:下一个,N上一个

    3,两个正好相反,记住一种就好了

    info帮助

    1,这个info用的不是很普遍,很多人都不知道还有info这种写法

    2,info给出的信息也是比较具体详细的

    3,他组织帮助的方式和man是不太一样的,它里面会有很多的*链接,类似于网站链接,光标放到此处,敲击回车,会进入一个新的页面

    4,大部分人还是喜欢用man多一点,info不太习惯用

    5,有些帮助的信息,其实是在info里面更详细一些,有一些是在man里面更详细一些

    导航info页

    1,用的不多,没有详细记载,用到了再去查吧

    本地文档帮助信息

    1,光盘的安装包,装好了以后,就会有很多文档存储在 /usr/share/doc下面,这里面的文档各种格式都有PDF TXT,而且可能很大,这里面的每一个都是一个小册子,比man还要更详细,随便进入一个,尤其是里面的readme要详细看一下的,每个软件对应的就是我们光盘里面的一个rpm包

    2,多数安装了的软件包的子目录,包括了这些软件的相关原理说明

    3,常用文档:readme,install,changes

    4,不适合其他地方的文档的位置,就放在了这儿,配置文件范例,例如HTML/PDF/PS格式的文档,授权书详情等

    [root@red-hat-enterprise-linux doc]$ cd /usr/share/doc
    [root@red-hat-enterprise-linux doc]$ ls
    GConf2-3.2.6                                      libtiff-4.0.3
    HTML                                              libtimezonemap-0.4.4
    ImageMagick-6.7.8.9                               libtirpc-0.2.4
    ImageMagick-c++-6.7.8.9                           libtool-ltdl-2.4.2
    NetworkManager                                    libunistring-0.9.3
    [root@red-hat-enterprise-linux doc]$ cd zlib-1.2.7/
    [root@red-hat-enterprise-linux zlib-1.2.7]$ ls
    ChangeLog  FAQ  README

    2,很多软件装好之后都会有帮助选项,Applications->documentations-help

    在线文档获取帮助

    1,更权威的一些大型网站,比如说nginx,tomcat,apache我们参考第三方应用官方文档,因为大型的软件一般都有自己的官方网站documentation

    2,nginx是一个比较大的软件,很多都是由一个一个的软件模块所组成的,

    3,每个模块都有帮助文档,当然可以找翻译软件翻成中文的,但是还是看英文比较好,到时候我们学习这个模块的时候,就是进到这个网站,看每一个模块都是干啥的,

    4,文档光盘,红帽官方文档,KB知识库,官方提供的常见问题的解决方案 ,红帽的有一些需要注册的,很多软件都有KB知识库

    5,碰到问题,第一反应就是取官网查

     红帽全球技术支持

    1,如果你进的是一家土豪公司,这家公司已经购买了红帽技术支持,那么就可以直接找这家公司的技术支持,打电话问

    2,sosreport, 收集系统信息,生成一个打包文件

    3,CentOS不可以的,没有付费

    4,像一些银行啊,电信呀,国家机构,政府机关,他们可能会买技术支持,互联网公司一般不会去买,技术能力强,自己搞定

    5,技术能力强可以甩锅,技术能力不强只能背锅

    网站和搜索,老师推荐的网站

    1,openstack filetype:pdf 只搜索pdf的文件,文件名称为 openstack

    2,老师FQ用的是一个插件,chrome skyzip,亲测有效,就是速度有点慢

    3,google还可以去特定的网站搜索:rhca site:redhat.com/docs

    4,www.slideshare.net,人写的不错的幻灯片,比较新的技术的幻灯片,可以参考一下

    5,tldp.org the linux document project,

    bash快捷键

    1,ctrl+ l 清屏,相当于clear命令

    2,ctrl+ o把命令执行一遍,再重新显示一遍,我这边都可以的,老师的SecureCRT没有成功

    3,paralells 虚拟机依赖于原来的ISO image

    4,ctrl + s 锁屏,实际上敲击的时候,命令还在执行的,只不过没有显示,

    5,ctrl + p键解锁

    6,ctrl + c 终止命令

    7,ctrl + z 挂起命令

    8,行首 ctrl a /home 行尾  ctrl e/end

    9,光标现在位置和行首切换,ctrl + xx

    10,删除光标之前内容,ctrl + u

    11,整行删除 ALT+R键,这个键有时候由冲突

    12,光标处至行尾 ctrl + K

    13,SecureCRT,可以设置启用ALT键,然后删除整行的内容

    14,ALT 然后输入数字,然后输入字符,就输入80遍,远程终端ALT有问题,需要特殊设置,本地图形界面没问题

    15,图形界面的terminal终端也有很多快捷键,不再详细记忆了,打开新窗口,关闭当前窗口,ctrl+shift 其他的和Mac基本一致,Q关闭窗口,w关闭标签,自己试一试就可以了

    16,提升效率,技术形象

    17,上传软件的软件包,rz 这个软件在7上默认是装了的,但是6上没有的,需要单独安装的,他可以实现,文件互传SZ和RZ

    [root@red-hat-enterprise-linux Packages]$ rpm -ivh lrzsz-0.12.20-36.el7.x86_64.rpm
    warning: lrzsz-0.12.20-36.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
    Preparing...                          ################################# [100%]
    Updating / installing...
       1:lrzsz-0.12.20-36.el7             ################################# [100%]

    18,上面两个不是很好,建议大家还是用一些好一点的软件,比方说ss这个软件,需要买一个云服务器,其实就是虚拟机说白了,斑马工之类的,云服务器,一年一二百块钱

    19,打开了代理以后,访问所有网站都会走代理的,有时候速度会慢一点的

    20,访问Google这个还是大家必须要掌握的一个能力,因为有一些资料百度搜不到的

    文件管理(新的一章开始了)

    1,重点是软硬链接

    文件系统与目录结构

    1,Linux的目录结构在Linux里面是有标准的,这些目录我们往里面存数据,应该按照一定的规则来存放,而不要随便存放

    2,这些目录的作用,我们要有所了解,关于目录的作用,我们有一个详细的官方的文档,这个文档里面介绍了每个目录的具体作用是什么

    3,这个目录可以从这儿下载:http://www.pathname.com/fhs/

    4,一个小册子,总共52页,以后就会见的多了,经常是每学习一个模块,有一个小册字,四五个月,二三十本都是保守的

    5,我们主要记一级目录就好了

    6,/bin:基本命令库,基本的二进制程序,供所有用户使用的命令,不能关联只独立分区,OS启动就会用到的分区,sbin管理类的基本数据

    7,/boot:启动相关的文件,内核大概只有5M左右,很小,大部分都用的是Linux内核,安卓,路由器,内核文件vmlinuz,引导加载器(bootloader,grub)都存放于此目录

    [root@red-hat-enterprise-linux ~]$ ll -h /boot/vmlinuz-3.10.0-327.el7.x86_64
    -rwxr-xr-x. 1 root root 5.0M Oct 30  2015 /boot/vmlinuz-3.10.0-327.el7.x86_64

    8,/lib:共享库 API和ABI,开发接口库现在放在/lib64,因为我们的系统是64位的,lib是32位系统使用,64是64位系统使用的

    [root@red-hat-enterprise-linux lib64]$ pwd
    /lib64

    9,如果我想知道某一个应用程序,用到的库有哪些呢?ldd命令,这些库很多程序用,千万不可损坏,很多公用的

    [root@red-hat-enterprise-linux lib64]$ whatis ldd
    whatis: can't set the locale; make sure $LC_* and $LANG are correct
    ldd (1)              - print shared library dependencies
    [root@red-hat-enterprise-linux lib64]$ whereis ldd
    ldd: /usr/bin/ldd /usr/share/man/man1/ldd.1.gz
    [root@red-hat-enterprise-linux lib64]$ ldd /bin/ls
        linux-vdso.so.1 =>  (0x00007fff6038f000)
        libselinux.so.1 => /lib64/libselinux.so.1 (0x00007fe6548bf000)
        libcap.so.2 => /lib64/libcap.so.2 (0x00007fe6546ba000)
        libacl.so.1 => /lib64/libacl.so.1 (0x00007fe6544b0000)
        libc.so.6 => /lib64/libc.so.6 (0x00007fe6540ef000)
        libpcre.so.1 => /lib64/libpcre.so.1 (0x00007fe653e8e000)
        liblzma.so.5 => /lib64/liblzma.so.5 (0x00007fe653c68000)
        libdl.so.2 => /lib64/libdl.so.2 (0x00007fe653a64000)
        /lib64/ld-linux-x86-64.so.2 (0x00007fe654af8000)
        libattr.so.1 => /lib64/libattr.so.1 (0x00007fe65385f000)
        libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fe653642000)

    10,/media和/mnt都是当挂载点用的,/media是挂设备的,/mnt也是挂载设备,mnt不过大多数是程序员手动去敲命令来挂载的,是可以自己来挂载的,mnt =mount简写

    11,/opt第三方应用程序软件包,现在用的不多了,现在的opt目录基本是空的

    12,/sbin和/bin是相关的,sbin是管理员可以用的命令,/bin是普通用户可以用的命令,CentOS7里面/bin是指向usr/bin的软链接

    [root@red-hat-enterprise-linux ~]$ ll /bin
    lrwxrwxrwx. 1 root root 7 Apr 16 19:25 /bin -> usr/bin
    [root@red-hat-enterprise-linux ~]$ ls /bin
    GET                                  mpartition
    HEAD                                 mpls_dump
    Mail                                 mpris-proxy
    POST                                 mpstat

    13,例如ls普通用户和超级用户都可以使用,但是init就只有超级用户可以使用的

    [root@red-hat-enterprise-linux bin]$ which ls
    alias ls='ls --color=auto'
        /usr/bin/ls
    [root@red-hat-enterprise-linux bin]$ which init
    /usr/sbin/init

    14,/srv:一些服务程序用的一些数据,目前/srv也是空的,没有东西

    15,/usr: secondary hierarchy,我们会发现/usr下面的很多目录其实和根目录是一样的,和根很像,基本/usr放了大部分的用户数据,根下面这么多的目录,就是/usr最大了,你怎么知道他最大呢,可以用du 命令查看

    [root@red-hat-enterprise-linux ~]$ du -sh /*
    0    /bin
    131M    /boot
    4.0K    /data
    8.0K    /dev
    38M    /etc
    76K    /home
    0    /lib
    0    /lib64
    16K    /lost+found
    8.0K    /media
    4.0K    /mnt
    8.0K    /opt
    du: cannot access '/proc/15183/task/15183/fd/4': No such file or directory
    du: cannot access '/proc/15183/task/15183/fdinfo/4': No such file or directory
    du: cannot access '/proc/15183/fd/4': No such file or directory
    du: cannot access '/proc/15183/fdinfo/4': No such file or directory
    0    /proc
    8.4M    /root
    7.8G    /run
    0    /sbin
    4.0K    /srv
    0    /sys
    24K    /testdir
    112K    /tmp
    3.3G    /usr
    335M    /var
    [root@red-hat-enterprise-linux ~]$ whatis du
    whatis: can't set the locale; make sure $LC_* and $LANG are correct
    du (1p)              - estimate file space usage
    du (1)               - estimate file space usage

    16,du可以用来查看文件夹的大小

    [root@red-hat-enterprise-linux ~]$ du -sh /
    du: cannot access '/proc/15407/task/15407/fd/4': No such file or directory
    du: cannot access '/proc/15407/task/15407/fdinfo/4': No such file or directory
    du: cannot access '/proc/15407/fd/4': No such file or directory
    du: cannot access '/proc/15407/fdinfo/4': No such file or directory
    12G    /
    [root@red-hat-enterprise-linux ~]$ du -sh /boot
    131M    /boot
    [root@red-hat-enterprise-linux ~]$ du -sh /boot/*
    125K    /boot/config-3.10.0-327.el7.x86_64
    7.9M    /boot/grub2
    56M    /boot/initramfs-0-rescue-aa8b6d86b1ea43018977a0403f66c55f.img
    29M    /boot/initramfs-3.10.0-327.el7.x86_64.img
    17M    /boot/initramfs-3.10.0-327.el7.x86_64kdump.img
    9.8M    /boot/initrd-plymouth.img
    13K    /boot/lost+found
    248K    /boot/symvers-3.10.0-327.el7.x86_64.gz
    2.9M    /boot/System.map-3.10.0-327.el7.x86_64
    5.0M    /boot/vmlinuz-0-rescue-aa8b6d86b1ea43018977a0403f66c55f
    5.0M    /boot/vmlinuz-3.10.0-327.el7.x86_64
    [root@redhat7 data]#du
    22328    ./test
    4    ./ss
    4    ./dd
    25440    .
    [root@redhat7 data]#du -h   human
    22M    ./test
    4.0K    ./ss
    4.0K    ./dd
    25M    .
    [root@redhat7 data]#du -s   summarize
    25440    .
    [root@redhat7 data]#du -sh
    25M    .

    17,/var:用来放可变数据的,比方说日志呀,比方说我们以后要搭建网站,存放数据 /var/www/html  /var/ftp var/log

    18,网站上给出的这个文档的一级目录没有全部列出来

    19,/home:家目录,别墅和公寓的区别

    20,Lost and found :和文件系统有关,他并不是真正的Linux系统必须有的,CentOS7上面默认就没有的,因为CentOS6用的是ext4的文件系统,只要是ext4的文件系统,根目录下,默认都有这个文件夹,根下,boot下,data下默认都有这个文件夹,相当于收容所,系统出现问题,无家可归的放这儿

    21,/misc:杂项,有个有意思的功能,可以实现光盘的自动挂载,mount 命令只有root可以做

    22,光盘,图形界面不登陆,他不会自动登陆的,

    /etc/gdm/custom,不输入密码

    23,开机自动进入图形界面,并自动登陆的/etc/gdm/custom 先把这两行注释掉,只要是图形界面,就会自动挂载光盘

    24,7启动明显比6要快,做了很多优化,5和4更慢,技术发展还是挺快的

    25,登陆前后挂载动作注意观察

    26,普通用户是没有权限挂载光盘的,那怎么办呢?怎么用光盘呢?

    [root@red-hat-enterprise-linux ~]$ lsblk
    NAME                 MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
    sda                    8:0    0   64G  0 disk
    |-sda1                 8:1    0  500M  0 part /boot
    `-sda2                 8:2    0 63.5G  0 part
      |-VolGroup-lv_root 253:0    0   50G  0 lvm  /
      |-VolGroup-lv_swap 253:1    0    2G  0 lvm  [SWAP]
      `-VolGroup-lv_home 253:2    0 11.5G  0 lvm  /home
    sr0                   11:0    1  3.8G  0 rom  /run/media/root/RHEL-7.2 Server.x8
    sr1                   11:1    1  3.8G  0 rom  /run/media/root/RHEL-7.2 Server.x8
    [root@red-hat-enterprise-linux ~]$

    27,神奇的目录,普通用户只要进到misc/cd/ 就可以把光盘挂载上了,不要关心他是怎么挂载的,目录页看不到,但是就是挂上了,神奇不?这个是针对6的,CentOS7上这个功能,默认还没有启动,他就没有这个misc 文件夹,怎么让他有呢,需要装一个autofs的包

    28,autofs是一个包,装上我们才可以启动7上面的那种方法,有依赖性没装上,这是RPM命令的缺陷,后面我们会用YUM来解决这个问题,我装上了,但是老师的貌似失败了,启动autofs然后就出现这个文件夹了,好用了,恭喜自己

    [root@red-hat-enterprise-linux Packages]$ rpm -ivh autofs-5.0.7-54.el7.x86_64.rpm
    warning: autofs-5.0.7-54.el7.x86_64.rpm: Header V3 RSA/SHA256 Signature, key ID fd431d51: NOKEY
    Preparing...                          ################################# [100%]
        package autofs-1:5.0.7-54.el7.x86_64 is already installed
    [root@red-hat-enterprise-linux Packages]$ cd  /
    [root@red-hat-enterprise-linux /]$ ls
    bin   data  etc   lib    lost+found  mnt  proc  run   srv  testdir  usr
    boot  dev   home  lib64  media       opt  root  sbin  sys  tmp      var
    [root@red-hat-enterprise-linux /]$ systmctl start autofs
    bash: systmctl: command not found...
    [root@red-hat-enterprise-linux /]$ systemctl start autofs
    [root@red-hat-enterprise-linux /]$ ls
    bin   data  etc   lib    lost+found  misc  net  proc  run   srv  testdir  usr
    boot  dev   home  lib64  media       mnt   opt  root  sbin  sys  tmp      var
    [root@red-hat-enterprise-linux /]$
    [root@red-hat-enterprise-linux /]$ cd /misc
    [root@red-hat-enterprise-linux misc]$ ls
    [root@red-hat-enterprise-linux misc]$ cd cd
    [root@red-hat-enterprise-linux cd]$ ls
    EFI     Packages                    addons      release-notes
    EULA    RPM-GPG-KEY-redhat-beta     images      repodata
    GPL     RPM-GPG-KEY-redhat-release  isolinux
    LiveOS  TRANS.TBL                   media.repo
    [root@red-hat-enterprise-linux cd]$ whatis autofs
    whatis: can't set the locale; make sure $LC_* and $LANG are correct
    autofs (5)           - Format of the automounter maps
    autofs (8)           - (unknown subject)

    29,net/:也是和autofs相关的,后面再说

    30,proc/:这个是非常有意义的一个目录,这个目录下有好多好多的文件,比方说看一下cpuinfo

    [root@red-hat-enterprise-linux cd]$ cd /proc
    [root@red-hat-enterprise-linux proc]$ ls
    1      16472  2583   3545  3735  454  68    87      buddyinfo    mounts
    10     167    2589   355   3738  455  69    870     bus          mtrr
    106    16711  2598   3550  3739  46   699   88      cgroups      net
    1067   16876  26     3564  3747  469  7     882     cmdline      pagetypeinfo
    1069   17     27     357   3749  47   70    883     consoles     partitions
    1078   18     27263  3571  3751  470  71    885     cpuinfo      sched_debug
    1080   18166  27703  3578  3756  471  72    886     crypto       scsi
    1081   18288  28     358   3761  48   73    887     devices      self
    1088   18429  2855   3588  3762  49   74    888     diskstats    slabinfo
    109    18570  2892   359   3767  5    745   9       dma          softirqs

    31,很奇怪的是,看cpuinfo这个文件,给出了很多内容,但是大小却只有0,为什么呢? d打头的文件

    [root@red-hat-enterprise-linux proc]$ ll -d /proc
    dr-xr-xr-x. 265 root root 0 Apr 20 15:03 /proc

    32,因为proc这个目录存的东西,根本就不是在硬盘上存的,不占硬盘空间,当然大小为0,他放哪儿呢?放在内存里面

    [root@red-hat-enterprise-linux proc]$ cat cpuinfo
    processor    : 0
    vendor_id    : GenuineIntel
    cpu family    : 6
    model        : 158
    model name    : Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
    stepping    : 10
    microcode    : 0x96
    cpu MHz        : 2592.000
    [root@red-hat-enterprise-linux proc]$ cat meminfo
    MemTotal:        1013000 kB
    MemFree:           80224 kB
    MemAvailable:     392328 kB
    Buffers:           63536 kB
    Cached:           175688 kB
    SwapCached:         3800 kB
    Active:           229008 kB

    33,proc是一个虚拟文件夹,放在内存里面,内存信息,分区信息,都在这儿,其他的数字文件,也是很重要的,叫做进程,后面会说

    [root@red-hat-enterprise-linux proc]$ du -sh /proc
    du: cannot access '/proc/19627/task/19627/fd/4': No such file or directory
    du: cannot access '/proc/19627/task/19627/fdinfo/4': No such file or directory
    du: cannot access '/proc/19627/fd/4': No such file or directory
    du: cannot access '/proc/19627/fdinfo/4': No such file or directory
    0    /proc

    34,虚拟目录,不是真实存在的,映射的是内存数据,看一下这个文件夹,发现大小只有0

    35,/sys:硬件相关信息,加硬盘,IDE类型的,必须关机加,SCSI和SATA的不需要关机就可以添加,加好以后会多处一块CentOS6.9-0.vmdk的文件

    36,/sys目录下触发一个磁盘扫描,可以识别新添加的硬盘,不重启电脑的情况下,让系统识别硬盘,这个还是记一下,以后可能会用到,三个点必须加空格,不然会出错

    [root@red-hat-enterprise-linux scsi_host]$ echo '- - -' > /sys/class/scsi_host/host2/scan

    37,/selinux安全策略相关的,以后在说

    38,CentOS  6和7 不一样的 1,net和misc装上这个包就可以了,autofs相关的,2,run文件夹,这个是CentOS7上面添加的新的目录,都要遵守分层结构,3,lost and found这个是和文件系统相关的,因为我们7初始化的文件系统是xsf的,6时ext4的

    39,dev/:设备文件及特殊文件存储位置, b:block device 随机访问,c:character device,线性访问

    40,/run,运行中的进程相关数据,通常用于存储进程PID文件

    文件系统

    1,单根的结构,根文件系统rootfs,区分大小写,有些特殊情况不区分,比方说U盘

    2,U盘要么与window连,要么与Linux链接,右下角,右键,断开与主机的连接,这样就可以和Linux连接了,FAT32,它里面就不再大小写敏感了

    3,Linux里面大小写区分不区分不是Linux说了算的,是文件系统决定的

    4,Linux里面每个文件都由两部分组成,一部分是文件内容,就是ls出来的文件大小,还有一部分数据,就是这个文件的属性信息,ls出来的信息,我们叫做metadata元数据

    5,总结,也就是文件的属性信息,我们叫做metadata,元数据,文件的具体内容,我们叫做data,就是数据

    6,LSB,Linux Standard Base文件分层结构

    7,FHS,按照文件定义来存储,按照规则来

    文件名规则

    1,最长255字节,alt 数字 字符,可以快速输入多个字符,终端要启用alt,远程终端有时候是terminal的原因,无法成功输入多个

    [root@red-hat-enterprise-linux Desktop]$ touch aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
    touch: cannot touch ‘aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa’: File name too long

    2,包括路径在内,不得超过4095个字节

    3,蓝色:目录 绿色:可执行 bin 红色:一般都是压缩文件,浅蓝色:软链接文件(最前面是l),就相当于快捷方式,Linux叫软连接,有指针

    灰色:一般文件,粉色:socket文件(s开头,网络通信相关),浅黄色,管道文件(p开头),这些文件通常都不是我们创建的,都是程序自动生成的

    4,我们用的最多的是蓝色文件夹,和灰色普通文件

    5,Linux里面除了/和NUL,所有字符,哪怕是空格都可以作为文件名称,但是不推荐,我试了两个空格的都没成功,估计现在已经禁止掉了,老师试了一个是成功的

    [root@red-hat-enterprise-linux proc]$ touch 'a b'  这儿是因为在proc文件夹所以不让建,换到home就可以了
    touch: cannot touch 'a b': Permission denied
    [root@red-hat-enterprise-linux proc]$ touch "a b"
    touch: cannot touch 'a b': Permission denied

    6,有些文件删不了,加上全路径删除,看分区最好还是用lsblk,这种乱七八糟的名称,最好还是不要用

    [root@red-hat-enterprise-linux home]$ touch -a
    touch: missing file operand
    Try 'touch --help' for more information.
    [root@red-hat-enterprise-linux home]$ touch /root/-a
    [root@red-hat-enterprise-linux ~]$ rm -rf -a
    rm: invalid option -- 'a'
    Try 'rm ./-a' to remove the file '-a'.
    Try 'rm --help' for more information.
    [root@red-hat-enterprise-linux ~]$ rm -rf /root/-a

    7,准确的说是标准的文件系统下(ext4),文件名称区分大小写

    Linux下的文件类型

    1,b打头的叫做块设备,所有的硬盘分区,光盘,都叫做块设备

    [root@red-hat-enterprise-linux etc]$ ll /dev/sd*
    brw-rw----. 1 root disk 8, 0 Apr 20 15:03 /dev/sda
    brw-rw----. 1 root disk 8, 1 Apr 20 15:03 /dev/sda1
    brw-rw----. 1 root disk 8, 2 Apr 20 15:03 /dev/sda2
    [root@red-hat-enterprise-linux etc]$ lsblk
    NAME                 MAJ:MIN RM  SIZE RO TYPE MOUNTPOINT
    sda                    8:0    0   64G  0 disk
    |-sda1                 8:1    0  500M  0 part /boot
    `-sda2                 8:2    0 63.5G  0 part
      |-VolGroup-lv_root 253:0    0   50G  0 lvm  /
      |-VolGroup-lv_swap 253:1    0    2G  0 lvm  [SWAP]
      `-VolGroup-lv_home 253:2    0 11.5G  0 lvm  /home
    sr0                   11:0    1  3.8G  0 rom  /run/media/root/RHEL-7.2 Server.x86_641
    sr1                   11:1    1  3.8G  0 rom  /run/media/root/RHEL-7.2 Server.x86_64
    [root@red-hat-enterprise-linux etc]$ ll /dev/sr0
    brw-rw----. 1 root cdrom 11, 0 Apr 20 15:03 /dev/sr0

    2,lsblk就是列出块设备的意思,块设备基本都是真实存在的硬件设备,block

    3,字符设备 zero,逻辑存在的但不是真实存在的,character,这个零文件非常有有用,字符设备,dev下面有好多

    [root@red-hat-enterprise-linux dev]$ ll
    total 0
    drwxr-xr-x. 2 root root         100 Apr 20 15:03 VolGroup
    crw-------. 1 root root     10, 235 Apr 20 15:03 autofs
    drwxr-xr-x. 2 root root         200 Apr 20 15:03 block
    drwxr-xr-x. 2 root root         100 Apr 20 15:03 bsg
    crw-rw----. 1 root disk     10, 234 Apr 20 15:54 btrfs-control
    drwxr-xr-x. 3 root root          60 Apr 20 15:03 bus
    lrwxrwxrwx. 1 root root           3 Apr 20 15:03 cdrom -> sr0
    drwxr-xr-x. 2 root root        2980 Apr 20 19:34 char
    crw-------. 1 root root      5,   1 Apr 20 15:03 console
    lrwxrwxrwx. 1 root root          11 Apr 20 15:03 core -> /proc/kcore
    drwxr-xr-x. 4 root root         100 Apr 20 15:03 cpu
    crw-------. 1 root root     10,  61 Apr 20 15:03 cpu_dma_late
    [root@red-hat-enterprise-linux dev]$ ll /dev/zero
    crw-rw-rw-. 1 root root 1, 5 Apr 20 15:03 /dev/zero

    4,这个zero文件非常有用,我们一般用它来创建一些大文件,或者把一些文件填充为零

    [root@red-hat-enterprise-linux ~]$ whatis dd
    whatis: can't set the locale; make sure $LC_* and $LANG are correct
    dd (1p)              - convert and copy a file
    dd (1)               - convert and copy a file
    [root@red-hat-enterprise-linux ~]$ dd if=/dev/zero of=/data/bigfile bs=1M count=1024
    1024+0 records in
    1024+0 records out
    1073741824 bytes (1.1 GB) copied, 0.65315 s, 1.6 GB/s
    [root@red-hat-enterprise-linux ~]$ ll /data/bigfile
    -rw-r--r--. 1 root root 1073741824 Apr 21 12:56 /data/bigfile
    [root@red-hat-enterprise-linux ~]$ ll /data/bigfile -h
    -rw-r--r--. 1 root root 1.0G Apr 21 12:56 /data/bigfile
    [root@red-hat-enterprise-linux ~]$ hexdump -C /data/bigfile
    00000000  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
    *
    40000000

    5,bin /usr/bin  链接,

    6,所有的文件类型

    -:普通文件
    d:目录文件
    b:块设备
    c:字符设备
    l:符号链接文件
    p:管道文件pipe
    s:套接字文件socket

    显示当前的工作目录(pwd)

    1,有些软连接的路径,如果想要显示真实的路径 pwd -P,       -P, --physicalavoid all symlinks

    2,-L默认是不需要加的,如果是软连接,默认是显示软连接的

    3,即是内部命令,也是外部命令

    绝对路径和相对路径

    1,从根开始:绝对路径 /开始

    2,相对路径法 . 和.. ../../motd忘上走两层,相对可以不是/开始

    [root@red-hat-enterprise-linux ~]$ ls ../
    bin   data  etc   lib    lost+found  misc  net  proc  run   srv  testdir  usr
    boot  dev   home  lib64  media       mnt   opt  root  sbin  sys  tmp      var
    [root@red-hat-enterprise-linux ~]$ cat ../etc/motd
    welcome,lisa,nice day
    [root@red-hat-enterprise-linux sysconfig]$ pwd
    /etc/sysconfig
    [root@red-hat-enterprise-linux sysconfig]$ cat ../../etc/motd
    welcome,lisa,nice day

    3,basename 最后一个不要目录,dirname 前面路径,只要目录,不要文件,将来处理一些复杂的情况会用到这些

    [root@red-hat-enterprise-linux network-scripts]$ pwd
    /etc/sysconfig/network-scripts
    [root@red-hat-enterprise-linux network-scripts]$ basename /etc/sysconfig/network-scripts
    network-scripts
    [root@red-hat-enterprise-linux network-scripts]$ dirname /etc/sysconfig/network-scripts
    /etc/sysconfig
    [root@red-hat-enterprise-linux network-scripts]$ cd ..
    [root@red-hat-enterprise-linux sysconfig]$ pwd
    /etc/sysconfig
    [root@red-hat-enterprise-linux sysconfig]$ basename /etc/sysconfig
    sysconfig
    [root@red-hat-enterprise-linux sysconfig]$ dirname /etc/sysconfig
    /etc

    4,前期要多学一些命令,后面就很少了,都是大服务了,就更难了,大概要学300个左右的命令

  • 相关阅读:
    mysql远程执行sql脚本
    数据库死锁
    sqlserver 数据库之调优
    sqlserver 数据库之性能优化
    Session共享的解决办法
    关于对session机制的理解--通俗易懂
    kafka之常用命令
    分布式消息队列之kafka
    vuejs调试代码
    json
  • 原文地址:https://www.cnblogs.com/lisa-blog/p/10706469.html
Copyright © 2011-2022 走看看