about summary refs log tree commit diff
path: root/README.md
diff options
context:
space:
mode:
authorChristian Neukirchen <chneukirchen@gmail.com>2015-10-23 20:54:45 +0200
committerChristian Neukirchen <chneukirchen@gmail.com>2015-10-23 20:54:45 +0200
commitb5d4a92b4461e77184c65ec249e3fbe53d22ca1c (patch)
tree76bedf530941e294d00bd4150bce76c15441631c /README.md
parent3b60bbb5942d8ecfc9913d8dbda7b0cf1a0329b3 (diff)
downloadlr-b5d4a92b4461e77184c65ec249e3fbe53d22ca1c.tar.gz
lr-b5d4a92b4461e77184c65ec249e3fbe53d22ca1c.tar.xz
lr-b5d4a92b4461e77184c65ec249e3fbe53d22ca1c.zip
more README.md
Diffstat (limited to 'README.md')
-rw-r--r--README.md29
1 files changed, 29 insertions, 0 deletions
diff --git a/README.md b/README.md
index acf406a..cb9afff 100644
--- a/README.md
+++ b/README.md
@@ -3,6 +3,33 @@
 `lr` is a new tool for generating file listings, which includes the
 best features of `ls(1)`, `find(1)` and `du(1)`.
 
+## Benefits
+
+Over find:
+* friendly and logical C-style filter syntax
+* getopt is used, can mix filters and arguments in any order
+* can sort
+* compute directory sizes
+* can strip leading `./`
+
+Over ls:
+* sorts over all files, not per directory
+* copy & paste file names from the output since they are relative to pwd
+* ISO dates
+* powerful filters
+
+## Rosetta stone
+
+* `ls`: `lr -1 | column`
+* `find .`: `lr` (or `lr -U` for speed.)
+* `ls -l`: `lr -1r`
+* `ls -ltrc`: `lr -l1oc`
+* `find . -name '*.c'`: `lr -t 'name ~~ "*.c"'`
+* `find . -regex 'c$': `lr -t 'path =~ "c$"'`
+* `find -L /proc/*/fd -maxdepth 1 -type f -links 0 -printf '%b %p\n'`:
+`lr -UL1 -t 'type == f && links == 0' -f '%b %p\n' /proc/*/fd`
+* `find "${@:-.}" -name HEAD -execdir sh -c 'git rev-parse --resolve-git-dir . >/dev/null 2>/dev/null && pwd' ';'`: `lr -0t 'name == "HEAD"' "$@" | xapply -fz 'cd %Q[1/-$] && git rev-parse --resolve-git-dir . >/dev/null && pwd' - 2>/dev/null`
+
 ## Usage:
 
 	lr [-0|-F|-l|-f FMT] [-D] [-H|-L] [-1Qdsx] [-U|-o ORD] [-t TEST]* PATH...
@@ -58,6 +85,8 @@ Uppercase letters reverse sorting.
 E.g. `Sn` sorts first by size, smallest last, and then by name (in
 case sizes are equal).
 
+Default: `n`.
+
 * `a`: atime.
 * `c`: ctime.
 * `d`: path depth.