ZHANG BIAO . ORG

^


linux screen 命令详解

• LIUNX • 阅读: 69189

linux screen 命令详解
一、背景

系统管理员经常需要SSH 或者telent 远程登录到Linux 服务器,经常运行一些需要很长时间才能完成的任务,比如系统备份、ftp 传输等等。通常情况下我们都是为每一个这样的任务开一个远程终端窗口,因为它们执行的时间太长了。必须等待它们执行完毕,在此期间不能关掉窗口或者断开连接,否则这个任务就会被杀掉,一切半途而废了。

二、简介

GNU Screen是一款由GNU计划开发的用于命令行终端切换的自由软件。用户可以通过该软件同时连接多个本地或远程的命令行会话,并在其间自由切换。

GNU Screen可以看作是窗口管理器的命令行界面版本。它提供了统一的管理多个会话的界面和相应的功能。

会话恢复
只要Screen本身没有终止,在其内部运行的会话都可以恢复。这一点对于远程登录的用户特别有用——即使网络连接中断,用户也不会失去对已经打开的命令行会话的控制。只要再次登录到主机上执行screen -r就可以恢复会话的运行。同样在暂时离开的时候,也可以执行分离命令detach,在保证里面的程序正常运行的情况下让Screen挂起(切换到后台)。这一点和图形界面下的VNC很相似。
多窗口
在Screen环境下,所有的会话都独立的运行,并拥有各自的编号、输入、输出和窗口缓存。用户可以通过快捷键在不同的窗口下切换,并可以自由的重定向各个窗口的输入和输出。Screen实现了基本的文本操作,如复制粘贴等;还提供了类似滚动条的功能,可以查看窗口状况的历史记录。窗口还可以被分区和命名,还可以监视后台窗口的活动。
会话共享
Screen可以让一个或多个用户从不同终端多次登录一个会话,并共享会话的所有特性(比如可以看到完全相同的输出)。它同时提供了窗口访问权限的机制,可以对窗口进行密码保护。
GNU's Screen 官方站点:http://www.gnu.org/software/screen/

三、语法

screen -AmRvx -ls -wipe-h <行数>-s

参数说明

-A  将所有的视窗都调整为目前终端机的大小。
-d <作业名称>  将指定的screen作业离线。
-h <行数>  指定视窗的缓冲区行数。
-m  即使目前已在作业中的screen作业,仍强制建立新的screen作业。
-r <作业名称>  恢复离线的screen作业。
-R  先试图恢复离线的作业。若找不到离线的作业,即建立新的screen作业。
-s  指定建立新视窗时,所要执行的shell。
-S <作业名称>  指定screen作业的名称。
-v  显示版本信息。
-x  恢复之前离线的screen作业。
-ls或--list  显示目前所有的screen作业。
-wipe  检查目前所有的screen作业,并删除已经无法使用的screen作业。

四、常用screen参数

screen -S yourname -> 新建一个叫yourname的session
screen -ls -> 列出当前所有的session
screen -r yourname -> 回到yourname这个session
screen -d yourname -> 远程detach某个session
screen -d -r yourname -> 结束当前session并回到yourname这个session

在每个screen session 下,所有命令都以 ctrl+a(C-a) 开始。
C-a ? -> 显示所有键绑定信息
C-a c -> 创建一个新的运行shell的窗口并切换到该窗口
C-a n -> Next,切换到下一个 window
C-a p -> Previous,切换到前一个 window
C-a 0..9 -> 切换到第 0..9 个 window
Ctrl+a [Space] -> 由视窗0循序切换到视窗9
C-a C-a -> 在两个最近使用的 window 间切换
C-a x -> 锁住当前的 window,需用用户密码解锁
C-a d -> detach,暂时离开当前session,将目前的 screen session (可能含有多个 windows) 丢到后台执行,并会回到还没进 screen 时的状态,此时在 screen session 里,每个 window 内运行的 process (无论是前台/后台)都在继续执行,即使 logout 也不影响。
C-a z -> 把当前session放到后台执行,用 shell 的 fg 命令则可回去。
C-a w -> 显示所有窗口列表
C-a t -> Time,显示当前时间,和系统的 load
C-a k -> kill window,强行关闭当前的 window
C-a [ -> 进入 copy mode,在 copy mode 下可以回滚、搜索、复制就像用使用 vi 一样

C-b Backward,PageUp 
C-f Forward,PageDown 
H(大写) High,将光标移至左上角 
L Low,将光标移至左下角 
0 移到行首 
$ 行末 
w forward one word,以字为单位往前移 
b backward one word,以字为单位往后移 
Space 第一次按为标记区起点,第二次按为终点 
Esc 结束 copy mode 

C-a ] -> Paste,把刚刚在 copy mode 选定的内容贴上

