ps
प्रोसेस और सिस्टम
इस्तेमाल
ps aux | ps -efचल रही प्रक्रियाओं का एक बार का स्नैपशॉट देता है; `ps aux` बिना डैश वाला BSD रूप है और `ps -ef` POSIX रूप, और दोनों को मिलाना आम गलती है।
आम विकल्प
| विकल्प | अर्थ |
|---|---|
| aux | BSD form (no dash): every process of every user, including those with no terminal. Works on Linux and macOS. |
| -ef | POSIX form: the same list with the parent PID and the full command line. |
| -p <pid> | Show one process only. |
| -u <user> | Only the processes of that user. |
| -o pid,ppid,%cpu,%mem,comm | Choose exactly which columns to print. |
| --sort=-%cpu | Sort by CPU, highest first. GNU procps only; macOS ps has no --sort. |
उदाहरण
ps aux | grep -i nginxFind the nginx processes and their PIDs.
ps -eo pid,%mem,comm --sort=-%mem | headThe ten processes using the most memory (Linux).
ps -p 1234 -o etime=How long PID 1234 has been running, with no header.
क्या चल रहा है और क्या मशीन खा रहा है। मारने से पहले पहचानना क्रम है।
कैसे पढ़ें
- बड़े कोष्ठक [ ] उस हिस्से को दिखाते हैं जिसे छोड़ा जा सकता है।
- तीन बिंदु … का मतलब है एक से ज़्यादा दिए जा सकते हैं।
- विकल्पों में बड़े-छोटे अक्षर मायने रखते हैं — कुछ कमांड में -r और -R अलग काम करते हैं।
आम सवाल
Q. ps क्या करता है?
चल रही प्रक्रियाओं का एक बार का स्नैपशॉट देता है; `ps aux` बिना डैश वाला BSD रूप है और `ps -ef` POSIX रूप, और दोनों को मिलाना आम गलती है।
Q. इसे कैसे लिखें?
ps aux | ps -ef — बड़े कोष्ठक वह हिस्सा दिखाते हैं जो छोड़ा जा सकता है।
Q. कितने विकल्प जानने लायक़ हैं?
यहाँ 6 दिए हैं; पूरी सूची man ps में है। यह कमांड प्रोसेस और सिस्टम में आती है।
मिलती-जुलती कमांड
man पेज: man ps