在后台执行 磁盘修复

nohup fsck.ext3 -y /dev/sdb1 > /root/fsck.log 2>&1 & 

使用nohup和& 让进程在后台执行;

nohup的解释:
nohup - run a command immune to hangups, with output to a non-tty

可见,nohup 的使用是十分方便的,只需在要处理的命令前加上 nohup 即可,标准输出和标准错误缺省会被重定向到 nohup.out 文件中。一般我们可在结尾加上"&"来将命令同时放入后台运行,也可用">filename 2>&1"来更改缺省的重定向文件名。

相关文章:

  • 2022-12-23
  • 2021-06-03
  • 2022-12-23
  • 2022-12-23
  • 2021-06-04
  • 2021-09-02
猜你喜欢
  • 2022-02-08
  • 2021-07-14
  • 2021-06-03
  • 2021-12-22
  • 2021-09-16
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案