zoukankan      html  css  js  c++  java
  • Linux作业管理(快捷键、命令)

    Ctrl+C:结束当前命令

    Ctrl+D:输入结束(EOF)

    Ctrl+Z:当前作业放到后台并暂停

    Ctrl+S:暂停屏幕输出

    Ctrl+Q:恢复屏幕输出 

    &:命令放在后台执行

    jobs:查看后台作业

    fg:作业后台到前台(后台stopped、后台running,到前台running)

    bg:让作业后台运行(后台stopped,到后台running)

    小实验

    代码
    $ ping localhost
    #前台执行ping命令
    PING localhost (127.0.0.1) 56(84) bytes of data.
    64 bytes from localhost (127.0.0.1): icmp_seq=1 ttl=64 time=0.035 ms
    64 bytes from localhost (127.0.0.1): icmp_seq=2 ttl=64 time=0.049 ms
    ^Z
    [
    1]+ Stopped ping localhost

    $ jobs
    #查看后台作业
    [
    1]+ Stopped ping localhost

    $ bg %1
    #将ping从后台stopped,变为后台running
    [
    1]+ ping localhost &
    64 bytes from localhost (127.0.0.1): icmp_seq=3 ttl=64 time=0.098 ms

    $ fg %1
    #将ping从后台running,变为前台running
    ping localhost
    64 bytes from localhost (127.0.0.1): icmp_seq=10 ttl=64 time=0.039 ms
    ^Z
    [
    1]+ Stopped ping localhost
    $

    ps:后台运行的命令无法通过Ctrl+C或Ctrl+Z进行控制,需先转移到前台再控制;ubuntu的多个终端间无法看到对方的后台作业。

  • 相关阅读:
    t
    溢出
    https://stackoverflow.com/questions/45591594/fetch-does-not-send-headers
    显示在用户屏幕上的缩略图
    cache buffer
    LZW
    t
    指针悬挂
    使用Linux服务器来通过网络安装和激活Windows 7 —— 一些基本原理
    在C++中如何动态分配一个二维数组
  • 原文地址:https://www.cnblogs.com/todsong/p/1874477.html
Copyright © 2011-2022 走看看