linux后台启动命令

后台启动:nohup bin/hive --service metastore >> logs/metastore.log 2>&1 &
Linux shell中2>&1的含义解释 (全网最全,看完就懂)
Shell 输入/输出重定向

nohup:

  1. nohup stands for "no hang up". It allows a command to continue running even after the user who issued the command logs out or closes the terminal.

    When a command is prefixed with nohup, it ensures that the command is immune to hangups (i.e., disconnections from the controlling terminal).

    &:

  2. The & (ampersand) operator is used to run a command in the background. It allows the user to continue using the terminal while the command is running.

    When a command is followed by &, it runs asynchronously in the background, and the user can continue issuing other commands in the same terminal session.

  • nohup ensures that a command keeps running even after the terminal is closed, while & runs a command in the background, allowing the user to continue using the terminal for other tasks. However, without nohup, background processes started with & will terminate if the terminal is closed.
相关推荐
javachen__12 分钟前
JsonView:一套VO实现多角色字段返回
java·linux·服务器
睡一觉就好了。22 分钟前
TcpSocket
linux
小陈运维26 分钟前
使用kubeadm初始化IPV4/IPV6集群
linux·docker·云原生·容器·kubernetes
东风微鸣39 分钟前
精简 Ubuntu Linux 固件包:每个 N100 节点省下约 450 MB
linux·ubuntu·postgresql
snhna41 分钟前
Agent 上云部署实战(上):从 GitHub 到 Linux,用 Dify 跑通中间件、域名和 HTTPS
linux·中间件
Pniubi1 小时前
基于openclaw开发skill与自研agent中的skill开发区别
服务器·agent·skill·openclaw·龙虾
jaronho1 小时前
【脚本】 【Linux】启动所有网卡
linux·运维·服务器
草莓熊Lotso1 小时前
【C++ 基于微服务的即时通讯系统】基建三件套:gflags + gtest + spdlog 源码编译安装与实战入门
linux·网络·数据库·c++·微服务·log4j
JavaPub-rodert1 小时前
服务器不能访问 Docker Hub,镜像怎么搬过去?讲透 docker save、load、export、import 与离线镜像分发
运维·服务器·docker
H.莓飛1 小时前
【C++】类与对象(末):static、友元与拷贝优化
linux·开发语言·c++·visual studio