1、ctrl+z 让正在运行的任务暂停运行, 然后可用 bg %jobId使之后台运行,相当于: 命令 &

2、 jobs -l 查看任务

3、 echo $$ 查看当前进程

4、nohup 或者 setpid 是 执行的程序进程脱离当前 shell

5、 unzip -o xxx.zip -d direcotry

6、 crontab -l 、 crontab -e

7、 du -sh 查看当前目录下文件总大小、 du -h --max-depth=1 查看当前目录下最上层个子目录的大小

8、 top 监控进程cpu 和内存

9、 free 查看内存使用

10、 whereis 文件名, 查找文件路径, 如: whereis java, which

  which       查看可执行文件的位置 
  whereis    查看文件的位置 
  locate       配 合数据库查看文件位置 
  find          实际搜寻硬盘查询文件名称

11、 uname -a、cat /proc/version、cat /etc/issue 查看系统信息

12、 让正在运行的运行的任务忽略hup信号,不再因为当前shell关闭而退出运行。disown -h %{jobid} 或 disown -ah | disown -rh。而单独 disown 命令会删除任务,千万别这么做~

disown [-ar] [-h] [jobspec ...] Without options, each jobspec is removed from the table of active jobs. If the -h option is given, each jobspec is not removed from the table, but is marked so that SIGHUP is not sent to the job if the shell receives a SIGHUP. If no jobspec is present, and neither the -a nor the -r option is supplied, the current job is used. If no jobspec is supplied, the -a option means to remove or mark all jobs; the -r option without a jobspec argument restricts operation to running jobs. The return value is 0 unless a jobspec does not specify a valid job.

  • disown -h jobspec 来使某个作业忽略HUP信号。
  • disown -ah 来使所有的作业都忽略HUP信号。
  • disown -rh 来使正在运行的作业忽略HUP信号。

参考资料:

1、 http://blog.sina.com.cn/s/blog_605f5b4f0100x2bq.html 让Linux终端中执行的程序在后台运行 从前台变到后台

2、 http://os.51cto.com/art/201312/425014.htm 十个鲜为人知的 Linux 命令 - Part 4

3、http://www.cnblogs.com/peida/archive/2012/11/09/2761928.html 每天一个linux命令(17):whereis 命令

4、Linux下which、whereis、locate、find 命令的区别

5、http://heylinux.com/archives/1282.html  Linux运行与控制后台进程的方法:nohup, setsid, &, disown, screen

6、Linux 技巧:让进程在后台可靠运行的几种方法  https://www.ibm.com/developerworks/cn/linux/l-cn-nohup/

7、http://blog.csdn.net/bytxl/article/details/24018015  linux进程后台运行的几种方法 - nohup/setsid/&/disown/screen

Linux 系统命令的更多相关文章

  1. Linux 系统命令总结

    自己收集到的Linux系统命令大全! 1,查看apache2的连接状态: netstat -n | awk '/^tcp/ {++S[$NF]} END {for(a in S) print a, S ...

  2. 部分linux系统命令(shell 命令)和hadoop命令

    linux系统命令(shell 命令): ls :  只列出文件/目录 ls -l :  会显示文件的详情,如大小等 ls -lh :  会显示文件的详情,但大小以k或者M为单位 ls ../ :  ...

  3. 第一部分 linux系统命令

    一.linux系统命令 pwd 当前目录位置 / 根目录 cd (change direcory) cd ..返回上一层目录 ls 显示当前目录下文件 ls -l 显示目录下详细文件信息 ls -lh ...

  4. Python执行Linux系统命令方法

    Python执行Linux系统命令的4种方法 (1) os.system 仅仅在一个子终端运行系统命令,而不能获取命令执行后的返回信息 复制代码代码如下: system(command) -> ...

  5. PHP面试题及答案解析(7)—Linux系统命令

    1.请解释下列10个shell命令的用途.top.ps.mv.find.df.cat.chmod.chgrp.grep.wc top:该命令提供了实时对系统处理器状态的监控,它能够实时显示系统中各个进 ...

  6. PHP执行linux系统命令

    本文是第一篇,讲述如何在PHP中执行系统命令从而实现一些特殊的目的,比如监控服务器负载,重启MySQL.更新SVN.重启Apache等.第二篇<PHP监控linux服务器负载>:http: ...

  7. Linux系统命令基础

    Linux系统命令基础 前面咱们已经成功安装了Linux系统--centos7,那么现在奔向Linux命令行的世界. Linux命令格式 1.一般情况下,[参数]是可选的,一些情况下[文件或路径]也是 ...

  8. linux系统命令笔记

    一.linux系统目录 /bin 系统命令目录 /dev 设备目录 /home 每个系统用户在home下都有一个目录, 每个用户登录到系统后会自动登录到这个目录下, root用户会在/root文件夹下 ...

  9. Linux系统命令与脚本开发

    系统命令 # cat EFO cat >> file << EOF neirong EOF # 清空 >file 清空文件 [root@Poppy conf]# sed ...

  10. 常用的Linux系统命令

    一.linux简介                                                                                            ...

随机推荐

  1. Java的初始化块、静态初始化块、构造函数的执行顺序及用途探究

    Java与C++有一个不同之处在于,Java不但有构造函数,还有一个”初始化块“(Initialization Block)的概念.下面探究一下它的执行顺序与可能的用途. 执行顺序 首先定义A, B, ...

  2. [LeetCode] Gas Station 加油站问题

    There are N gas stations along a circular route, where the amount of gas at station i is gas[i]. You ...

  3. [LeetCode] Regular Expression Matching 正则表达式匹配

    Implement regular expression matching with support for '.' and '*'. '.' Matches any single character ...

  4. python基础-生成随机字符串方法

    python解释器示例 >>> import uuid >>> uuid.uuid1() UUID('ae6822e6-c976-11e6-82e0-0090f5f ...

  5. C#工程引用自定义目录的DLL

    在App.config里配置: <configuration> <runtime> <assemblyBinding xmlns="urn:schemas-mi ...

  6. iOS开发--OC调用JS篇

    OC调用JS篇 其中相对应的html部分如下: <html> <header> <meta http-equiv="Content-Type" con ...

  7. C#设计模式(3)——工厂方法模式

    一.概念:定义一个用于创建对象的接口,让子类决定实例化哪一个类,工厂方法使一个类的实例化延迟到其子类. 二.代码实现 namespace 设计模式之工厂方法模式 { /// <summary&g ...

  8. C++:通过gethostbyname函数,根据服务器的域名,获取服务器IP

    本代码的编译环境为MAC,系统版本为10.11.6: #include <string.h> #include <netdb.h> #include <stdio.h&g ...

  9. 使用Amoeba for mysql实现mysql读写分离

    Amoeba主要在应用层访问MySQL的时候充当query 路由功能,专注 分布式数据库 proxy 开发.座落与Client.DB Server(s)之间.对客户端透明.具有负载均衡.高可用性.Qu ...

  10. setTimeout和setInterval定时器使用详解测试

    var len=4; while(len--){ var time=setTimeout(function(){ console.log(len); },0); console.log(time); ...