Several commands for viewing processes and logs-Linux Enterprise Application-Linux server application information. The following is a detailed description. When I configured nagios today, I found 1272 processes, which scared me to death. Let's take a look at it on the server.
# Ps-ef | wc-l
1271
There are so many.
Check again
# Ps-ef | grep httpd | awk '{print $ NF}' | sort-nr | uniq-c
1201 start --- this is abnormal
It's really scary. Let's take a look at it. The apache on this machine is useless. Shut it down directly.
The process returns to normal. Can I modify the apache configuration file to solve this problem?
Because squid transparent proxy is used in the company's Intranet, the sarg used for log processing is viewed in a browser, but not in the command line.
So I went on to ask.
The most stupid method I use
Cat/home/squid2/var/logs/access. log | grep 'IP'> **. txt
Tail **. txt
You can find the most recent access record of this IP address.
Question 1: How can I use a single command to implement it?
Question 2: How can I display a log in a format that does not display time?
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.