]> git.lizzy.rs Git - plan9front.git/blob - sys/man/1/walk
walk: add D and T fmt characters (fileserver device/type)
[plan9front.git] / sys / man / 1 / walk
1 .TH WALK 1
2 .SH NAME
3 walk \- walk a path
4 .SH SYNOPSIS
5 .B walk
6 [
7 .B -dftxu
8 ] [
9 .B -n
10 .I mind,maxd
11 ] [
12 .B -e
13 .I statfmt
14 ] [
15 .I name ...
16 ]
17 .SH DESCRIPTION
18 .I Walk
19 recursively descends any directory arguments,
20 printing the name of each file on a separate line.
21 When no arguments are given, the working directory
22 is assumed.
23 Non-directory arguments are checked for existence,
24 then printed, if so.
25 .PP
26 Options are:
27 .TP
28 .B -d
29 Print only directories.
30 .TP
31 .B -f
32 Print only non-directories.
33 .TP
34 .B -t
35 Print a file only if it has the temporary flag set.
36 .TP
37 .B -x
38 Print a file only if it has any executable bits set.
39 .TP
40 .B -u
41 Unbuffered output.
42 .TP
43 .B -n min,max
44 Set the inclusive range of depths for filtering in results.
45 Both
46 .I min
47 and
48 .I max
49 are optional.
50 .TP
51 .B -e statfmt
52 Setting the statfmt string allows specifying the data
53 .I walk
54 should print.
55 It takes a string of characters, each corresponding
56 to some piece of information about the file being
57 traversed, and prints them separated by spaces.
58 .PP
59 The statfmt characters are as follows:
60 .TF .
61 .TP
62 .B U
63 owner name (uid)
64 .TP
65 .B G
66 group name (gid)
67 .TP
68 .B M
69 name of last user to modify (muid)
70 .TP
71 .B a
72 last access time (atime)
73 .TP
74 .B m
75 last modification time (mtime)
76 .TP
77 .B n
78 final path element (name)
79 .TP
80 .B p
81 path
82 .TP
83 .B q
84 qid path.version.type (see
85 .IR stat (2))
86 .TP
87 .B s
88 size in bytes
89 .TP
90 .B x
91 permissions
92 .TP
93 .B D
94 server device
95 .TP
96 .B T
97 server type (kernel device rune)
98 .PD
99 .PP
100 The default statfmt is simply,
101 .IR p .
102 .SH EXAMPLES
103 List files in a directory, sorted by modification time.
104 .IP
105 .EX
106 walk -femp catpics | sort -n | sed 's/^[^ ]+ //'
107 .EE
108 .PP
109 Print the size and path of files (excluding dirs)
110 in the working directory.
111 .IP
112 .EX
113 walk -fn1 -esp
114 .EE
115 .PD
116 .SH SOURCE
117 .B /sys/src/cmd/walk.c
118 .SH SEE ALSO
119 .IR ls (1),
120 .IR du (1)
121 .SH BUGS
122 Statfmt character `x' displays permissions as an integer.
123 .PP
124 Manipulating ifs is a nuisance.
125 .PP
126 File names are assumed to not contain newlines.
127 .PP
128 Correct invocation requires too much thought.
129 .SH HISTORY
130 .I Walk
131 first appeared in 9front (March, 2019).