In this tutorial we’re going to share Top linux commands to Troubleshoot Network Issues. Linux systems’ performance, one must look for difficulties with the CPU, RAM, disc I/O, network usage, and general responsiveness of the system. You can use the following popular Linux commands and utilities to troubleshoot performance issues:
1. ping Command
Tests connectivity to a remote host.
ping wizbrand.com
2. netstat Command
Displays network connections, routing tables, interface statistics, masquerade connections, and multicast memberships.
netstat -tuln
Output: –
![](https://www.devopsfreelancer.com/blog/wp-content/uploads/2024/03/image-2.png)
3. ss Command
Displays socket statistics.
Example :-
ss -tuln
4. ifconfig Command
Displays or configures network interfaces.
Example :-
ifconfig
5. ip Command
Provides extensive networking information.
Example :-
ip addr show
6. arp Command
Displays the ARP cache.
Example :-
arp -a
Output:-
![](https://www.devopsfreelancer.com/blog/wp-content/uploads/2024/03/image-3-1024x106.png)
7. route Command
Displays and manipulates the IP routing table.
Example :-
route -n
Output :-
![](https://www.devopsfreelancer.com/blog/wp-content/uploads/2024/03/image-4-1024x202.png)
8. dig Command
Performs DNS lookup and displays the response.
Example :-
dig wizbrand.com
Output:-
![](https://www.devopsfreelancer.com/blog/wp-content/uploads/2024/03/image-5.png)
9. host Command
Performs DNS lookup and displays the response.
Example :-
host wizbrand.com
Output:-
![](https://www.devopsfreelancer.com/blog/wp-content/uploads/2024/03/image-6-1024x280.png)
10. uptime Command:
Displays system uptime and load average.
Example :-
uptime
![](https://www.devopsfreelancer.com/blog/wp-content/uploads/2024/03/image-7-1024x125.png)
11. free Command
Displays free and used memory in the system.
free -m
Output:-
![](https://www.devopsfreelancer.com/blog/wp-content/uploads/2024/03/image-8-1024x183.png)
12 df Command
Displays disk space usage.
Example :-
df -h
![](https://www.devopsfreelancer.com/blog/wp-content/uploads/2024/03/image-10-1024x406.png)
13 du Command
Displays disk usage of files and directories.
Example :-
du -sh htdocs
Output:-
![](https://www.devopsfreelancer.com/blog/wp-content/uploads/2024/03/image-11-1024x260.png)
14. ps Command
Displays a snapshot of current processes.
Example:-
ps aux
Output:-
![](https://www.devopsfreelancer.com/blog/wp-content/uploads/2024/03/image-12-1024x495.png)
15. ufw Command:
Uncomplicated Firewall, a user-friendly interface to manage iptables firewall.
Example :-
ufw enable
16. iptables Command
Configures firewall rules.
Example :-
iptables -A INPUT -p tcp --dport 22 -j ACCEPT
17. fail2ban Command
Protects against brute-force attacks by monitoring logs and blocking malicious IP addresses.
Example :-
fail2ban-client status
18. sudo Command
Allows users to execute commands with superuser privileges.
Example :-
sudo command
19. ssh-keygen Command
Generates SSH key pairs for authentication
Example:-
ssh-keygen -t rsa
20. top Command
Displays real-time information about system processes and resource usage.
Example:-
top
Output:-
![](https://www.devopsfreelancer.com/blog/wp-content/uploads/2024/03/image-13-1024x576.png)
Thanks for learning 👍👍