plan9fox/sys/man/1/walk

134 lines
1.9 KiB
Plaintext
Raw Normal View History

2019-03-25 23:10:02 +00:00
.TH WALK 1
.SH NAME
walk \- walk a path
.SH SYNOPSIS
.B walk
[
.B -dftxu
] [
.B -n
.I mind,maxd
] [
.B -e
2020-01-28 00:53:58 +00:00
.I statfmt
2019-03-25 23:10:02 +00:00
] [
.I name ...
]
.SH DESCRIPTION
.I Walk
recursively descends any directory arguments,
printing the name of each file on a separate line.
2020-01-28 00:53:58 +00:00
When no arguments are given, the working directory
2019-03-25 23:10:02 +00:00
is assumed.
Non-directory arguments are checked for existence,
then printed, if so.
.PP
Options are:
.TP
.B -d
Print only directories.
.TP
.B -f
Print only non-directories.
.TP
.B -t
Print a file only if it has the temporary flag set.
.TP
.B -x
Print a file only if it has any executable bits set.
.TP
.B -u
Unbuffered output.
.TP
.B -n min,max
Set the inclusive range of depths for filtering in results.
Both
.I min
and
.I max
are optional.
An argument of
.I n
2020-08-29 08:53:59 +00:00
with no comma is equivalent to
.IR 0,n .
2019-03-25 23:10:02 +00:00
.TP
.B -e statfmt
Specify the output format.
Each character in
.I statfmt
specifies a file attribute to display.
The printed attributes are separated by spaces.
.RS \n(INu
2019-03-25 23:10:02 +00:00
.PP
The statfmt characters are as follows:
.TF .
.TP
.B U
owner name (uid)
.TP
.B G
group name (gid)
.TP
.B M
name of last user to modify (muid)
.TP
.B a
last access time (atime)
.TP
.B m
last modification time (mtime)
.TP
.B n
final path element (name)
.TP
.B p
path
.TP
.B q
qid path.version.type (see
.IR stat (2))
.TP
.B s
size in bytes
.TP
.B x
permissions
.TP
.B D
server device
.TP
.B T
server type (kernel device rune)
2019-03-25 23:10:02 +00:00
.PD
.PP
The default statfmt is simply,
.IR p .
.SH EXAMPLES
List files in a directory, sorted by modification time.
.IP
.EX
walk -femp catpics | sort -n | sed 's/^[^ ]+ //'
.EE
.PP
Print the size and path of files (excluding dirs)
in the working directory.
.IP
.EX
walk -fn1 -esp
.EE
.PD
.SH SOURCE
.B /sys/src/cmd/walk.c
.SH SEE ALSO
.IR ls (1),
.IR du (1)
.SH BUGS
Manipulating ifs is a nuisance.
.PP
File names are assumed to not contain newlines.
.PP
Correct invocation requires too much thought.
2019-07-02 14:04:31 +00:00
.SH HISTORY
.I Walk
first appeared in 9front (March, 2019).