zoukankan      html  css  js  c++  java
  • [Linux]Linux琐碎知识(一)

    1、查看历史操作

    history 10(列出最近的10条操作)

    !105(重复执行第105条命令)

    !!(重复执行上一条命令)

    !last(执行最后一次以last开头的命令)

    history | more(逐条列出历史指令)

    history -c(清空所有的历史指令)

    2、日志

    /var/log/message 系统启动后的信息和错误日志,是Red Hat Linux中最常用的日志之一 
    /var/log/secure 与安全相关的日志信息 
    /var/log/maillog 与邮件相关的日志信息 
    /var/log/cron 与定时任务相关的日志信息 
    /var/log/spooler 与UUCP和news设备相关的日志信息 
    /var/log/boot.log 守护进程启动和停止相关的日志消息

    3、uname -a   # 查看内核/操作系统/CPU信息

    4、

    [root@MoKin ~]# cat -n /etc/issue
    1 S
    2 Kernel on an m
    3
    [root@MoKin ~]# cat -b /etc/issue
    1 S
    2 Kernel on an m

     cat -n和cat -b的区别在于:-b:列出行号,仅针对非空白行做行号显示,空白行不标行号;-n:列印出行号,连同空白行也会有行号,与 -b 的选项不同;

    5、查看CentOS的版本:

    [root@MoKin etc]# cat *-release
    CentOS Linux release 7.5.1804 (Core)
    NAME="CentOS Linux"
    VERSION="7 (Core)"
    ID="centos"
    ID_LIKE="rhel fedora"
    VERSION_ID="7"
    PRETTY_NAME="CentOS Linux 7 (Core)"
    ANSI_COLOR="0;31"
    CPE_NAME="cpe:/o:centos:centos:7"
    HOME_URL="https://www.centos.org/"
    BUG_REPORT_URL="https://bugs.centos.org/"

    CENTOS_MANTISBT_PROJECT="CentOS-7"
    CENTOS_MANTISBT_PROJECT_VERSION="7"
    REDHAT_SUPPORT_PRODUCT="centos"
    REDHAT_SUPPORT_PRODUCT_VERSION="7"

    CentOS Linux release 7.5.1804 (Core)
    CentOS Linux release 7.5.1804 (Core)

  • 相关阅读:
    计算长度的方法
    自动装箱和拆箱
    基本数据包装类
    Date类
    文档参数解析
    权限修饰符
    IO流
    ArrayList集合类
    对象数组
    二维数组
  • 原文地址:https://www.cnblogs.com/LeeCookies/p/9510775.html
Copyright © 2011-2022 走看看