zoukankan      html  css  js  c++  java
  • Linux命令之nohup 和 重定向

    用途:使运行的程序忽略SIGHUP。

    语法:nohup Command [ Arg ... ] [ & ]
    描述:nohup 命令运行由 Command 参数和任何相关的 Arg 参数指定的命令,忽略所有挂断(SIGHUP)信号。在注销后使用 nohup 命令运行后台中的程序。要运行后台中的 nohup 命令,添加 & ( 表示“and”的符号)到命令的尾部。

    那么如果需要重定向该怎么办?

    nohup ./start-dishi.sh > FILE  & 即可

    nohup的man文档中说明了:

    • If standard input is a terminal, redirect it from an unreadable file.
    • If standard output is a terminal, append output to 'nohup.out' if possible, '$HOME/nohup.out' otherwise.
    • If standard error is a terminal, redirect it to standard output.
    • To save output to FILE, use 'nohup COMMAND > FILE'.

    就是说 默认会把标准错误 重定向到标准输出。标准输出默认是 nohup.out, 可以加上‘ > FILE’ 重定向到自定义文件。

  • 相关阅读:
    随笔:金融的“游戏”规则——游戏世界的区块链喵与现实世界的金融科技
    js实现链表
    事件
    JQ操作DOM
    JQuery选择器
    AJAX
    file
    表单
    DOM
    window&navigator&screen&location
  • 原文地址:https://www.cnblogs.com/andrew-chen/p/11549272.html
Copyright © 2011-2022 走看看