文章标签: liunx
点此生成 >> 文章海报


已经是第一篇文章了~
下一篇 : 2021年双十二,博客搭建完成
留言

取消回复



已有 28310 条留言
  1. 2026-07-25 03:07:21
    回复

    First impressions: true fortune casino is a well-rounded online casino that has rapidly gained a following across the UK. Built around its official home at true-fortune.com, the brand positions itself as a full-service destination for real-money play. You may also see it referred to as truefortune or even true-fortune casino, the offering caters to anyone wanting a polished and safe British-facing environment.

    When it comes to game catalogue, the site offers an impressively deep line-up — think 3,000 to 5,000+ games. Big-name studios including Pragmatic Play, NetEnt and Play'n GO sit behind the catalogue, delivering high-RTP slots, progressive jackpots and blockbuster releases. RTP figures routinely climb into six figures, and that keeps the thrill alive.

    The real-time section is a real strength. Streamed via Evolution Gaming, players can join professionally hosted games at any hour. Human croupiers deal in real time live on camera, with fun entertainment titles like Crazy Time and Lightning Roulette top off the offering. The result is as immersive as it comes.

    When it comes to bonuses, the operator keeps things generous. First-timers are welcomed by a welcome package worth ?1,500 across your first deposits, and there's often a free chip offer to start with. Reload deals, weekly cashback and a rewards ladder keep existing players busy, remember to reading the rollover conditions on each promo. You can find out more at truefortune no deposit for the freshest deals.

    On practicalities, true fortune casino handles all the usual banking options — Visa, Mastercard and Skrill, e-wallets like Neteller, alongside cryptocurrency. Registration takes refreshingly fast, starting from a small entry point near ?20, and withdrawals are processed swiftly.

    In summary, the true casino rounds things off with always-on help via live chat and email, a smooth mobile app for iOS and Android, and reliable licensing and security. For British punters after a modern, generous site, true fortune is firmly on the shortlist.

  2. 2026-07-25 03:07:29
    回复

    Introduction: the true casino brand known as true fortune is a modern gaming site that has steadily built a reputation across the UK. Operating from its flagship platform at true-fortune.com, the brand markets itself as an all-in-one home for slots, tables and live gaming. You may also see it referred to as truefortune or true-fortune casino, the overall package caters to anyone wanting a polished and safe British-facing environment.

    In terms of the game collection, true fortune casino offers an impressively deep selection — think over 5,000 slots and tables. Top-tier developers like Pragmatic Play, Big Time Gaming and Betsoft power the catalogue, so you get generous return-to-player rates, progressive jackpots and classic favourites. RTP figures frequently climb into the tens of thousands, and that keeps the thrill alive.

    The live casino is a genuine strength. Streamed via Evolution and Pragmatic Play Live, UK members can take a seat at professionally hosted games 24/7. Real dealers host every table from purpose-built studios, plus engaging show-style formats of the game-show variety round out the experience. This makes for as immersive as a screen allows.

    Bonuses and offers, the site keeps things generous. New players are welcomed by a matched bonus of ?1,000 plus 100 free spins, and there's often a no deposit bonus for those testing the waters. Cashback, reload offers and a rewards ladder keep existing players busy, so it's smart to reviewing the rollover conditions on each promo. UK readers can see the current codes on truefortune casino no deposit bonus codes for the freshest deals.

    When it's time to bank, the site supports plenty of ways to pay — Visa and Mastercard, Skrill and Neteller, and even Bitcoin. Sign-up is just a couple of minutes, with a modest minimum deposit around ?10, while cashouts are handled fast.

    To wrap up, this operator rounds things off with always-on help via live chat and email, a smooth mobile experience, and reliable licensing and security. If you're in the UK who want a reliable, well-stocked home, true fortune is well worth a look.

  3. 2026-07-25 03:07:39
    回复

    Introduction: the true casino brand known as true fortune is a modern gaming site that has steadily gained a following among UK players. Built around its main hub at true-fortune.com, the operator markets itself as a one-stop home for slots, tables and live gaming. Some players know it as truefortune or even true-fortune casino, the overall package is geared toward anyone wanting a clean, reliable GB-oriented environment.

    On the game collection, this operator delivers a seriously large selection — somewhere in the region of 3,000 to 5,000+ titles. Big-name studios such as Pragmatic Play, Big Time Gaming and Betsoft power the reels, delivering generous return-to-player rates, progressive jackpots and old-school fruit machines. RTP figures frequently stretch to the tens of thousands, which keeps things interesting.

    Live dealer play is a genuine strength. Driven by industry leaders like Evolution, UK members can sit down at authentic dealer tables around the clock. Human croupiers stream in HD from purpose-built studios, plus engaging game shows such as Monopoly Live complete the experience. The result is as close to a real casino as a screen allows.

    On the promotions front, true fortune casino keeps things generous. New players can claim a sign up bonus up to ?1,500 across your first deposits, while regulars enjoy a no deposit bonus to start with. Loyalty perks and reloads plus a VIP club reward loyalty, though it's always worth reading the wagering requirements first. Players can find out more on true fortune casino free chip, updated regularly.

    On practicalities, true fortune casino accepts a broad mix of banking options — Visa and Mastercard, e-wallets like Neteller, and even Bitcoin. Registration takes just a couple of minutes, with a low entry point of about ?10, and payouts are handled fast.

    In summary, this operator backs it all up with round-the-clock help via live chat and email, a slick browser and app platform, and proper regulation and SSL encryption. If you're in the UK looking for a modern, generous casino, it's firmly on the shortlist.

  4. 2026-07-25 03:07:49
    回复

    Introduction: true fortune casino stands out as an increasingly popular gaming site that has rapidly built a reputation with British punters. Built around its flagship platform at true-fortune.com, the brand markets itself as a full-service venue for slots, tables and live gaming. You may also see it referred to as truefortune or simply true-fortune casino, the offering is geared toward anyone wanting a clean, reliable GB-oriented platform.

    When it comes to game catalogue, true fortune casino offers a genuinely huge range — think 3,000 to 5,000+ titles. Leading providers such as NetEnt, Microgaming and Yggdrasil power the catalogue, which means generous return-to-player rates, bonus-buy features and old-school fruit machines. Payouts on many titles often climb into the tens of thousands, helping keep the sessions exciting.

    The real-time section is another highlight. Streamed via Evolution and Pragmatic Play Live, you can join authentic dealer tables at any hour. Trained hosts host every table from purpose-built studios, and popular game shows such as Monopoly Live round out the lobby. It's about as authentic as online play gets.

    On the promotions front, the site keeps things generous. Fresh sign-ups are greeted with a welcome package worth ?1,000 plus 100 free spins, and there's often a free chip offer for those testing the waters. Loyalty perks and reloads and a tiered VIP scheme keep existing players busy, remember to checking the wagering requirements before you claim. You can see the current codes over at true fortune promo code whenever you like.

    When it's time to bank, true fortune casino accepts a broad mix of payment methods — debit cards, Paysafecard and e-wallets, and even Bitcoin. Sign-up is quick and painless, starting from a small minimum deposit around ?10, and withdrawals are processed swiftly.

    Overall, this operator backs it all up with always-on help via live chat and email, a slick browser and app platform, and solid player-safety measures. For UK players looking for a trustworthy, feature-rich site, true fortune is well worth a look.

  5. 2026-07-25 03:07:16
    回复

    Glad the writer kept this short rather than padding it out, the points stand on their own without needing extra context, and a look at buildfuturefocusedpaths kept the same approach going, brevity is a sign of confidence in the substance and the team here clearly trusts their content to land without filler.

  6. 2026-07-25 03:07:56
    回复

    Reading this between two meetings turned out to be the highlight of the morning, and a stop at bondcrest continued that highlight quality, content that outshines the structured parts of a working day is doing something well beyond ordinary and this site has produced multiple such highlights for me already this week alone.

  7. 2026-07-25 03:07:57
    回复

    بصراحة أنا بقالي كام شهر بلعب على المنصة دي من الموبايل، وقررت أكتب تجربتي علشان في ناس بتتخبط عن موضوع 888starz app. أكتر حاجة حبيتها إن فيه كم ألعاب ضخم، فيه حوالي أكتر من 2500 لعبة سلوتس تقريبًا، ومش كلها حشو زي بعض المواقع التانية.

    اللي بيوفروا الألعاب كلها بروڤايدرز كبار زي Pragmatic وPlay'n GO وBetsoft. أنا مدمن Gates of Olympus وSweet Bonanza، وبحب كمان Book of Dead. اللي مبيحبش السلوتس فيه قسم الديلر المباشر من Evolution بكروبيهات حقيقيين، وشوز زي كريزي تايم ممتعة فعلًا.

    بالنسبة للبونص كويس: أول شحن بياخد مضاعفة 100% ومعاه لفات مجانية، وفيه عرض بدون إيداع لو بتحب تجرب الأول. بس انتبه لحتة من شرط المراهنة اللي حوالي x40 — دي نقطة لازم تفهمها. لو عايز تتطلع على آخر العروض روح لـ تنزيل 888 علطول.

    نقطة مهمة لينا كمصريين إن خيارات السحب والإيداع متنوعة: فيزا وماستركارد، وe-wallets، وكمان عملات رقمية زي البيتكوين. السحب بيجيلي بسرعة معقولة، مش زي مواقع بتماطل أسبوع. التسجيل نفسه مش معقد، والحد الأدنى للإيداع صغير.

    النقطة الوحيدة اللي زعلتني إن الدعم بيتأخر في وقت الذروة، ومرة استنيت شوية على الشات. غير كده تثبيت البرنامج بيطلب إعدادات يدوية شوية، حاجة عادية بس مبتدئ ممكن يلخبط. 888starz apk شغال حلو على الموبايل وبيجيله تحديثات باستمرار.

  8. 2026-07-25 03:07:05
    回复

    صراحة أنا بقالي شوية أشهر بلعب على المنصة دي من الموبايل، وحبيت أشارككم رأيي علشان ناس كتير هنا في مصر بتسأل عن موضوع برنامج 888. اللي عجبني من البداية إن المكتبة كبيرة جدًا، فيه حوالي 3000 لعبة سلوتس تقريبًا، ومش كلها حشو زي بعض المواقع التانية.

    شركات الاستوديوهات ناس محترمين زي Pragmatic Play وNetEnt. أنا بلعب كتير على سويت بونانزا وجيتس أوف أوليمبوس، ومن وقت للتاني بجرب Book of Dead. اللي مبيحبش السلوتس فيه قسم الديلر المباشر من Evolution بكروبيهات حقيقيين، وشوز زي كريزي تايم بتحسسك إنك في كازينو حقيقي.

    بالنسبة للبونص محترم صراحة: الديبوزيت الأول بياخد مضاعفة 100% مع فري سبينز، وفيه عرض بدون إيداع لو بتحب تجرب الأول. بس انتبه لحتة من متطلبات الرهان اللي حوالي 40 ضعف — دي حاجة كتير بينسوها. لو عايز تتطلع على آخر العروض روح لـ تحميل برنامج 888starz وانت مطمن.

    حاجة عجبتني إن فيه أكتر من وسيلة: فيزا وماستركارد، ومحافظ زي Skrill وNeteller، وكمان Bitcoin. الـwithdrawal بياخد يوم لتلاتة على المحفظة، مقارنة بحاجات تانية سحبت منها. التسجيل نفسه بياخد دقايق، والحد الأدنى للإيداع بسيط.

    النقطة الوحيدة اللي زعلتني إن الدعم أحيانًا بيرد ببطء، ومرة استنيت شوية على الشات. غير كده تثبيت البرنامج بيطلب إعدادات يدوية شوية، حاجة عادية بس مبتدئ ممكن يلخبط. الأبليكيشن سلس على الموبايل وبيجيله تحديثات باستمرار.

  9. 2026-07-25 03:07:35
    回复

    At a glance: true fortune casino stands out as a modern iGaming destination that has rapidly gained a following among UK players. Anchored by its official home at true-fortune.com, the site aims to be a full-service home for real-money play. Some players know it as truefortune or simply true-fortune casino, the experience is tailored for players seeking a sleek, trustworthy British-facing experience.

    In terms of the game collection, the site delivers a genuinely huge selection — somewhere in the region of over 5,000 games. Big-name studios including Pragmatic Play, NetEnt and Play'n GO power the catalogue, delivering strong RTP percentages, Megaways mechanics and classic favourites. Jackpot pools routinely stretch to six figures, and that keeps the thrill alive.

    Live dealer play is another highlight. Powered by industry leaders like Evolution, players can join professionally hosted games around the clock. Trained hosts deal in real time from purpose-built studios, with fun game shows like Crazy Time and Lightning Roulette top off the offering. The result is as immersive as a screen allows.

    When it comes to bonuses, the operator does not hold back. Fresh sign-ups are welcomed by a matched bonus of ?1,500 across your first deposits, while regulars enjoy a free chip offer to start with. Cashback, reload offers and a tiered VIP scheme keep existing players busy, so it's smart to reading the playthrough terms first. UK readers can see the current codes at true fortune casino no deposit code, updated regularly.

    On practicalities, the cashier accepts a broad mix of ways to pay — debit cards, Skrill and Neteller, alongside cryptocurrency. Registration takes refreshingly fast, starting from a small minimum deposit near ?20, while cashouts land quickly.

    Overall, true fortune casino rounds things off with round-the-clock customer support, a slick browser and app platform, and solid licensing and security. For British punters who want a modern, generous site, it's firmly on the shortlist.

  10. 2026-07-25 03:07:31
    回复

    Bookmark earned, calendar reminder set, share queued, all from one good post, and a look at securebusinessrelationships did the same, when a single reading session triggers multiple downstream actions you know the content has actually moved me beyond the page and this site is moving me at that higher level reliably.

  11. 2026-07-25 03:07:51
    回复

    Overview: true fortune casino stands out as an increasingly popular gaming site that has rapidly gained a following across the UK. Built around its main hub at true-fortune.com, the operator markets itself as a one-stop home for real-money play. You may also see it referred to as truefortune or simply true-fortune casino, the overall package is tailored for anyone wanting a clean, reliable British-facing experience.

    On the game collection, true fortune casino offers a genuinely huge selection — somewhere in the region of 4,000+ slots and tables. Leading providers such as NetEnt, Microgaming and Yggdrasil supply the reels, so you get strong RTP percentages, bonus-buy features and old-school fruit machines. Jackpot pools routinely climb into six figures, which keeps the thrill alive.

    The live casino is another strength. Powered by Evolution Gaming, players can join authentic dealer tables around the clock. Human croupiers stream in HD live on camera, and popular show-style formats such as Monopoly Live round out the experience. The result is as close to a real casino as it comes.

    When it comes to bonuses, the site is genuinely competitive. First-timers can claim a sign up bonus up to ?1,500 across your first deposits, while regulars enjoy a free spins deal for those testing the waters. Reload deals, weekly cashback plus a VIP club add ongoing value, so it's smart to checking the playthrough terms on each promo. Players can find out more over at true fortune no deposit bonus code whenever you like.

    For deposits and cashouts, the site accepts plenty of banking options — Visa, Mastercard and Skrill, Paysafecard and e-wallets, alongside cryptocurrency. Registration takes refreshingly fast, with a low minimum deposit around ?10, and withdrawals land quickly.

    Overall, the true casino is supported by always-on help via live chat and email, a smooth browser and app platform, and reliable player-safety measures. For British punters who want a reliable, well-stocked casino, it's a strong contender.

  12. 2026-07-25 03:07:47
    回复

    Took the time to read the comments on this post too and they were also worth reading, and a stop at bestshoppingchoice suggested the community quality matches the content quality, when the conversation around a piece is as good as the piece itself you know you have found a real corner of the internet.

  13. 2026-07-25 03:07:58
    回复

    Following the post through to the end without my attention drifting once, and a look at globalonlinebuyinghub earned the same uninterrupted attention, content that holds attention without manipulating it is content with substantive pull and this site has demonstrated that substantive pull across multiple pieces in a single reading session reliably here today.

  14. 2026-07-25 04:07:59
    回复

    pin-up condiciones giros gratis www.pinup71548.icu

  15. 2026-07-25 04:07:26
    回复

    Decided this was the best thing I had read all morning, and a stop at trustedenterprisealliances kept that ranking intact, ranking my reading is something I do mentally throughout the day and the top rank is competitive and not easily won but this site won it without needing to overstate its claims for that.

  16. 2026-07-25 04:07:29
    回复

    A piece that did not lecture even when it had clear positions, and a look at trustedshoppingzone maintained the same teaching without preaching tone, finding the line between informing and lecturing is hard and most sites land on the wrong side of it but this one has clearly figured out how to inform without becoming preachy.

  17. 2026-07-25 04:07:34
    回复

    Worth saying that the quiet confidence of the writing is what landed first, and a look at digitalbuyingexperience continued that quiet quality, confident writing without the loud display of confidence is a rare combination and this site has clearly developed both the knowledge and the editorial restraint to land that combination consistently.

  18. 2026-07-25 04:07:57
    回复

    Took me back a step or two on an assumption I had been making, and a stop at shopcrafty pushed that reconsideration further, writing that gently corrects the reader without being aggressive about it is a rare diplomatic skill and the team here clearly knows how to land critical points without turning readers off.

  19. 2026-07-25 04:07:13
    回复

    Anyone curious about this topic would do well to start here, the foundation laid is solid, and a stop at claritytoresults would round out their understanding nicely, this is the kind of resource I would point a friend toward without hesitation if they asked me where to begin learning about anything in this area.

  20. 2026-07-25 04:07:21
    回复

    mostbet stream nézés http://mostbet30598.online