pkslow.com 南瓜慢说

  • AllArticles
  • Container
  • Spring
  • Life
  • Cloud
  • Collections
  • About
  • GitHub

  • Search
App Terraform101 English Terraform Middleware config Go Private Kubernetes pkslow Test HTTPS Redis Docker Mac Plan Stream MongoDB Spring DevOps JVM String Map Set List Performance Email Springboot JavaCollections ArrayList Java

Mac uses pstree to show the process tree

Created on: 2021-12-04 | 0 | View: 221

Install

Install the pstree with brew:

$ brew install pstree

Show the help doc:

$ pstree --help
pstree: illegal option -- -
pstree $Revision: 2.39 $ by Fred Hucht (C) 1993-2015
EMail: fred AT thp.uni-due.de

Usage: pstree [-f file] [-g n] [-l n] [-u user] [-U] [-s string] [-p pid] [-w] [pid ...]
   -f file   read input from <file> (- is stdin) instead of running
             "ps -axwwo user,pid,ppid,pgid,command"
   -g n      use graphics chars for tree. n=1: IBM-850, n=2: VT100, n=3: UTF-8
   -l n      print tree to n level deep
   -u user   show only branches containing processes of <user>
   -U        don't show branches containing only root processes
   -s string show only branches containing process with <string> in commandline
   -p pid    show only branches containing process <pid>
   -w        wide output, not truncated to window width
   pid ...   process ids to start from, default is 1 (probably init)

Process group leaders are marked with '='.

Samples

Show the tree with the process name:

$ pstree -s terraform
-+= 00001 root /sbin/launchd
 \-+= 50669 larry /Users/larry/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/213.5744.223/IntelliJ ID
   \-+= 51403 larry /bin/bash --rcfile /Users/larry/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/213
     \-+= 55301 larry terraform apply
       \--- 55302 larry /Users/larry/Software/terraform/terraform apply

Show the tree with the process ID(Both parent and child process):

$ pstree -p 55301
-+= 00001 root /sbin/launchd
 \-+= 50669 larry /Users/larry/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/213.5744.223/IntelliJ ID
   \-+= 51403 larry /bin/bash --rcfile /Users/larry/Library/Application Support/JetBrains/Toolbox/apps/IDEA-U/ch-0/213
     \-+= 55301 larry terraform apply
       \--- 55302 larry /Users/larry/Software/terraform/terraform apply

Show the tree with the process ID(child process):

$ pstree 55301
-+= 55301 larry terraform apply
 \--- 55302 larry /Users/larry/Software/terraform/terraform apply

Code for all: GitHub

欢迎关注微信公众号<南瓜慢说>,将持续为你更新...

file

Recommendations:
Cloud Native
Terraform
Container: Docker/Kubernetes
Spring Boot / Spring Cloud
Https
如何制定切实可行的计划并好好执行

  • Author 作者: LarryDpk 南瓜慢说
  • Link 链接: https://www.pkslow.com/archives/mac-pstree-en
  • 版权声明: 本博客所有文章除特别声明外,不可转载!
# App # Terraform101 # English # Terraform # Middleware # config # Go # Private # Kubernetes # pkslow # Test # HTTPS # Redis # Docker # Mac # Plan # Stream # MongoDB # Spring # DevOps # JVM # String # Map # Set # List # Performance # Email # Springboot # JavaCollections # ArrayList # Java
App Terraform101 English Terraform Middleware config Go Private Kubernetes pkslow Test HTTPS Redis Docker Mac Plan Stream MongoDB Spring DevOps JVM String Map Set List Performance Email Springboot JavaCollections ArrayList Java
通过Terraform创建GCP Pubsub
通过gcloud创建Google Kubernetes Engine(GKE)并通过kubectl访问
  • Contents
  • Site Overview
南瓜慢说

南瓜慢说

多年Java开发,主要专注后端技术:Java/Spring/Springboot/微服务/大数据等。

多读书,多分享;多写作,多整理。

243 Posts
9 Categories
31 Tags
RSS
0%
© 2020 — 2022 南瓜慢说 pkslow The WebSite keeping alive:   粤ICP备20036375号