New answers tagged

0

By itself, lsof -i will only list Internet information. You can add file information (or show that instead) using the -d option. For example: lsof -d txt | grep -E '/httpd.pl$' because (unless a process changes the name under which it runs) the command name will match the actual filename which was loaded. That file has to be executable, of course ...


1

The lsof command can't see your PID because of shell expansion. That means $(pgrep -nf a.out) will be executed on your local server, not remote. To avoid this expansion, use single quote instead of double quote. Simple example: $ foo=local $ ssh debian8 "foo=remote; echo $foo" local $ ssh debian8 'foo=remote; echo $foo' remote You might have problem ...



Top 50 recent answers are included