The grep, cut of the Linux command

Source: Internet
Author: User

Input:

ifconfig eth0

The eth0 represents the first NIC of the host.

Output:

eth0:flags=4163<UP,BROADCAST,RUNNING,MULTICAST> MTU theinet192.168.118.136Netmask255.255.255.0Broadcast192.168.118.255Inet6 fe80::20c:29ff:fe2c:3c8f Prefixlen -ScopeID0x20<link>etherxx: 0c: in: 2c:3c:8f Txqueuelen +(Ethernet) RX packets153785bytes172057146(164.0MiB) RX Errors0Dropped0Overruns0Frame0TX Packets67213bytes9694191(9.2MiB) TX Errors0Dropped0Overruns0Carrier0Collisions0

Rx for the received packet, TX for the sent packet. ether 00:0c:29:2c:3c:8f is the MAC address.

Input:

ifconfig grep '  '

Output:

192.168. 118.136  255.255. 255.0  192.168. 118.255

Displays all rows that contain ' inet '.

Cut command:

Syntax format:cut [-bn] [file] or cut [-c] [file] or cut [-DF] [file]

-B for extracting bytes,-C for extracting characters (Chinese characters contain two bytes),-D for custom delimiters, and tab by default. -F is used with-D to specify which area to display.

The grep, cut of the Linux command

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.