Using .exec() is very good for short commands, with little output. If you don't actually need the shell, you can do even better with .execFile(), which runs the desired command directly, without first creating a shell and then running the command in it. See https://nodejs.org/api/child_process.html#child_process_child_process_execfile_file_args_options_callback for more information on this.