Nothing, really! This is a feature request for a use case that causes me trouble, maybe you will tell me that there is a better way to achieve the wanted behavior and I will thank you for that! What I want is to be able to use namespace for the arguments of the pm2 delete command.
Basically, I would like to be able to do:
pm2 start --name foo_1 app.js
pm2 start --name foo_2 app.js
pm2 start --name bar_1 app.js
pm2 delete foo_*
Please run the following command (available on PM2 >= 2.6)
$ pm2 report
===============================================================================
--- PM2 REPORT (Wed Aug 02 2017 11:43:00 GMT+0200 (CEST)) ---------------------
===============================================================================
--- Daemon -------------------------------------------------
pm2d version : 2.6.1
node version : 6.11.1
node path : /usr/bin/npm
argv : /usr/bin/nodejs,/home/me/dev/optoruta/node_modules/pm2/lib/Daemon.js
argv0 : node
user : me
uid : 1000
gid : 1000
uptime : 1206min
===============================================================================
--- CLI ----------------------------------------------------
local pm2 : 2.6.1
node version : 6.11.1
node path : /home/me/dev/optoruta/./node_modules/pm2/bin/pm2
argv : /usr/bin/nodejs,/home/me/dev/project_1/node_modules/pm2/bin/pm2,report
argv0 : node
user : me
uid : 1000
gid : 1000
===============================================================================
--- System info --------------------------------------------
arch : x64
platform : linux
type : Linux
cpus : Intel(R) Core(TM) i7-3520M CPU @ 2.90GHz
cpus nb : 4
freemem : 374644736
totalmem : 8273784832
home : /home/me
===============================================================================
--- PM2 list -----------------------------------------------
โโโโโโโโโโโโฌโโโโโฌโโโโโโโฌโโโโโโฌโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโฌโโโโโโฌโโโโโโฌโโโโโโโฌโโโโโโโโโโโ
โ App name โ id โ mode โ pid โ status โ restart โ uptime โ cpu โ mem โ user โ watching โ
โโโโโโโโโโโโดโโโโโดโโโโโโโดโโโโโโดโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโดโโโโโโดโโโโโโดโโโโโโโดโโโโโโโโโโโ
===============================================================================
--- Daemon logs --------------------------------------------
โโโโโโโโโโโโฌโโโโโฌโโโโโโโฌโโโโโโฌโโโโโโโโโฌโโโโโโโโโโฌโโโโโโโโโฌโโโโโโฌโโโโโโฌโโโโโโโฌโโโโโโโโโโโ
โ App name โ id โ mode โ pid โ status โ restart โ uptime โ cpu โ mem โ user โ watching โ
โโโโโโโโโโโโดโโโโโดโโโโโโโดโโโโโโดโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโดโโโโโโดโโโโโโดโโโโโโโดโโโโโโโโโโโ
Use `pm2 show <id|name>` to get more details about an app
You just need to use slash : pm2 delete /foo.*/ :)
Alright, amazing :smile:! Thank you very much! May I ask you if you can point me to some documentation to help me understand why this works? :confused:
@hadrien-toma when the "name" given starts and ends with a /, it's detected as a regular expression. source.
Exactly what I wanted, thank you both!
Most helpful comment
You just need to use slash :
pm2 delete /foo.*/:)