Various Linux small operations

Source: Internet
Author: User

1. View the routing table

Command: route-n; Netstat-r

Tracking Network address: Traceroute www.16 3.com

2. View a machine IP address and its corresponding domain name

Command: nslookup; Dig sina.com.cn; Dig sina.com.cn NS; Dig www.163.com + Trace

3. Query User Information

Command: Finger; W

4. List current system open files

Command: lsof-i: 22

5. View the process

Command: Ps-aux; Ps-qux|grep Nginx; Ps-ef |grep Nginx

6. Find the currently running process and list the process PID that matches the given criteria

Command: Pgrep nginx

7. Terminating a process

Command: kill-9 111

8. Kill all processes by program name

Command: Killall http

Adding static routes in a 9.windows environment

Command: Route add 192.168.1.0 Mask 255.255.255.0 192.168.2.3 (this command fails after reboot)

Route-p Add 192.168.1.0 mask 255.255.255.0 192.168.2.3 (write registry restart will not expire)

Registry Address Hkey_local_machsystem\currentcontrolset\services\tcpip\prameters\persistentroutes

Add static routes under 10.centos

Route add-net 192.168.1.0 netmask 255.255.255.0 GW 192.168.2.5 (reboot will fail)

Route Add-net is the network way to add routes, netmask is the subnet mask, GW next address.

Description 192.168.1.0/24 route through 192.168.2.5 out

Vi/etc/sysconfig/network-scripts/route-eth0

192.168.1.0/24 via 192.168.2.5 (restart will not expire after writing)

Various Linux small operations

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.