Question

In: Computer Science

What does the ​ netstat command do? The netstat command has many options. Please explain the...

What does the ​ netstat command do? The netstat command has many options. Please
explain the following commonly used options and briefly explain the meaning of the output. How
can you know which program (i.e., process) is using a specific port?


~$​ netstat -a
~$ ​ netstat -l
~$ ​ netstat -s
~$ ​ netstat -p
~$ ​ netstat -r
~$ ​ netstat -ie


You can ignore those lines related to UNIX domain sockets.

Solutions

Expert Solution

Solution:

Netstat command:

As name stated, netstat is formed from the two words network and statistics. Basically, it is a command-line network utility that's controlled via commands. Netstat commands deliver basic statistics on all network activities and informs users which ports are open for tasks and on which addresses and ports the corresponding connections (TCP, UDP) are running.

In single line, we can say that "To show detailed network status information the netstat command are used.".

Explanation of given options:

~$​ netstat -a : This command results in listing all the LISTENING Ports of TCP and UDP connections.
~$ ​ netstat -l : This command results in listing all active listening ports connections.
~$ ​ netstat -s : This command results in displaying statistics for each protocol like TCP, UDP, ICMP, and IP protocols. To specify a set of protocols the -s parameter in the command can be used.
~$ ​ netstat -p : This command results in showing the statistics for the specified protocol.
~$ ​ netstat -r : ​​​​​​​This command results in displaying Kernel IP routing table with netstat and route command.
~$ ​ netstat -ie :​​​​​​​ This command results in showing Kernel interface table, it is similar to ifconfig command.

How can you know which program (i.e., process) is using a specific port?

We can use the netstat command with the -np flags and a pipe to the find or findstr commands.

Syntax:

netstat -np <protocol> | find "port #"

For example: netstat -np TCP | find "80"

Please give thumbsup, if you like it. Thanks.


Related Solutions

What does the ​ ping command do? Please type "ping -c 4 8.8.8.8" and explain the...
What does the ​ ping command do? Please type "ping -c 4 8.8.8.8" and explain the output. What is this "8.8.8.8" IP address? Please briefly explain what happens behind the curtain when the ping command runs.
Please explain the following questions: - What is the Calvin Cycle and what does it do?...
Please explain the following questions: - What is the Calvin Cycle and what does it do? - What is the fluid mosiac model?
Making decisions on what to do can be difficult if there are many options and different...
Making decisions on what to do can be difficult if there are many options and different requirements (criteria) that affect the decision. A practical way to help make decisions that involve selecting the best option from many based on how well each option satisfies each criterion is an “advanced prioritization matrix”. Using an example of purchasing a new car, television, cell phone, computer or any other item, construct an “advanced prioritization matrix” showing all options, multiple criteria, weight of each...
Making decisions on what to do can be difficult if there are many options and different...
Making decisions on what to do can be difficult if there are many options and different requirements (criteria) that affect the decision. A practical way to help make decisions that involve selecting the best option from many based on how well each option satisfies each criterion is an “advanced prioritization matrix”. Using an example of purchasing a new car, television, cell phone, computer or any other item, construct an “advanced prioritization matrix” showing all options, multiple criteria, weight of each...
What does this command do & ps -ef | grep tty | less Searches the output...
What does this command do & ps -ef | grep tty | less Searches the output from the ps command for tty and displays it one screen at a time Displays all of the interactive running processes Searches the output from the ps command for the word more Displays output from the ps command one screen at a time
What is the greater omentum? where is it and what does it do?please explain human anatomy...
What is the greater omentum? where is it and what does it do?please explain human anatomy in detail?
I need to combine two programs that can do the following (a) what ls command does...
I need to combine two programs that can do the following (a) what ls command does and (b) to check each file name to print its content if its name has ".lst" extension. These are the two programs Program - 1 /* * simple-ls.c * Extremely low-power ls clone. * ./simple-ls . */ #include <sys/types.h> #include <dirent.h> #include <stdio.h> #include <stdlib.h> int main(int argc, char **argv) { DIR *dp; struct dirent *dirp; if (argc != 2) { fprintf(stderr, "usage: %s...
What is the Transport Layer and what does it do?   (Please explain flow control, error management,...
What is the Transport Layer and what does it do?   (Please explain flow control, error management, and segmentation and reassembly in the Transport Layer)
Linux operation 1. Explain what this command does: rpm –qai | more ..... ? 2. Ps...
Linux operation 1. Explain what this command does: rpm –qai | more ..... ? 2. Ps – Af |grep -v ^root, Explain how this command to find application processes could helpful in the real world to the system administrator?? 3. Clearly describe 3 valid command options, and their meaning, of this command used to add users? 4. List 2 different variants of the Unix (not Linux) operating system, as well as their corresponding vendor (the company that developed them) ?...
Linux What is the tar command? a. Can you compress files using tar? Please explain how...
Linux What is the tar command? a. Can you compress files using tar? Please explain how and provide a brief example. b. How do you create a tar file? Please provide an example. c. How do you extract files in a tar format? Please provide an example.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT