Quantcast
Channel: Programming – Gea-Suan Lin's BLOG
Viewing all articles
Browse latest Browse all 99

使用 Bash 內建功能做出來的 ps aux

$
0
0

在「ps aux written in bash without forking (github.com/izabera)」這邊看到的有趣東西,原連結是 GitHub 上面的專案「ps aux written entirely in bash without ever forking」。

以前偶而會碰到 process 已經爆掉,只剩下一個 shell 的情況,這時候只能自己利用 shell 內建的指令觀察系統的狀態,像是用 echo * 取代 ls 這種方法。

不過只用內建功能就把 ps aux 做出來算是很厲害了,從 /proc 挖了許多資料出來...

PS:真的遇到需要用的話,可以貼上 psaux.bash 裡面的內容。


Viewing all articles
Browse latest Browse all 99