Instead of carefully selecting the code in examples, use a copy button for copying the code. This uses https://clipboardjs.com/ for copying. For the bash code examples only line starting with $ prompt are copied. The $ prompt itself is not copied.