plstree

display ls or ps output as directory or process trees
Log | Files | Refs | README

commit 8ad9fb53fc342737d2ab544be348a01353c8c73d
parent 6bb600c443072c795242155b40d04d4b721a1baa
Author: Josuah Demangeon <mail@josuah.net>
Date:   Tue, 12 Jun 2018 23:06:03 +0200

add a real README (not from the man pages)

Diffstat:
MMakefile | 3---
MREADME | 93++++++++++++++++++++++++++++++++++++++++++++++---------------------------------
2 files changed, 54 insertions(+), 42 deletions(-)

diff --git a/Makefile b/Makefile @@ -3,9 +3,6 @@ MAN1 = ltree.1 ptree.1 all: -README: $(MAN1) - mandoc -T ascii $(MAN1) | col -bx >$@ - install: mkdir -p $(PREFIX)/bin cp $(BIN) $(PREFIX)/bin diff --git a/README b/README @@ -1,56 +1,71 @@ -LTREE(1) General Commands Manual LTREE(1) +trees +================================================================================ -NAME - ltree - list a tree of a directory with details +*plstree* is an collection of awk scripts to display trees, such as process +trees (pstree) or a directory tree (lstree). -SYNOPSIS - ltree [dir] -DESCRIPTION - The ltree list the content of dir recursively and format the output into - a tree with details from ls -l. +pstree +-------------------------------------------------------------------------------- - If dir is not provided, the current working directory is listed. +It reads from the ps(1) command, so it is portable if there is POSIX awk(1) and +ps(1). Busybox's ps is not fully POSIX but it still works. -SEE ALSO - find(1), lr(1), ls(1), ptree(1), tree(1) + USER TTY PID STAT COMMAND + root ?? 1 Is init + josuah ?? 90253 S ├─ abduco + josuah ttypb 77909 Ss+ │ └─ vis + josuah ttypb 4072 S+p │ └─ ksh + josuah ttypb 6615 S+p │ └─ awk + josuah ttypb 61142 R+p/2 │ └─ ps + josuah ttyp2 53904 I ├─ enchive + josuah ttyp8 48679 S └─ runsvdir + josuah ?? 38166 Is ├─ runsv + josuah ?? 74922 I │ ├─ svlogd + josuah ?? 62834 Ip │ └─ ssh-agent + josuah ?? 87618 Is ├─ runsv + josuah ?? 10571 I │ ├─ svlogd + josuah ?? 21319 S │ └─ btpd + josuah ?? 18961 Is ├─ runsv + josuah ?? 51149 I │ ├─ svlogd + josuah ?? 59400 S │ └─ qemu-system-x86_ + josuah ?? 14126 Ss └─ runsv + josuah ?? 99171 I └─ svlogd - list files, recursively: https://github.com/chneukirchen/lr, +It have been tested with OpenBSD and busybox awk and ps. -AUTHORS - Josuah Demangeon <mail@josuah.net> -OpenBSD 6.3 April 19, 2018 OpenBSD 6.3 +lstree +-------------------------------------------------------------------------------- ------------------------------------------------------------------------------- +It reads from the find(1) and ls(1) commands and display it as a tree along +with the details from ls: -PTREE(1) General Commands Manual PTREE(1) + -rw-r--r-- 1 josuah wheel 50 Apr 13 08:39 ├─ .gitignore + -rw-r--r-- 1 josuah wheel 683 Apr 19 13:12 ├─ Makefile + drwxr-xr-x 2 josuah wheel 512 Apr 19 01:59 ├─ bin + -rw-r--r-- 1 josuah wheel 142 Apr 19 00:18 │ ├─ agenda + -rwxr-xr-x 1 josuah wheel 891 Apr 19 01:59 │ ├─ git + -rwxr-xr-x 1 josuah wheel 111 Apr 19 01:00 │ ├─ html + -rwxr-xr-x 1 josuah wheel 463 Apr 19 00:18 │ ├─ man + -rwxr-xr-x 1 josuah wheel 235 Apr 19 00:19 │ ├─ page + -rwxr-xr-x 1 josuah wheel 379 Apr 19 00:19 │ └─ stat + drwxr-xr-x 2 josuah wheel 512 Apr 19 15:41 └─ code + -rw-r--r-- 1 josuah wheel 1062 Apr 19 01:35 ├─ iomenu.md + -rw-r--r-- 1 josuah wheel 2492 Apr 19 15:41 └─ trees.md -NAME - ptree - list process tree as a tree +The parsing of ls is simple and mostly safe: to find the path name, it looks +for ' ./', which has no chance to occur ever on ls detail output. -SYNOPSIS - ptree +It have been tested with OpenBSD and busybox awk and ps. -DESCRIPTION - The ptree utility list all processes with child-parent relationship - displayed as a tree, along with aditionnal details. The ptree utility - uses the output of the ps(1) command as described by POSIX, and therefore - do not require a procfs(5) to be mounted at proc. -EXAMPLE - View the process list in a pager without wrapping lines: - ptree | less -S +tree +-------------------------------------------------------------------------------- -SEE ALSO - ltree(1), ps(1) +The *tree* script is also provided as an example for generating a tree from a +find-style list. - Small utilities that use the /proc filesystem: - http://psmisc.sourceforge.net/, +It reads a find-style text and convert it to a tree: - Minimal Homepage of pstree : http://www.thp.uni-duisburg.de/pstree/ - -AUTHORS - Josuah Demangeon <mail@josuah.net> - -OpenBSD 6.3 April 19, 2018 OpenBSD 6.3 + % find . │ ./tree