__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
#!/usr/bin/env python3
# Copyright (c) 2009, Giampaolo Rodola'. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Similar to 'ps aux --forest' on Linux, prints the process list
as a tree structure.
$ python3 scripts/pstree.py
0 ?
|- 1 init
| |- 289 cgmanager
| |- 616 upstart-socket-bridge
| |- 628 rpcbind
| |- 892 upstart-file-bridge
| |- 907 dbus-daemon
| |- 978 avahi-daemon
| | `_ 979 avahi-daemon
| |- 987 NetworkManager
| | |- 2242 dnsmasq
| | `_ 10699 dhclient
| |- 993 polkitd
| |- 1061 getty
| |- 1066 su
| | `_ 1190 salt-minion...
...
"""
from __future__ import print_function
import collections
import sys
import psutil
def print_tree(parent, tree, indent=''):
try:
name = psutil.Process(parent).name()
except psutil.Error:
name = "?"
print(parent, name)
if parent not in tree:
return
children = tree[parent][:-1]
for child in children:
sys.stdout.write(indent + "|- ")
print_tree(child, tree, indent + "| ")
child = tree[parent][-1]
sys.stdout.write(indent + "`_ ")
print_tree(child, tree, indent + " ")
def main():
# construct a dict where 'values' are all the processes
# having 'key' as their parent
tree = collections.defaultdict(list)
for p in psutil.process_iter():
try:
tree[p.ppid()].append(p.pid)
except (psutil.NoSuchProcess, psutil.ZombieProcess):
pass
# on systems supporting PID 0, PID 0's parent is usually 0
if 0 in tree and 0 in tree[0]:
tree[0].remove(0)
print_tree(min(tree), tree)
if __name__ == '__main__':
main()
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| internal | Folder | 0755 |
|
|
| battery.py | File | 1.14 KB | 0755 |
|
| cpu_distribution.py | File | 3.86 KB | 0755 |
|
| disk_usage.py | File | 1.54 KB | 0755 |
|
| fans.py | File | 771 B | 0755 |
|
| free.py | File | 1.17 KB | 0755 |
|
| ifconfig.py | File | 3.58 KB | 0755 |
|
| iotop.py | File | 4.92 KB | 0755 |
|
| killall.py | File | 693 B | 0755 |
|
| meminfo.py | File | 1.03 KB | 0755 |
|
| netstat.py | File | 1.98 KB | 0755 |
|
| nettop.py | File | 4.32 KB | 0755 |
|
| pidof.py | File | 977 B | 0755 |
|
| pmap.py | File | 2.16 KB | 0755 |
|
| procinfo.py | File | 11.63 KB | 0755 |
|
| procsmem.py | File | 3.69 KB | 0755 |
|
| ps.py | File | 4.2 KB | 0755 |
|
| pstree.py | File | 1.65 KB | 0755 |
|
| sensors.py | File | 2.78 KB | 0755 |
|
| temperatures.py | File | 1.5 KB | 0755 |
|
| top.py | File | 7.34 KB | 0755 |
|
| who.py | File | 946 B | 0755 |
|
| winservices.py | File | 1.64 KB | 0755 |
|