• Welcome to Valhalla Legends Archive.
 

Linux SSH screen cmds

Started by Mephisto, March 13, 2004, 04:03 PM

Previous topic - Next topic

Mephisto

Does anyone have experience using screen on an SSH client?  I started running some programs via SSH with screen so I didn't have to keep it open.  I used screen since -b (background) wouldn't work.  Anyways, can someone give me some useful commands for it, and especially the command to end a screen process?  Thanks!

Adron

You can kill a screen process like any other (kill pid). If you're running a shell or other application inside a screen process, the screen process will terminate when the other process does.

The commands I use most are screen, screen -ls, screen -r and ctrl-a d.

Mephisto

I'm very unfamiliar with SSH other than the basic commands.  I tried to figure out how to get a pid by using ps "application" and it returned bad syntax.

iago

Quote from: Mephisto on March 13, 2004, 04:18 PM
I'm very unfamiliar with SSH other than the basic commands.  I tried to figure out how to get a pid by using ps "application" and it returned bad syntax.

If you mean in a linux shell, try "ps -a | grep [ap name]"
This'll make an interesting test for broken AV:
QuoteX5O!P%@AP[4\PZX54(P^)7CC)7}$EICAR-STANDARD-ANTIVIRUS-TEST-FILE!$H+H*


Mephisto

#4
bash-2.05a$ ps -a | grep [ap run_bot.sh]
grep: Unmatched [ or [^

Mephisto

Nevermind, figured it all out, thx.

cipher

Quote from: Mephisto on March 13, 2004, 04:30 PM
Nevermind, figured it all out, thx.
I doubt you figured it _all_ out, perhaps the simple stuff you were trying to do. Screen is a very powerful tool, and I suggest you really learn how to use it if you like the console. Screen can basically be your whole window manager if you like console apps, and it can be really pretty if you want it to be. It can have virtual tabs (multiple sessions in one window), a locking feature (for when you leave the terminal physically),  split screens, and much more. The best way to learn would probably be to just look at the man page (just type man screen) and learn the key bindings and stuff. I can provide a nice screenrc for you so you can have the virtual tabs shown. for ex: http://cipherd.homelinux.net/~share/images/screenshots/tn/screen-rules.png.html (mine) or http://newds.zefga.net/ss/screen.png (eurijk's)--we happened to be talking about screen recently ;)
Screen can also be useful to people with inconsistent connections (stable ones too, but dialup users love screen) that want to keep the same ssh session going with the commands they last did, and the last text that appeared, etc.
So, to just say you figured it all out that quickly just seemed like you didn't pay attention to a few of the great other uses screen has, other than just for placing a bnet bot in the background.