LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Linux command error (https://www.linuxquestions.org/questions/linux-newbie-8/linux-command-error-4175704380/)

Nattyslinux 12-02-2021 04:47 AM

Linux command error
 
(Not all processes could be identified, non-owned process info
will not be shown, you would have to be root to see it all)




That’s the error message I get on Linux after this command: netstat -antp | grep Apache

pan64 12-02-2021 06:11 AM

And what is unclear with it?

Turbocapitalist 12-02-2021 06:49 AM

For the -p option to work, you'll have to run it as root. Also the grep part ought to search for a lower case 'apache' or else use the -i option.

shruggy 12-02-2021 06:51 AM

1. ss, which is a modern replacement for netstat, won't display this error message ;).

2. What netstat -antp | grep Apache is supposed to show? The netstat option -n is short for --numeric-hosts --numeric-ports --numeric-users. Your grep expression will match nothing (not to mention that the names are probably lowercase). BTW, the name of Apache binary is httpd (if that's what you were trying to match) .

frankbell 12-02-2021 08:47 PM

The Apache process is called "httpd."

Turbocapitalist 12-02-2021 09:01 PM

Quote:

Originally Posted by frankbell (Post 6306199)
The Apache process is called "httpd."

On some distros. On others, such as Devuan and Raspberry Pi OS, it goes by 'apache2'.

Code:

$ pgrep -lx apache2
8500 apache2
12950 apache2
12951 apache2

$ lsb_release -rd
Description:    Devuan GNU/Linux 5 (daedalus/ceres)
Release:        5

and

Code:

$ pgrep -lx apache2
537 apache2
13035 apache2
13036 apache2
13037 apache2
13038 apache2
13040 apache2
13172 apache2
15458 apache2
15473 apache2

$ lsb_release -rd
Description:    Raspbian GNU/Linux 10 (buster)
Release:        10


frankbell 12-02-2021 09:23 PM

Quote:

On some distros. On others, such as Devuan and Raspberry Pi OS, it goes by 'apache2'.
Thanks to you, I learned something!

chrism01 12-02-2021 10:24 PM

I always use 'grep -i' ;)


All times are GMT -5. The time now is 11:42 PM.