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
- [avishek@tecmint ~]$ ifconfig
- eth0 Link encap:Ethernet HWaddr 40:2C:F4:EA:CF:0E
- inet addr:192.168.1.3 Bcast:192.168.1.255 Mask:255.255.255.0
- inet6 addr: fe80::422c:f4ff:feea:cf0e/64 Scope:Link
- UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
- RX packets:163843 errors:0 dropped:0 overruns:0 frame:0
- TX packets:124990 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:1000
- RX bytes:154389832 (147.2 MiB) TX bytes:65085817 (62.0 MiB)
- Interrupt:20 Memory:f7100000-f7120000
- lo Link encap:Local Loopback
- inet addr:127.0.0.1 Mask:255.0.0.0
- inet6 addr: ::1/128 Scope:Host
- UP LOOPBACK RUNNING MTU:16436 Metric:1
- RX packets:78 errors:0 dropped:0 overruns:0 frame:0
- TX packets:78 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:0
- 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.
- [avishek@tecmint ~]$ ifconfig -a
- eth0 Link encap:Ethernet HWaddr 40:2C:F4:EA:CF:0E
- inet addr:192.168.1.3 Bcast:192.168.1.255 Mask:255.255.255.0
- inet6 addr: fe80::422c:f4ff:feea:cf0e/64 Scope:Link
- UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
- RX packets:163843 errors:0 dropped:0 overruns:0 frame:0
- TX packets:124990 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:1000
- RX bytes:154389832 (147.2 MiB) TX bytes:65085817 (62.0 MiB)
- Interrupt:20 Memory:f7100000-f7120000
- lo Link encap:Local Loopback
- inet addr:127.0.0.1 Mask:255.0.0.0
- inet6 addr: ::1/128 Scope:Host
- UP LOOPBACK RUNNING MTU:16436 Metric:1
- RX packets:78 errors:0 dropped:0 overruns:0 frame:0
- TX packets:78 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:0
- RX bytes:4186 (4.0 KiB) TX bytes:4186 (4.0 KiB)
- virbr0 Link encap:Ethernet HWaddr 0e:30:a3:3a:bf:03
- inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0
- UP BROADCAST MULTICAST MTU:1500 Metric:1
- RX packets:0 errors:0 dropped:0 overruns:0 frame:0
- TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
- collisions:0 txqueuelen:0
- RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
Disable a network adapter
- [avishek@tecmint ~]$ ifconfig eth0 down
Enable Network Adapter
- [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 ".
- [avishek@tecmint ~]$ ifconfig eth0 192.168.1.12
Change the subnet mask of the network adapter eth0:
- [avishek@tecmint ~]$ ifconfig eth0 netmask 255.255.255.
Change the broadcast address of the network adapter eth0:
- [avishek@tecmint ~]$ ifconfig eth0 broadcast 192.168.1.255
Specify the IP address, subnet mask, and broadcast address for the network adapter eth0:
- [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 ".