LR(1) | General Commands Manual | LR(1) |
lr
— list files,
recursively
lr |
[-0 | -F |
-l [-TA |
-TC | -TM ] |
-S | -f
fmt]
[ -B | -D ]
[-H | -L ]
[-1AGPQXdhsx ] [-U |
-o ord]
[ -e regex]
[-t test]
[-C
[color: ]path]
path ... |
lr
is a versatile tool to generate file
listings with configurable formatting, ordering and filtering.
When no path is given or path is an empty string, the current directory is used by default.
The special path argument
‘-
’ makes lr
read file names from standard input, instead of traversing
path. Likewise, the special path
argument @
file makes
lr
read file names from
file.
The options are as follows:
-0
-F
*/=>@|
’).-l
ls -l
’ (implies
-Q
).-TA
-l
, print atime.-TC
-l
, print ctime.-TM
-l
, print mtime. This is the default.-S
-Q
).-f
fmt-B
-D
prune
will not work,
but entries
and total
are
computed on the fly.-H
-L
-1
-A
-P
$'
...'
(implies -Q
).-Q
-d
-G
NO_COLOR
is set, colors are
never used.-X
-h
-l
(also
%s
).-s
-x
-U
-o
ord-e
regex-t
test-t
and -e
are regarded as
a conjunction.-C
[color:
]pathImplies -GG
.
lr
format strings support the following
escape sequences:
\a
,
\b
, \f
,
\n
, \r
,
\v
\
ddd\x
dd%%
%s
%S
%b
%k
%d
%D
%R
%i
%I
%p
%P
if -s
is
used)%P
%l
%n
%F
*/=>@|
’)%f
/
)%A-
,
%C-
, %T-
%A
x,
%C
x,
%T
x%
x on atime/ctime/mtime%m
%M
%y
bcdfls
’)%g
%G
%u
%U
%e
%t
-D
)%Y
%x
#
’ for files with security
capabilities, ‘+
’ for files with an
ACL, ‘@
’ for files with other
extended attributes.Sort order is string consisting of the following letters.
Uppercase letters reverse sorting. Default sort order is
‘n
’.
a
c
d
e
i
m
n
p
s
t
v
E.g. ‘Sn
’ sorts first by
size, smallest last, and then by name (in case sizes are equal).
lr
tests are given by the following
EBNF:
<expr> ::= <expr> || <expr> -- disjunction | <expr> && <expr> -- conjunction | <expr> ? <expr> : <expr> -- ternary operator | ! <expr> -- negation | ( <expr ) | <timeprop> <numop> <dur> | <numprop> <numop> <num> | <strprop> <strop> <str> | <typetest> | <modetest> | prune -- do not traverse into subdirectories | print -- always true value | skip -- always false value | color <num> -- always true value, override 256-color <timeprop> ::= atime | ctime | mtime <numprop> ::= depth | dev | entries | gid | inode | links | mode | rdev | size | total | uid <numop> ::= <= | < | >= | > | == | = | != <dur> ::= "./path" -- mtime of relative path | "/path" -- mtime of absolute path | "YYYY-MM-DD HH:MM:SS" | "YYYY-MM-DD" -- at midnight | "HH:MM:SS" -- today | "HH:MM" -- today | "-[0-9]+d" -- n days ago at midnight | "-[0-9]+h" -- n hours before now | "-[0-9]+m" -- n minutes before now | "-[0-9]+s" -- n seconds before now | [0-9]+ -- absolute epoch time <num> ::= [0-9]+ ( c -- *1 | b -- *512 | k -- *1024 | M -- *1024*1024 | G -- *1024*1024*1024 | T )? -- *1024*1024*1024*1024 <strprop> ::= fstype | group | name | path | target | user | xattr <strop> ::= == | = | != -- string (in)equality | === | !=== -- case insensitive string (in)equality | ~~ | !~~ -- glob (fnmatch) | ~~~ | !~~~ -- case insensitive glob (fnmatch) | =~ | !=~ | !~ -- POSIX Extended Regular Expressions | =~~ | !=~~ -- case insensitive POSIX Extended Regular Expressions <str> ::= " ([^"] | "")+ " -- use "" for a single " inside " | $[A-Za-z0-9_]+ -- environment variable <typetest> ::= type ( == | = | != ) ( b | c | d | p | f | l ) <modetest> ::= mode ( == | = -- exact permissions | & -- check if all bits of <octal> set | | -- check if any bit of <octal> set ) <octal> | mode = "<chmod>" -- check if symbolic mode is satisfied <octal> ::= [0-7]+ <chmod> ::= <clause> (, <clause>)+ <clause> ::= [guoa]* [+-=] [rwxXstugo]* -- see chmod(1)
The lr
utility exits 0 on success,
and >0 if an error occurs.
Leah Neukirchen <leah@vuxu.org>
lr
is licensed under the terms of the MIT
license.
July 27, 2017 | Debian |