You can display custom columns by replacing the '#' with a '*' as documented under --fields in
the calibredb list documentation and help text. Example using #my_rating instead of #rating:
Code:
calibredb --with-library=. list --fields=*my_rating,title --sort-by=rating --ascending
However, you are currently not able to sort by a custom column. I've submitted changes to fix that. With my changes (assuming they are accepted by Kovid) you can use
Code:
calibredb --with-library=. list --fields=*my_rating,title --sort-by=*my_rating --ascending