node run shell command
// You can use 'exec' this way
const { exec } = require("child_process");
exec("ls -la", (error, stdout, stderr) => {
if (error) {
console.log(`error: ${error.message}`);
return;
}
if (stderr) {
console.log(`stderr: ${stderr}`);
return;
}
console.log(`stdout: ${stdout}`);
});
const { exec } = require("child_process");
exec("cat index.js", (error, data, getter) => {
if(error){
console.log("error",error.message);
return;
}
if(getter){
console.log("data",data);
return;
}
console.log("data",data);
});
Also in Shell:
- aws ssm agent installed but does not show in managed instances
- git second commit
- exit ssh session in shell script
- package 'mana-toolkit' has no installation candidate
- getcwd() failed: No such file or directory linux server
- how to uninstall npm package
- react-devtools agent got no connection
- linux os update
- install npm globally
- how to commit changes in git command
- source fish config
- dns_probe_finished_nxdomain linux ubuntu
- npm install react
- git init
- git clone repo with name
- install telnet windows server 2012
- resolv conf linux is being overwritten centos 7
- bash get value after equal sign
- nvcc not working after installing cuda
- move command in linux
- how to clone pull all repositories from github
- rec: command not found
- Error: ENOSPC: System limit for number of file watchers reached
- gparted ubuntu