30 Linux troubleshoot command

Regardless of the problem, effective network troubleshooting follows some specific troubleshooting steps:

  1. ifconfig
  2. Traceroute
  3. df -hT
  4. lsblk
  5. History
  6. last
  7. ls Command
  8. free
  9. Top
  10. Top-i
  11. Chmod
  12. Chown
  13. Ping
  14. du
  15. Version or hostnamectl command
  16. Nslookup
  17. Dig
  18. Netstat
  19. Nbtstat
  20. Apt
  21. curl
  22. Wget
  23. grep (Check logs files)

1. ifconfig

#How to troubleshoot network connectivity with UNIX/Linux server?
ifconfig(interface configuration) network configuration Linux command to assign an address to a network interface and to configure or display the current network interface configuration information.

How to troubleshoot network connectivity with Linux server?

2. Traceroute command

Traceroute is computer network diagnostic commands for displaying networking routes and measuring transit delays of packets. this tool used to track in real time the pathway taken by a packet on an ip network from source to destination.

3. df -hT

The “df” stands for ” disk filesystem”. This Linux command it is used to show the disk storage used in the file system. It defines the number of blocks or storage used or available, and the directory where the file system is mounted and what type of file system are provided.

4. lsblk

lsblk command similar with “df” command. This command showing information about all available space and directory where the file system in mounted with show the specified Unmounted blocks like a tree structure.

5. History

History command is used for view the previously executed command. When you issue so many commands for testing and troubleshooting and you may forget then can use history command but This feature was not available in the Bourne shell. Bash and Korn support this feature.

6. last

Last Linux troubleshoot command is used to show the list of all the users logged in and out since the file /var/log/wtmp was created. In this log you can see the IP address of the machine with login time and date stamp.

7. ls Command

“ls” command use to show list of the files and folders in a given directory. You can also use this command to display details of a file, such as the owner of the file and the permissions assigned to the file. you want to learn more information about the “ls” command, then you have to use “ls –help” or “man ls” command in terminal.

8. free

The “free” command usually display the total amount of free space available along with the amount of memory used physically and swap memory in that system, and also buffers used by the kernel.

9. Top

The “top” Linux troubleshoot command which is used to show Linux processes. It display real-time processing view of the running system. Basically, this command shows the summary information of the system and list of processing or processor and memory consumed percentage which are currently managed by the Linux Kernel.

10. Top -i

Also, “top -i” command display real-time processing view with biref summary.

11. Chmod

The “chmod” Command used to change the permission on a file and directory. You can use symbolic or numeric number for changing.

12. Chown

It slitely similar of chmod command but The ” Chown ” command is used to change file and group ownership of your system.

13. Ping

The “ping” command used to test the ability of the source computer to reach a specified destination computer. it’s basically used as a simple way to verify that a computer can communicate over the network with another computer or network device. this command are used both platform Linux and windows.

14. du

The “du” command is used in Linux/Unix systems that allows a user to gain disk usage information quickly.

15. Version or hostnamectl command

Version and hostnamectl both are different command is used display Linux kernel version and other information such as Linux distribution architecture, operating system.

16. Nslookup

Nslookup stands for ” name server lookup”. It’s a command-line tool used in both terminal window and Linux. which is basically used to find the ip address that corresponds to a host or the domi name that corresponds to an IP address this process we called ” Reverse DND Lookup “.

17. Dig

The “Dig” command stands for Domain Information Groper it’s used to collects data about Domain Name Server. The dig command is very useful for diagnosing DNS Problems and is also used to display DNS information for troubleshooting. It is basically used by network administrator.

18. Netstat

The “netstat” utility will give you useful information about the active connections on a particular computer. It provides you detailed information about each protocol any port on computer that is listening or that has established a connection with another computer.
You should remember TCP/IP based application like FTP. And Telnet will communicate using a particular TCP or UDP port. When one of these programs or service is running on computer, it means that port is listening for new connection attempts from other computer. A connection listed in netstat can be in one of four bstates:

  • Listening means that a particular port is open and waiting for connections, but no active connections have been made to it.
  • Established means that a particular connection is active an FTP client has connected to an FTP server, a client web browser has connected to a world wide web (www) service, and the like.
  • Time wait means that a connection has been made, but it hasn’t received any data for some time and is in the process of timing out.
  • Close wait means that an active connections is being close. The netstat command has a number of command -line switches that will produce different types of troubleshoot output.

19. Nbtstat

nbtstat is quite similar to netstat, except that it displays information specifically relating to NetBIOS over TCP. Nbtstat will show you NetBT protocol statiso and NetBIOS name tablet for local and remote computer. Nbtstat will also you to display and refresh the NetBIOS cache.

20. Apt

Apt stand for Advanced packageing tool it’s command line utility for updating, removing, installing and managing deb package on Debian, Ubuntu, Kali relative Linux distribution. it’s most relevantly used commands from the apt-get and apt-cache tools.

21. curl

Curl is command line tool to transfer data to or from server, usual curl supported multiple protocol ( Like: FTP, POP3, IMAP, HTTP, SCP, SMTP, SFTP, TELNET, LDAP, FILE). curl is preferred for automation and it is designed to work without user interaction. This tool can transfer multiple files in single click.

22. Wget

The wget command is a command line utility for downloading files from the Internet. It similar of curl command. It supports multiple files downloading in the background, resuming downloads, limiting the bandwidth used for downloads and viewing headers.

23. Grep

Example: grep DOMAINNAME  /usr/local/apache/logs/access_log

Grep is a command-line interface tool that help you to find a string in a file or stream. So, if you want find out last login on particular domain (www.example.com) on your server use that command.

5/5 - (2 votes)
Sharing Is Caring:

Leave a Comment