When using screen in linux, how can I tell if I\'m in a screen or not? I could do exit and I\'ll exit a screen if I was in one, but if I wasn\'t, then I\'ll end
exit
Another way I've done it is to echo $TERM.
$ echo $TERM screen
Since I end up doing this a lot, I added an alias into my .bashrc file:
alias trm='echo $TERM'
This way, whether in screen or not, if I just execute 'trm' it will show me whether I'm in SCREEN or elsewhere (usually XTERM).