shithub: riscv

ref: de1a460fa13ed2bffbdc3cb046cc8831c1d22008
dir: /sys/man/1/walk/

View raw version
.TH WALK 1
.SH NAME
walk \- walk a path
.SH SYNOPSIS
.B walk
[
.B -dftxu
] [
.B -n
.I mind,maxd
] [
.B -e
.I statfmt
] [
.I name ...
]
.SH DESCRIPTION
.I Walk
recursively descends any directory arguments,
printing the name of each file on a separate line.
When no arguments are given, the working directory
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
with no comma is equivalent to
.IR 0,n .
.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
.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)
.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.
.SH HISTORY
.I Walk
first appeared in 9front (March, 2019).