Command to list all media entities in console? I have an issue in my site which is not allowing me to visit the /en/admin/content/media page.

I'm looking for an approach to list and delete media entities on the command line.

When I run drupal debug:entity media I get an error:

[ERROR] &lt;em class="placeholder"&gt;Notice&lt;/em&gt;: Undefined index: media in &lt;em                                     
         class="placeholder"&gt;Drupal\Console\Command\Debug\EntityCommand-&amp;gt;execute()&lt;/em&gt; (line &lt;em            
         class="placeholder"&gt;79&lt;/em&gt; of &lt;em                                                                     
         class="placeholder"&gt;/home/ubuntu/site/vendor/drupal/console/src/Command/Debug/EntityCommand.php&lt;/em&gt; 
         ). &lt;pre class="backtrace"&gt;Drupal\Console\Command\Debug\EntityCommand-&amp;gt;execute(Object, Object)       
         (Line: 255)                                                                                            
         Symfony\Component\Console\Command\Command-&amp;gt;run(Object, Object) (Line: 971)                          
         Symfony\Component\Console\Application-&amp;gt;doRunCommand(Object, Object, Object) (Line: 248)             
         Symfony\Component\Console\Application-&amp;gt;doRun(Object, Object) (Line: 185)                            
         Drupal\Console\Core\Application-&amp;gt;doRun(Object, Object) (Line: 64)                                   
         Drupal\Console\Application-&amp;gt;doRun(Object, Object) (Line: 148)                                       
         Symfony\Component\Console\Application-&amp;gt;run() (Line: 89)                                             
         require(&amp;#039;/home/ubuntu/site/vendor/drupal/console/bin/drupal.php&amp;#039;) (Line: 4)                
         &lt;/pre&gt;


The docs of this command is also really uninformative.

What's the best approach to list and delete media entities on the command line?
If you use Drush, you can try drush sql-query like this : 
 drush sql-query "Delete from name_table weher condition"