Linux TTY Shell Cheat Sheet
Source https://steflan-security.com
Last updated
SHELL=/bin/bash script -q /dev/nullpython -c 'import pty; pty.spawn("/bin/bash")'python3 -c 'import pty; pty.spawn(“/bin/bash”)'echo os.system('/bin/bash')/bin/bash -iperl -e 'exec "/bin/bash";'ruby -e 'exec "/bin/bash"'lua: os.execute('/bin/sh')exec "/bin/sh":!bash:set shell=/bin/bash:shellCTRO+R CTRL+X reset; /bin/bash 1>&0 2>&0!bash#backgrounding the shell process
Ctrl-Z
#checking the number of rows and columns in the host terminal
stty -a
#setting terminal settings like new line, break characters etc.
stty raw -echo
#returning to the shell
fg + ENTER
#declaring environment variables to be able to use cllear etc. and colors
reset
export SHELL=bash
export TERM=xterm-256color
#setting the terminal rows and columns based on the host configuration
stty rows <num> columns <cols>