upgrading xubuntu to 24.04, fresh install, but I’d like to copy the output of both dpkg -l and history to a usb stick.

About history: will it copy all commands I executed on all tabs? I work with several tabs simultaneously.

ETA: thank you for all your input, problem has been solved.