让程序以后台进程的形式执行

[root@localhost ~]# nohup java -jar nioTest.jar &

 

显示所有用户的所有进程

[root@localhost ~]# ps aux
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
root         1  0.0  0.0  10348   692 ?        Ss   Aug08   0:01 init [3]                                   
root         2  0.0  0.0      0     0 ?        S<   Aug08   0:00 [migration/0]
root         3  0.0  0.0      0     0 ?        SN   Aug08   0:00 [ksoftirqd/0]
root         4  0.0  0.0      0     0 ?        S<   Aug08   0:00 [watchdog/0]
root         5  0.0  0.0      0     0 ?        S<   Aug08   0:00 [migration/1]
root         6  0.0  0.0      0     0 ?        SN   Aug08   0:00 [ksoftirqd/1]
root         7  0.0  0.0      0     0 ?        S<   Aug08   0:00 [watchdog/1]
root         8  0.0  0.0      0     0 ?        S<   Aug08   0:00 [migration/2]
root         9  0.0  0.0      0     0 ?        SN   Aug08   0:00 [ksoftirqd/2]
root        10  0.0  0.0      0     0 ?        S<   Aug08   0:00 [watchdog/2]
root        11  0.0  0.0      0     0 ?        S<   Aug08   0:00 [migration/3]
root        12  0.0  0.0      0     0 ?        SN   Aug08   0:00 [ksoftirqd/3]
root        13  0.0  0.0      0     0 ?        S<   Aug08   0:00 [watchdog/3]
root        14  0.0  0.0      0     0 ?        S<   Aug08   0:00 [events/0]

...

 

显示包含指定文字的进程

[root@localhost ~]# ps aux|grep java

root      1140  0.0  0.4 1159524 19348 ?       Sl   08:38   0:00 java -jar nioTest.jar
root      1402  0.0  0.0  61148   748 pts/1    S+   09:34   0:00 grep java

 

查看后台进程的日志

查看某文件的新增内容

tail -f nohup.out