You could get the first and last node of a particular session with (here the first session "0"):
sqlite3 rtabmap.db "select min(id) from Node where map_id=0"
sqlite3 rtabmap.db "select max(id) from Node where map_id=0"
# to get all map ids in the database:
sqlite3 rtabmap.db "select distinct(map_id) from Node"
then use those ids with the commands of option 2 of that
post.
cheers,
Mathieu