Remove line numbers from shell history
It's important to understand the purpose of every single symbol in a command:


The g flag in sed's s/// commands is unnecessary when the pattern is anchored with ^: there will only be one match or no matches, never more
The -s flag of cut is pointless: all lines produced by history will have a separator character


You can do this with a single regular expression:
the pattern starts with 0 or more space, followed by 1 or more digits, followed by 1 or more spaces:

history | sed 's/^ *[0-9][0-9]*  *//'


Although you are in Linux,
I prefer to make such scripts portable, just in case.
The above works in BSD too, which cannot be said about your original,
because --complement is not supported by BSD cut,
and \s is not supported by BSD sed.

Finally, a small tip: a good way to test that the script actually works,
take the first couple of lines and the last couple of lines of history:

{ history | head; history | tail; } | ...