Linux Common commands ... Continuous update

Source: Internet
Author: User
Tags egrep

1. Linux Mount Winodws shared folder

Mount-t cifs-o username=name,password=123//172.16.3.56/d/guaizai


2. View the number of concurrent requests for HTTP and their TCP connection status:

Netstat-an | awk '/^tcp/{s[$NF]++}end{for (a in s) print A,s[a]} '


3, with tcpdump sniffing 80 port access to see who the highest

Tcpdump-i ETH0-TNN DST Port 80-c 100 | Awk-f "." ' {print $ '. $ "." $ "." $4} ' | Sort | uniq-c |


4, view the current system per IP connection number

Netstat-an | Awk-f "[:]+" ' {s[$6]++}end{for (a in s) print S[a],a} ' | Sort-nr | Head


5.32-bit random password generation under shell

Head/dev/urandom | md5sum | Head-c 30


6, statistics of Apache Access.log in the most visited 5 IP

awk ' {s[$1]++}end{for (a in s) print A,s[a]} ' Access.log | Sort-nr


7. Find out the txt end of the TMP directory! and will be renamed to *.sh

#!/bin/bash
Str= ' find/tmp/-name \*.txt '
For I in $str
Do
MV $i ${i%txt}sh
Done


8. View SSH Malicious links
Cat/var/log/secure | grep "Failed Password" | Egrep-o "([0-9]{1,3}\.) {3} [0-9] "| Sort-nr | Uniq-c


9. View IP that failed with root login
Cat/var/log/secure |grep "Failed password for root" | Egrep-o "([0-9]{1,3}\.) {3} [0-9] "| Sort-nr | Uniq-


10. View process path through PID

Ll/proc/pid



This article is from the "Paper Gun Group" blog, please be sure to keep this source http://qiaivheise.blog.51cto.com/7743217/1953346

Linux Common commands ... Continuous update

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.