20 useful commands for Linux experts (1)

Source: Internet
Author: User

Thank you for your liking for the first two parts of this article, meiyan and support. In the first part of the article, we discussed the commands for users who only need the necessary knowledge to switch to Linux and linux.

20 useful commands for Linux beginners

In the second article, we discuss the commands required by intermediate users to manage their systems.

20 useful commands for intermediate Linux Users

What about next? In this article, I will explain some commands required to manage Linux servers.

1. Command: ifconfig

Ifconfig is used to configure the network interface information of the resident kernel. Set the network adapter information when the system starts. Later, it is usually used only during debugging or when the system needs to be adjusted.

Check active network adapters

 
 
  1. [avishek@tecmint ~]$ ifconfig 
  2. eth0      Link encap:Ethernet  HWaddr 40:2C:F4:EA:CF:0E 
  3. inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0 
  4. inet6 addr: fe80::422c:f4ff:feea:cf0e/64 Scope:Link 
  5. UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1 
  6. RX packets:163843 errors:0 dropped:0 overruns:0 frame:0 
  7. TX packets:124990 errors:0 dropped:0 overruns:0 carrier:0 
  8. collisions:0 txqueuelen:1000 
  9. RX bytes:154389832 (147.2 MiB)  TX bytes:65085817 (62.0 MiB) 
  10. Interrupt:20 Memory:f7100000-f7120000 
  11. lo        Link encap:Local Loopback 
  12. inet addr:127.0.0.1  Mask:255.0.0.0 
  13. inet6 addr: ::1/128 Scope:Host 
  14. UP LOOPBACK RUNNING  MTU:16436  Metric:1 
  15. RX packets:78 errors:0 dropped:0 overruns:0 frame:0 
  16. TX packets:78 errors:0 dropped:0 overruns:0 carrier:0 
  17. collisions:0 txqueuelen:0 
  18. RX bytes:4186 (4.0 KiB)  TX bytes:4186 (4.0 KiB) 

Check all network adapters

The-a parameter is used to display the details of all network adapters, including those that are disabled.

 
 
  1. [avishek@tecmint ~]$ ifconfig -a 
  2. eth0      Link encap:Ethernet  HWaddr 40:2C:F4:EA:CF:0E 
  3. inet addr:192.168.1.3  Bcast:192.168.1.255  Mask:255.255.255.0 
  4. inet6 addr: fe80::422c:f4ff:feea:cf0e/64 Scope:Link 
  5. UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1 
  6. RX packets:163843 errors:0 dropped:0 overruns:0 frame:0 
  7. TX packets:124990 errors:0 dropped:0 overruns:0 carrier:0 
  8. collisions:0 txqueuelen:1000 
  9. RX bytes:154389832 (147.2 MiB)  TX bytes:65085817 (62.0 MiB) 
  10. Interrupt:20 Memory:f7100000-f7120000 
  11. lo        Link encap:Local Loopback 
  12. inet addr:127.0.0.1  Mask:255.0.0.0 
  13. inet6 addr: ::1/128 Scope:Host 
  14. UP LOOPBACK RUNNING  MTU:16436  Metric:1 
  15. RX packets:78 errors:0 dropped:0 overruns:0 frame:0 
  16. TX packets:78 errors:0 dropped:0 overruns:0 carrier:0 
  17. collisions:0 txqueuelen:0 
  18. RX bytes:4186 (4.0 KiB)  TX bytes:4186 (4.0 KiB) 
  19. virbr0    Link encap:Ethernet  HWaddr 0e:30:a3:3a:bf:03 
  20. inet addr:192.168.122.1  Bcast:192.168.122.255  Mask:255.255.255.0 
  21. UP BROADCAST MULTICAST  MTU:1500  Metric:1 
  22. RX packets:0 errors:0 dropped:0 overruns:0 frame:0 
  23. TX packets:0 errors:0 dropped:0 overruns:0 carrier:0 
  24. collisions:0 txqueuelen:0 
  25. RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B) 

Disable a network adapter

 
 
  1. [avishek@tecmint ~]$ ifconfig eth0 down 

Enable Network Adapter

 
 
  1. [avishek@tecmint ~]$ ifconfig eth0 up 

Specify the IP address to the network adapter

Set the IP address "192.168.1.12" for the network adapter eth0 ".

 
 
  1. [avishek@tecmint ~]$ ifconfig eth0 192.168.1.12 

Change the subnet mask of the network adapter eth0:

 
 
  1. [avishek@tecmint ~]$ ifconfig eth0 netmask 255.255.255. 

Change the broadcast address of the network adapter eth0:

 
 
  1. [avishek@tecmint ~]$ ifconfig eth0 broadcast 192.168.1.255 

Specify the IP address, subnet mask, and broadcast address for the network adapter eth0:

 
 
  1. [avishek@tecmint ~]$ ifconfig eth0 192.168.1.12 netmask 255.255.255.0 broadcast 192.168.1.255 

Note: If you set a wireless network card, you can use the "iwconfig" command ". for more examples and usage of ifconfig commands, read "15 useful ifconfig commands ".


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.