Getting os.system to work in Python Console?
Ok, it seems subprocess can be used instead; note here you have to specify the shell explicitly, e.g. try pasting this script in Python Console:

import subprocess
p = subprocess.Popen(['bash', '-c', 'echo AAaa'], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out, err = p.communicate()
print(out, err)


The output to that is:

&gt;&gt;&gt; ...
&gt;&gt;&gt; print(out, err)
b'AAaa\n' b''


Note that if you intend to do "piping" bash commands, things get a tad bit more complicated (see Python - How to call bash commands with pipe? - Stack Overflow); so for instance, to call echo BBbb | xsel -b and actually have it succeed (that is, have the string end up on clipboard), you should split the two processes, and establish the pipe via Python:

import subprocess
import shlex
p1 = subprocess.Popen(shlex.split("echo BBbb"), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
p2 = subprocess.Popen(shlex.split("xsel -b"), stdin=p1.stdout)
out, err = p2.communicate()
print(out, err)


The output to this looks like:

&gt;&gt;&gt; ...
&gt;&gt;&gt; print(out, err)
None None


... but the string BBbb does end up on clipboard, as intended.