gsettings set org.gnome.desktop.interface clock-show-date true
I want to copy this command into the clipboard so that I can paste it in a file or an Ask Ubuntu question easily.
I know I can copy this by selecting it and pressing Ctrl+Shift+C, but I want to get a mouse free answer.
Best Answer
You can use
bash
’s History Expansion, to copy the previous command line to your clipboard without performing command substitution, expansions etc. do:!!
is a shortcut for!-1
, referring to the previous command. Colon:
precedes the modifierq
, which lets the expansion quote the substituted words with single quotes to prevent further substitutions.Example run
To simplify this you can create an
alias
or set a keyboard shortcut in the settings. Readman bash
/HISTORY EXPANSION andman history
to learn more about history expansion.