title: Laravel 5 - How to create an Artisan command to execute bash script
body: <p>I want to get an artisan command to run a bash script when executed. </p>
  
  <p>So I've created an artisan command using the following</p>
  
  <p><code>php artisan make:command backupList --command=backup:list</code> </p>
  
  <p>And here is backupList.php </p>
  
  <pre><code>&lt;?php
  
  namespace App\Console\Commands;
  
  require_once __DIR__ . '/vendor/autoload.php'; 
  
  use Illuminate\Console\Command;
  
  
  class backupDB extends Command
  {
  
  protected $signature = 'backup:list {name}';
  
  protected $description = 'Database backup tool';
  
  
  
  public function __construct()
  {
      parent::__construct();
  }
  
  
  
  public function handle()
  {
      $this-&gt;exec('ls -la');
  }
  }
  </code></pre>
  
  <p>In handle() exec and shell_exec don't seem to work, are there any alternatives to get the artisan command to run bash in shell? </p>