wp db export
#output
Succes: Exported to 'dbname-2019-09-16-2790c11.sql'
Often you need the filename. And if you only need the file name that’s annoying to parse.
--porcelain
flag to the rescue!
wp db export --porcelain
#output
dbname-2019-09-16-2790c11.sql
This will work on a lot of commands that have one item output.
Stuff like wp post create ....
Here is a complete list of commands that have the –porcelain flag
Commands that output more items usually have a --format
flag to handle output.