$ exec /bin/ls ( 一瞬ファイルの一覧が表示され、端末は失われる )
$ ulimit -a core file size (blocks, -c) 0 data seg size (kbytes, -d) unlimited file size (blocks, -f) unlimited pending signals (-i) 1024 max locked memory (kbytes, -l) 32 max memory size (kbytes, -m) unlimited open files (-n) 2048 pipe size (512 bytes, -p) 8 POSIX message queues (bytes, -q) 819200 stack size (kbytes, -s) 10240 cpu time (seconds, -t) unlimited max user processes (-u) 6114 virtual memory (kbytes, -v) unlimited file locks (-x) unlimited $ ulimit -c unlimited # core 生成の許可 $ cat & [1] 3462 $ kill -ILL 3462 # 強制的に core を生成 [1]+ Stopped cat $ fg cat 不正な命令です (core dumped) $ ls -l core* -rw------- 1 ycos ycos 974848 9月 30 12:10 core.3462 $ ulimit -c 0 # core 生成の抑制 $ cat & [1] 3464 $ kill -ILL 3464 [1]+ Stopped cat $ fg cat 不正な命令です
$ nohup ping localhost & [1] 3553 $ nohup: appending output to `nohup.out' $ exit ( 一端シェルを終了 ) ( 再度ログインしなおす ) $ ps ax |grep ping 3553 ? S 0:00 ping localhost 3561 pts/1 R+ 0:00 grep ping # 直前に実行していた ping はまだ継続中 # また端末(pts/1など)はなく ? として表記されている $ tail nohup.out # 出力結果は nohup.out に保存されている 64 bytes from localhost (127.0.0.1): icmp_seq=74 ttl=64 time=0.071 ms 64 bytes from localhost (127.0.0.1): icmp_seq=75 ttl=64 time=0.058 ms 64 bytes from localhost (127.0.0.1): icmp_seq=76 ttl=64 time=0.105 ms 64 bytes from localhost (127.0.0.1): icmp_seq=77 ttl=64 time=0.107 ms 64 bytes from localhost (127.0.0.1): icmp_seq=78 ttl=64 time=0.075 ms 64 bytes from localhost (127.0.0.1): icmp_seq=79 ttl=64 time=0.073 ms 64 bytes from localhost (127.0.0.1): icmp_seq=80 ttl=64 time=0.070 ms 64 bytes from localhost (127.0.0.1): icmp_seq=81 ttl=64 time=0.107 ms 64 bytes from localhost (127.0.0.1): icmp_seq=82 ttl=64 time=0.060 ms 64 bytes from localhost (127.0.0.1): icmp_seq=83 ttl=64 time=0.071 ms $ kill -9 3553
$ trap 'echo GET USR1 signal' 30 $ trap 'echo GET USR1 signal' USR1 $ kill -USR1 $$ GET USR1 signalシグナルには番号だけでなく、ニーモニックも利用できます。
$ set - a b c d $ echo $* ; shift a b c d $ !! echo $* ; shift b c d $ !! echo $* ; shift c d
$ ( date ; sleep 3 ) & date [2] 19776 1998年06月03日 10時57分04秒 $ 1998年06月03日 10時57分04秒 $ ( date ; sleep 3 ) & wait ; date [2] 19775 1998年06月03日 10時54分58秒 1998年06月03日 10時55分01秒