Linux – Network Commands (Faq)

1. To check teh server ipaddress

Mostly ran as root user.

[sdbt ~]# ifconfig

eth0 Link encap:Ethernet HWaddr 08:00:27:5F:30:15
inet addr:192.168.1.121 Bcast:192.168.1.255 Mask:255.255.255.0
inet6 addr: fd58:bad4:e15c:ba00:a00:27ff:fe5f:3015/64 Scope:Global
inet6 addr: fe80::a00:27ff:fe5f:3015/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:28511 errors:0 dropped:0 overruns:0 frame:0
TX packets:794 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2311102 (2.2 MiB) TX bytes:56107 (54.7 KiB)

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:24 errors:0 dropped:0 overruns:0 frame:0
TX packets:24 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:1984 (1.9 KiB) TX bytes:1984 (1.9 KiB)

2. To check if the server is reachable.

wget – A free utility for non-interactive download of files from the Web.

3. To check disk free space.

[sdbt ~]$ wget -r –tries=3 https://www.sakthidbtechnology.com/
–2018-07-09 15:38:07– https://www.sakthidbtechnology.com/
Resolving www.sakthidbtech.com… 52.221.230.147
Connecting to www.sakthidbtech.com|52.221.230.147|:443… connected.
HTTP request sent, awaiting response… 200 OK
Length: unspecified [text/html] Saving to: www.sakthidbtech.com/index.html
[ <=> ] 65,381 –.-K/s in 0.08s
2018-07-09 15:38:07 (841 KB/s) – “www.sakthidbtech.com/index.html” saved [65381]

[sdbt ~]$ wget -drc https://www.sakthidbtechnology.com/

4. Command to check if a port availability.

[sdbt ~] # netstat -plunt
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State PID/Program name
tcp 0 0 0.0.0.0:5672 0.0.0.0:* LISTEN 2111/qpidd
tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 1620/rpcbind
tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 1988/sshd
tcp 0 0 127.0.0.1:631 0.0.0.0:* LISTEN 1763/cupsd
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN 2068/master
tcp 0 0 0.0.0.0:32898 0.0.0.0:* LISTEN 1696/rpc.statd
tcp 0 0 :::111 :::* LISTEN 1620/rpcbind
tcp 0 0 :::22 :::* LISTEN 1988/sshd
tcp 0 0 ::1:631 :::* LISTEN 1763/cupsd
tcp 0 0 :::55491 :::* LISTEN 1696/rpc.statd
udp 0 0 0.0.0.0:947 0.0.0.0:* 1620/rpcbind
udp 0 0 0.0.0.0:52662 0.0.0.0:* 1696/rpc.statd
udp 0 0 0.0.0.0:600 0.0.0.0:* 1696/rpc.statd
udp 0 0 0.0.0.0:5353 0.0.0.0:* 1661/avahi-daemon
udp 0 0 0.0.0.0:111 0.0.0.0:* 1620/rpcbind
udp 0 0 0.0.0.0:631 0.0.0.0:* 1763/cupsd
udp 0 0 0.0.0.0:33155 0.0.0.0:* 1661/avahi-daemon
udp 0 0 :::947 :::* 1620/rpcbind
udp 0 0 :::33481 :::* 1696/rpc.statd
udp 0 0 :::111 :::* 1620/rpcbind