plstree - display ls or ps output as directory or process trees

git clone git://git.josuah.net/plstree


trees
================================================================================

*plstree* is an collection of awk scripts to display trees, such as process
trees (pstree) or a directory tree (lstree).


pstree
--------------------------------------------------------------------------------

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.

	 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

It have been tested with OpenBSD and busybox awk and ps.


lstree
--------------------------------------------------------------------------------

It reads from the find(1) and ls(1) commands and display it as a tree along
with the details from ls:

	-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

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.

It have been tested with OpenBSD and busybox awk and ps.


tree
--------------------------------------------------------------------------------

The *tree* script is also provided as an example for generating a tree from a
find-style list.

It reads a find-style text and convert it to a tree:

	% find . │ ./tree


* 8ad9fb53 2018-06-12 Josuah Demangeon <mail@josuah.net>
| add a real README (not from the man pages)
| 
* 6bb600c4 2018-06-10 Josuah Demangeon <mail@josuah.net>
| proofread and improve the man pages
| 
* 5e9e94b2 2018-06-10 Josuah Demangeon <mail@josuah.net>
| update the names in the readme too
| 
* fee3d0d9 2018-06-09 Josuah Demangeon <mail@josuah.net>
| show the process memory size instead of the tty
| 
* e3d30e6a 2018-06-09 Josuah Demangeon <mail@josuah.net>
| ptree: also show the argv of each command
| 
* 022d132a 2018-05-08 Josuah Demangeon <mail@josuah.net>
| also remove the 's' in the Makefile
| 
* 8f5c49ce 2018-05-08 Josuah Demangeon <mail@josuah.net>
| remove the 's' to avoid a name clash with pstree
| 
* 15516064 2018-04-25 Josuah Demangeon <mail@josuah.net>
| unicode rules!
| 
* 831aad5b 2018-04-20 Josuah Demangeon <mail@josuah.net>
| examples are more suited to the website than the man page
| 
* a63a6602 2018-04-20 Josuah Demangeon <mail@josuah.net>
| Add a README from the manpages
| 
* e092c20c 2018-04-20 Josuah Demangeon <mail@josuah.net>
| Add man pages
| 
* e8122c7c 2018-04-19 Josuah Demangeon <mail@josuah.net>
| add man pages and a Makefile
| 
* 35d52859 2018-04-19 Josuah Demangeon <mail@josuah.net>
  initial import from ~/bin