Discover linux log all commands to syslog, include the articles, news, trends, analysis and practical advice about linux log all commands to syslog on alibabacloud.com
FROMfcceec.www.ec8.pfcc.com.cnSep 4 17:40:39 UNIX su(pam_unix)[2048]: session opened for user root by suying(uid=999)
The format of this file is that each line contains a date, host name, program name, followed by square brackets containing the PID or kernel ID, a colon and a space, and finally a message. This file has one disadvantage: The recorded intrusion attempts and successful intrusion events are drowned in a large number of normal process records. However, this
Linux Common commands:Practice more than 3 timesFirst, the command basic format1. Command format:[Root (Administrator) @localhost (hostname) ~]# (super User prompt, normal user prompt is $) adminis/root First level directory with PWD print working directory (print working directory) view/home/user1/Level Two Directory[[email protected] ~]# cd/usr/local/src/switch current directory[Email protected] src]#command [options] [parameters] brackets indicate
maintain detailed logs.
Utility log: Many programs reflect the security state of the system by maintaining the log. The SU command allows the user to gain permission from another user, so its security is important and its file is Sulog. The same goes for Sudolog. In addition, HTTP servers such as Apache have two logs: Access_log (Client access log) and Error_lo
Intersection
Cat Sort Uniq -D
Fetch file and set
Cat Sort Uniq
Vi. Other16. Whether the query process existsPS grep grep grepgrep itself is a process that can easily misleadQuerying and killing processesPS grep grep grep awk ' {print $} ' Xargs Kill -917, the query port occupancy situationLsof-i:6543218. Find and package files, name them at the current timeFind "* Log " Xargs tar -zvcf logs. 'date +%y-%m-%d 'where ' date +%y-%m-%d-%h
BKJIA exclusive Article: from Ext to Ext2, from Ext2 to Ext3, and later Ext4 or later versions, Linux has always been known as a powerful, rich, and complete log system. By managing logs, you can clearly understand the operating status of the system, discover intrusions from various clues, and quickly prevent intrusions. This article is the fourth part about all-
1. View Log common commands tail:- n is the display line number, equivalent to the NL command;tail-100f Test.log Real-time monitoring of 100 rows of logsTail-n test.log query log at the end of the last 10 lines;Tail-n +10 test.log Query all logs after 10 lines;HeadContrary to tail, tail is the number of rows of logs af
Tags: Linux view log commandsLog file storage logs are very large, we can not use VI directly into the log, we need the Linux command to complete our viewing tasksLog location:/var/log/message information and error log after syste
recorded, it is possible to enter the log records directory, file deletion or file modification, it is necessary to upload these files to the Log collection server in a timely manner, preferably a background real-time monitoring process, the directory under the file changes, Directly trigger the synchronization operation, the file timely synchronization to the Log
The common log analysis commands in linux are as follows. log content: 211.123.23.20. amp; ndash;-[10/Dec/2010: 09: 31: 17 + 0800] GET/query/trendxml/district/todayreturn/month/2009-12-14/2010-12 common log analysis commands in
Sometimes for server security, to prevent others from prying into the commands we enter, we can clear the history, and more often we choose to force history to not remember the command when entering special commands. Experimental method: Execute the Export histcontrol=ignorespace command first, then output Ls-tra, PWD and service mysqld Start command, when the third command is executed, we choose not to rem
logs logged on by login IP record for all Linux users log in to log on for Linux user operations The history is generally viewed through the command histories, but if the important data is deleted due to misoperation, the historical command will not work. So what should be d
1. View Log common commands tail:-n is the display line number; the equivalent of the NL command; tail-100f test.log Real-time monitoring of 100-line logs
Tail-n test.log Query Log The last 10 lines of the tail;
Tail-n +10 test.log to query all logs after 10 rows;
Head
Contrary to the tail, tail is the number of rows a
file from the 512-byte block position represented by the number variable.-C number starts reading the specified file from the byte position represented by the number variable.-F assumes that the input file is a regular file or assumes that the file parameter specifies a FIFO (first in and out),Then the tail command will not terminate after the last specified unit of the input file has been copied, but continueRead and copy additional units from the input file (when these units are available).If
Tags: files XA number generated in Tomcat inux log file Lis file#!/bin/bash#!/bin/bash#exact All log files#计算log文件个数log_number= ' ls *.log |grep log-c '#当log文件数大于0时遍历删除文件中的文件夹If [$
time exceeding 30 seconds' ($NF >) {print $7} '|sort-n|uniq-c|sort-nr|head-16. List the number of each process running in the current server, in reverse order' ' ' {print $8 "" $9} ' |sort | Uniq-c |sort-nr |head-17. View the current number of concurrent accesses to Apache#对比httpd. MaxClients digital gap in conf how much -an | grep established | Wc-l18, you can use the following parameters to view the dataPs-ef|grep HTTPD|WC-L1287 #统计httpd进程数, a single request initiates a process that is used f
have this feature. Many system engineers may rarely contact this command at ordinary times. But the author is more like this order. Simply put, a system engineer can use this command to log the entire process of a session or some action in the middle to a file. With this command, you can basically record most of the keyboard actions, the output of the command, and the error message in the file. That is, the information that is printed on the screen c
How Linux uses commands to view a few lines of a log file (middle or last lines)How Linux displays a few lines of a file (in the middle of a few lines)"One" starts at line No. 3000 and displays 1000 rows. The 3000~3999 line is displayedCat FileName | Tail-n +3000 | Head-n 1000"Two" displays 1000 rows to 3000 rowsCat fi
name. So if you also encounter this error, please check that the user name, group name, and other settings are correct.After uploading, you will see committed revision 1. The words, the upload was successful. Congratulations to you here. But don't take it easy on your guard and let the other members test their read and write permissions. Please try it for a reference. Here are a few more you need to test I do not one to do.Test 2: Download code from server side to client local(Pending completio
In linux, after an error occurs in modifying the profile file, all commands cannot be used. How can this problem be solved ?, LinuxprofileScenario
Today, we installed linux for the second time, and there were more new ones.
I was supposed to configure the java environment variable in/etc/profile. I got it wrong: ente
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.