【韦德国际1946】linux查找日志常用命令,linux日志

作者: 韦德国际1946  发布:2019-05-28
A quick guide to logfiles
The important ones:
Web logs (apache): /etc/httpd/logs look
out for odd characters/overlong filenames
Service logs: /var/log/boot.log keep
an eye out for failures to start/stop services
Cron logs: /var/log/cron make
sure expected jobs are running
dmesg: /var/log/dmesg check
for hardware errors
Firewall log: /var/log/firewall.log check
to see what attacks have been
attempted
Mail log: /var/log/maillog check
all mail is delivered
Messages: /var/log/messages check
everything in here daily
Secure: /var/log/secure look
out for unusual attempts to gain root
The less important ones:
/var/log/gdm : gdm is the graphical login manager.
/var/log/httpd : the same as /etc/httpd/logs/
/var/log/iptraf : it's empty unless you run iptraf.
/var/log/kdm.log : another graphical login manager.
/var/log/ksyms.* : kernel symbols logs (incomprehensible).
/var/log/lastlog : Use the last command instead.
/var/log/mysqld.log : Of course if you start using MySQL you might look!
/var/log/pgsql : PostgreSQL logs as
above.
/var/log/rcd/* : RedCarpet logs only
look if you have issues.
/var/log/rpmpkgs : Same as running rpm qa
/var/log/sa : output from sar command on cron job
/var/log/scrollkeeper.log : GNOME messages, might be good to look at if you have a GNOME
problem!
/var/log/spooler : UUCP spools (noone
uses this anymore!)
/var/log/up2date : RedHat update mechanism (unused).
/var/log/wtmp : not human readable
/var/log/Xfree86.0.log : If you have X errors this is the place to look.
Resources:
dmesg output demystified:
http://www.linuxgazette.com/issue59/nazario.html

mariadb的索引

目录:提取索引的始建在的表上字段中的数据,构建出2个独特的数据结构;

 

linux查找日志常用命令,linux日志常用命令

一、查找文件test中目的字符串(xxxx)出现的行数地点
grep -n xxxx  test

【韦德国际1946】linux查找日志常用命令,linux日志和平安日志。 

二、文件test从某1行(n)开始体现
more n  test

 

3、查询文件test中出现目的字符串xxxx的次数
grep -c xxxx test

 

四、展现从文件test包含某些字符串xxxx的新闻起始展现
more /xxxx test

一、查找文件test中指标字符串(xxxx)出现的行数地方 grep -n xxxx test 贰、文件test从某1行(n)早先...

那是个轻易的目录,至于怎么读,能在日记中看出什么了,靠自个儿!韦德国际1946 1

目录的功力:加快查询操作;副效用:下跌写操作质量;

表中数据子集:把表中某个或某些字段的数据提取出来另存为一个特定数据结构组织的数据;
某个字段或某些字段:WHERE子句中用到的字段     

 

索引类型:B TREE,HASH

B  TREE:顺序存储,每一个叶子结点到根结点的距离相同;左前缀索引,适合于范围类型的数据查询;
    适用于B  TREE索引的查询类型:全键值、键值范围或键前缀;
    全值匹配:精确匹配某个值;
        WHERE COLUMN = 'value';
    匹配最左前缀:只精确匹配起头的部分;
            WEHRE COLUMN LIKE 'PREFIX%';                        
    匹配范围值:
        精确匹配某一列,范围匹配另一列;
        只用访问索引的查询:覆盖索引;
            index(Name)
            SELECT Name FROM students WHERE Name LIKE 'L%';                     
    不适用B  TREE索引:
        如果查询条件不是从最左侧列开始,索引无效;
            index(age,Fname), WHERE Fname='Jerry';    , WHERE age>30 AND Fname='Smith';
        不能跳过索引中的某列;
            index(name,age,gender)
                WHERE name='black' and age > 30;
                WHERE name='black' AND gender='F';
        如果查询中的某个列是为范围查询,那么其右侧的列都无法再使用索引优化查询;
                WHERE age>30 AND Fname='Smith';

韦德国际1946 2

Hash索引:基于哈希表达成,极其适用于值的规范相称查询;

    适用场景:
        只支持等值比较查询,例如=, IN(), <=>
    不用场景:
        所有非精确值查询;MySQL仅对memory存储引擎支持显式的hash索引;

 

目录优点:

降低需要扫描的数据量,减少IO次数;
可以帮助避免排序操作,避免使用临时表; 
帮助将随机IO转为顺序IO;

 

本文由韦德国际1946发布于韦德国际1946,转载请注明出处:【韦德国际1946】linux查找日志常用命令,linux日志

关键词: Linux 1946bv1946 Linux专区