1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517
|
.\" $Id: limo.1,v 1.17 2000/01/24 00:37:32 fraserm Exp $
.\" $Log: limo.1,v $
.\" Revision 1.17 2000/01/24 00:37:32 fraserm
.\" 'e' chunk
.\"
.\" Revision 1.16 1999/12/22 01:53:28 fraserm
.\" added -S
.\"
.\" Revision 1.15 1999/12/21 02:46:21 fraserm
.\" changes as per 0.3 in CHANGELOG
.\"
.\" Revision 1.14 1999/12/14 02:13:30 fraserm
.\" added new env variables LIMO_FORMAT_{L,S}
.\"
.\" Revision 1.13 1999/07/01 01:39:32 fraserm
.\" *** empty log message ***
.\"
.\" Revision 1.12 1999/06/16 21:28:18 fraserm
.\" switched b and s in ordering to make them correct
.\"
.\" Revision 1.11 1999/06/15 23:57:34 fraserm
.\" *** empty log message ***
.\"
.\" Revision 1.10 1999/06/15 23:50:21 fraserm
.\" added ioctl to SEE ALSO
.\"
.\" Revision 1.9 1999/06/15 23:45:31 fraserm
.\" added extra description to -w option
.\"
.\" Revision 1.8 1999/05/30 12:44:41 fraserm
.\" *** empty log message ***
.\"
.\" Revision 1.7 1999/05/30 11:34:00 fraserm
.\" added multiple sort chunks
.\"
.\" Revision 1.6 1999/05/30 01:23:10 fraserm
.\" *** empty log message ***
.\"
.\" Revision 1.5 1999/05/30 01:10:24 fraserm
.\" added -v and changed -h
.\"
.\" Revision 1.4 1999/05/26 23:51:27 fraserm
.\" added custom command stuff
.\"
.\" Revision 1.3 1999/05/24 01:07:47 fraserm
.\" *** empty log message ***
.\"
.\" Revision 1.2 1999/05/16 19:49:02 fraserm
.\" changed n N and L to n +n N and +N
.\"
.\" Revision 1.1 1999/04/28 00:34:39 fraserm
.\" Initial revision
.\"
.\" Revision 1.7 1999/04/28 00:06:02 fraserm
.\" added U and G sort chunks
.\"
.\" Revision 1.6 1999/04/26 01:14:48 fraserm
.\" added d and D chunks
.\"
.\" Revision 1.5 1999/04/24 18:54:54 fraserm
.\" devnode stuff
.\"
.\" Revision 1.4 1999/04/24 18:37:30 fraserm
.\" *** empty log message ***
.\"
.\" Revision 1.3 1999/04/24 18:06:34 fraserm
.\" *** empty log message ***
.\"
.\" Revision 1.2 1999/04/24 17:21:55 fraserm
.\" fully updated manual page
.\"
.\" Revision 1.1 1999/04/20 23:43:06 fraserm
.\" Initial revision
.\"
.TH LIMO 1 "$Date: 2000/01/24 00:37:32 $"
.SH NAME
limo - LIst files with Many Options
.SH SYNOPSIS
.B limo
[
-o<ordering>
]
[
-p<print style>
]
[
-[wW]<display width>
]
[
-c<compare file>
]
[
-f<output format>
]
[
-aAdhlRsv
]
[
file ...
]
.br
.br
.B li
[
-o<ordering>
]
[
-p<print style>
]
[
-[wW]<display width>
]
[
-c<compare file>
]
[
-f<output format>
]
[
-aAdhlRsv
]
[
file ...
]
.IX "limo" "" "\fLlimo\fP \(em LIst files with Many Options"
.SH DESCRIPTION
.LP
.B limo
is a replacement for
.B ls
with some knobs on. By default, it is installed as both
.B limo
and as
.B li.
It tries to give far more control over the output format than
.B ls
and has simpler and more straightforward (albeit more verbose) options.
.LP
It is probably most suited to
system administrators who need to know file attributes very precisely,
and to script writers, who wish to avoid parsing
.B ls
output. For those who need to extract the same information in C programs,
a list of the more interesting system and C library calls used by
.B limo
is in the SEE ALSO section.
.LP
The options basically specify three aspects of the output:
.RS
.TP
.SB "Format of the output (-f)"
Which "chunks" of information to output for each file (default is just the
filename).
.TP
.SB "Ordering of the output (-o)"
(default is ordered ascending by filename).
.TP
.SB "Printing style (-p)"
(default is ordered down columns and then across, like
.B ls
).
.RE
.SH OPTIONS
.RS
.TP
.SB "\-f<format>"
where
.B format
is either a string of any or all of the following chunk characters,
in any order,
.B or
a string in a format reminiscent of print(), where chunk characters are
preceded by the '%' character, and everything else is repeated verbatim,
e.g. "Psn" and "%P %s %n" are equivalent:
.RS
.TP
.SB n
the filename
.TP
.SB N
the filename with a character appended to indicate the file type
(/=directory, @=symbolic link, |=pipe, &=char special,
#=block special, :=socket)
.TP
.SB \+
prefix to n or N;
if a symbolic link, the name, then -> then the target, otherwise
just the filename
.TP
Note that when using '%' syntax, you must do it like this:
.TP
%+%n
.TP
not like this:
.TP
%+n
.TP
.SB d
short description of the type of the file, e.g. "Dir" or "ChSp"
.TP
.SB D
long description of the type of the file, e.g. "Directory" or "Character
special"
.TP
.SB b
file size in blocks (whatever a block is for the current filesystem)
.TP
.SB s
file size in bytes, in short (4-character)
form (b=bytes, K=kilobytes, M=megabytes,
G=gigabytes)
.TP
.SB S
file size in bytes, in long form, or the major and minor device nodes if a
block- or character-special device
.TP
.SB p
protection mode, 6 octal digits
.TP
.SB P
protection mode, long form (e.g. -rwxr-xr-x)
.TP
.SB e
effective permission (i.e. whichever one of the above long permission
triplets applies to the current user); in the above example if the user owned the
file, would print "rwx" else would print "r-x"
.TP
.SB u
UID of owner
.TP
.SB U
username of group, or UID of owner if none
.TP
.SB g
GID of owner
.TP
.SB G
group name of group, or GID of group if none
.TP
.SB i
inode number
.TP
.SB l
number of hard links
.TP
.SB a
time of last access, short (5-character) form; if < 24 hours old, HH:MM;
if < 12 months old, DDMMM; if < 50 years, MMMYY; otherwise YYYY
.TP
.SB A
time of last access, long form; Day-DD-MMM-YYYY-HH:MM:SS
.TP
.SB m
time of last modification, short form
.TP
.SB M
time of last modification, long form
.TP
.SB c
time of last change, short form
.TP
.SB C
time of last change, long form
.TP
.SB \=
modify the next a, A, m, M, c or C
chunk to show the raw timestamp (i.e. the number
of seconds since the epoch) rather than a
formatted timestamp
.TP
.SB \-
modify the next a, A, m, M, c or C
chunk to show the file age compared to the
current system date (or compare-file date if the -c option is used),
instead of the absolute timestamp
.TP
for amc, shows:
if < 60 minutes, MMmSS; for < 24 hours, HHhMM; for < 100 days, DDdHH;
else DDDd
.TP
for AMC, shows:
DDDd-HH:MM:SS
.TP
for a future timestamp:
the format is preceded by '+'
.TP
mixing '-' and '='
will work, giving you the raw comparison in seconds rather than the formatted
version; slightly confusingly, formatted versions are prefixed with + if
younger, or nothing if older, whilst raw versions are prefixed with - if
older, nothing with younger
.TP
Note that when using '%' syntax, you must do it like this:
.TP
%-%m
.TP
not like this:.
.TP
%-m
.TP
.SB 0123456789
custom command output (see the -e option)
.RE
.TP
.SB "\-o<sort-chunks>"
order output, select any or all of
.RS
.TP
.B +
sort the following chunks ascending (default)
.TP
.B \-
sort the following chunks descending
.TP
.B n
filename (default)
.TP
.B b
number of blocks
.TP
.B s
number of bytes
.TP
.B d
file type part of the file protection mode (that is, directory,
character special, normal file, etc.)
.TP
.B p
full file protection mode (probably silly)
.TP
.B u
UID
.TP
.B U
Username of owner
.TP
.B g
GID
.TP
.B G
Group name of group owner
.TP
.B i
inode number
.TP
.B a
time of last access
.TP
.B m
time of last modification
.TP
.B c
time of last change
.RE
.LP
For example, "-od-Un" orders ascending by file type, then descending
by owner name then file name. If you specify "-o+" or "-o-" (that is,
no sort chunks, just a direction), no ordering is
performed, files will be listed in the order they appear in the directory.
.LP
Ordering is performed by
.B qsort(3)
.TP
.SB "\-p[ad,]"
print style, one of:
.RS
.TP
.B a
list across rows
.TP
.B d
list down columns (default)
.TP
.B ,
list comma-separated
.RE
.TP
.SB \-a
show all files, even those beginning with a "."
.TP
.SB \-A
show all files, even those beginning with a ".", except for "." and ".."
.TP
.SB \-c<compare-file>
use the appropriate timestamps of the
.B compare-file
instead of the current system time when displaying file ages
.TP
.SB \-d
for directories, show their information rather than their contents
.TP
.SB \-e<line:word:command>
specify a command to extract custom information about a file;
.B limo
will capture the command's output, and use the given word on the given line
(stripped of whitespace) with word 0 taken to mean the whole line;
the first -e option may be accessed using the
0 (zero) chunk, and subsequent ones with 1, 2, 3, up to 9
.LP
Example:
.LP
limo -e "1:1:wc -l" -f P0n
.LP
will list each file with its permissions and line count, and
.LP
limo -e "1:0:file -b" -f 0sn
will show the file's content type, size and name.
.LP
If you need the filename supplied to the command anywhere other than at
the end, place "%s" in the command. If you don't quote the %s with single
quotes,
.B limo
will do it for you. If the command returns a non-zero exit status
(for example, wc on a directory), you'll only
get "-". Be aware that this option carries a heavy performance penalty.
.TP
.SB \-h
show usage information and list of available chunks
.TP
.SB \-l
approximate the behaviour of "ls -l" by setting "-f PlUGSm+n" (or whatever
is in LIMO_FORMAT_L; see ENVIRONMENT)
.TP
.SB \-q
display unprintable characters in filenames as '?'
.TP
.SB \-R
recursively list subdirectories
.TP
.SB \-r
recursively list subdirectories, but do not traverse filesystems
.TP
.SB \-s
approximate the behaviour of "ls -s" by setting "-f sn" (or whatever
is in LIMO_FORMAT_S; see ENVIRONMENT)
.TP
.SB \-S<character>
set the default chunk separator character (default is a space)
.TP
.SB \-v
verbose mode; explain a few things along the way
.TP
.SB \-w<width>
assume a display width of
.B width
this overrides the default determination of the screen width,
which is (1) whatever ioctl(1, TIOCGWINSZ) says;
(2) whatever the COLUMNS environment variable says; finally (3) 80
.TP
.SB \-W<columns>
force output to be in the given number of columns, regardless of screen
width
.TP
.SB \-/
display full pathnames of files
.RE
.SH "ENVIRONMENT"
.RS
.TP
.SB LIMO_FORMAT
the default output format, overridden by -f
.TP
.SB LIMO_FORMAT_L
output format used with the -l switch
.TP
.SB LIMO_FORMAT
the default output format, overridden by -f
.TP
.SB LIMO_ORDER
the default output order, overridden by -o
.TP
.SB LIMO_STYLE
the default printing style, overridden by -p
.TP
.SB COLUMNS
column width to use for output, if attempts to find it fail (default 80)
.RE
.SH BUGS
.LP
The behavior of
.B limo
reflects the preferences of the author. For the most part it emulates the
general behaviour of
.B ls
but departs from it in some respects:
.RS
.TP
columns
output is identical whether writing to a terminal or other file (by default
.B ls
turns multi-column output off when not writing to a terminal)
.TP
colour
.B limo
does not support ANSI colouring of files based on their type; the author
hates that (but is slowly being argued into implementing it anyway)
.TP -q
character quoting is simplistic, and assumes ASCII/ISO8859
.TP
custom commands (-e)
option is bordering on the baroque, and puts limo one step away from being
able to read mail
.RE
.SH "SEE ALSO"
.BR ls (1);
.BR chdir(2);
.BR ioctl(2);
.BR lstat(2);
.BR readlink(2);
.BR fork(2);
.BR pipe(2);
.BR execv(3);
.BR qsort(3);
.BR strftime(3)
.SH AUTHOR
.LP
Fraser McCrossan <joat@joat.ca>
|