You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
C:/second/nginx/nginx.exe (or say $home/local/nginx)
I wish to get the executable's path of the running nginx file whether it is the first or second. I am aware of this command wmic process where "ExecutablePath like 'c:\\nginx\\nginx%'" get ProcessID in windows. Is there a way I can do it using ps-node so it applies to both linux and win?
var ps = require('ps-node');
ps.lookup({
command: 'nginx',
psargs: 'ux'
}, function(err, resultList ) {
if (err) {
throw new Error( err );
}
resultList.forEach(function( process ){
if( process ){
console.log(process.pid, process.command, **process.ExecutablePath**, process.arguments );
// **process.ExecutablePath** => c:/nginx or usr/bin
}
});
});
The text was updated successfully, but these errors were encountered:
I have two nginx executables running.
C:/nginx/nginx.exe
(or sayusr/bin
)C:/second/nginx/nginx.exe
(or say$home/local/nginx
)I wish to get the executable's path of the running nginx file whether it is the first or second. I am aware of this command
wmic process where "ExecutablePath like 'c:\\nginx\\nginx%'" get ProcessID
in windows. Is there a way I can do it using ps-node so it applies to both linux and win?The text was updated successfully, but these errors were encountered: