R*****o 发帖数: 14902 | 1 比如grep something from a big file. 如何让shell背后执行grep?
好像是 最后加个 %还是&? | d********g 发帖数: 10550 | 2 &
但你也可以用screen,比&还要方便,互不影响
【在 R*****o 的大作中提到】 : 比如grep something from a big file. 如何让shell背后执行grep? : 好像是 最后加个 %还是&?
| c****j 发帖数: 258 | 3 nohup grep too_basic big_file &
setsid grep too_basic2 big_file 0my_basic2 2>my_basic_bad | f*******d 发帖数: 71 | | i*****e 发帖数: 1359 | 5 我发现screen里面用ssh的话好像就不行了
譬如我这里
A连接外网跟内网,B只在内网。我从外网ssh到A,然后ssh到B工作。
你说我在哪里执行screen呢?我试了在A执行screen然后ssh,也试了ssh到B以后再
screen,也试了在A执行screen,然后ssh到B,然后在B再执行screen,好像都不灵~
这种情况怎么办啊?
【在 d********g 的大作中提到】 : & : 但你也可以用screen,比&还要方便,互不影响
| N****w 发帖数: 21578 | 6 运行两个 screen
用不同的热键激活? hehe
【在 i*****e 的大作中提到】 : 我发现screen里面用ssh的话好像就不行了 : 譬如我这里 : A连接外网跟内网,B只在内网。我从外网ssh到A,然后ssh到B工作。 : 你说我在哪里执行screen呢?我试了在A执行screen然后ssh,也试了ssh到B以后再 : screen,也试了在A执行screen,然后ssh到B,然后在B再执行screen,好像都不灵~ : 这种情况怎么办啊?
| r*****8 发帖数: 2697 | 7 前面有牛人推荐 tmux, 比screen强大方便多了
用上tmux之后, 再也不用screen了, hehe | i*****e 发帖数: 1359 | 8 不知道怎么弄,反正我在B上detach的话,一断开A和B的ssh,B上的程序就死了~
【在 N****w 的大作中提到】 : 运行两个 screen : 用不同的热键激活? hehe
| r*****8 发帖数: 2697 | 9 这在tmux里很容易: Ctrl-b s
【在 N****w 的大作中提到】 : 运行两个 screen : 用不同的热键激活? hehe
| r*****8 发帖数: 2697 | 10 simple tutorial:
You start the screen program by typing "screen" at the command prompt.
Screen first creates an initial window and places you inside of it.
To create a new window, and be placed inside of it, type "CTRL-a c". (Hold
down the control key and typing a, then type c for "create.") Now you have
two virutal windows, and you are in the second one you created.
To navigate back to the first window, type "CTRL-a spacebar." Type it again,
and you return to the second window. CTRL-a spacebar pages through the open
windows.
To go to window 0, type "CTRL-a 0." Likewise, to go to window 2, type "CTRL-
a 2."
In general, screen commands are accessed by typing "CTRL-a" followed by a
keystroke. The following gives a summary of screen commands for basic
navigation.
CTRL-a c Create a new window
CTRL-a spacebar Go to next window
CTRL-a backspace or del Go to previous window
CTRL-a 2 Go to window 2
CTRL-a w List windows
CTRL-a d Detach screen (still running)
To exit a window, just exit from the shell in that window, and the window is
killed.
It is possible to "detatch" a session. In this case, the session is running
independent of your login window, and when you exit your login window, the
session contiues to run. When you relogin later, you "re-attatch" the
session to your new login window. The following commands are relevant.
screen -d -r reattach a session, and if neccessary, detatch it first
screen -d detatch session from terminal
screen -list show status
Sometimes your screen may appear to freeze. You know the connection is still
good, but key strokes do nothing. The problem is that you accidently
pressed Ctrl-S, which causes the terminal window to stop. To exit the
stopped state, you need to press Ctrl-Q.
【在 i*****e 的大作中提到】 : 不知道怎么弄,反正我在B上detach的话,一断开A和B的ssh,B上的程序就死了~
|
|