li

Langue: en

Version: $Date: 2000/01/24 00:37:32 $ (debian - 07/07/09)

Section: 1 (Commandes utilisateur)

NAME

limo - LIst files with Many Options

SYNOPSIS

limo [ -o<ordering> ] [ -p<print style> ] [ -[wW]<display width> ] [ -c<compare file> ] [ -f<output format> ] [ -aAdhlRsv ] [ file ... ]

li [ -o<ordering> ] [ -p<print style> ] [ -[wW]<display width> ] [ -c<compare file> ] [ -f<output format> ] [ -aAdhlRsv ] [ file ... ]

DESCRIPTION

limo is a replacement for ls with some knobs on. By default, it is installed as both limo and as li. It tries to give far more control over the output format than ls and has simpler and more straightforward (albeit more verbose) options.

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 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 limo is in the SEE ALSO section.

The options basically specify three aspects of the output:

"Format of the output (-f)"
Which "chunks" of information to output for each file (default is just the filename).
"Ordering of the output (-o)"
(default is ordered ascending by filename).
"Printing style (-p)"
(default is ordered down columns and then across, like ls ).

OPTIONS

"-f<format>"
where format is either a string of any or all of the following chunk characters, in any order, 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:
n
the filename
N
the filename with a character appended to indicate the file type (/=directory, @=symbolic link, |=pipe, &=char special, #=block special, :=socket)
+
prefix to n or N; if a symbolic link, the name, then -> then the target, otherwise just the filename
Note that when using '%' syntax, you must do it like this:
%+%n
not like this:
%+n
d
short description of the type of the file, e.g. "Dir" or "ChSp"
D
long description of the type of the file, e.g. "Directory" or "Character special"
b
file size in blocks (whatever a block is for the current filesystem)
s
file size in bytes, in short (4-character) form (b=bytes, K=kilobytes, M=megabytes, G=gigabytes)
S
file size in bytes, in long form, or the major and minor device nodes if a block- or character-special device
p
protection mode, 6 octal digits
P
protection mode, long form (e.g. -rwxr-xr-x)
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"
u
UID of owner
U
username of group, or UID of owner if none
g
GID of owner
G
group name of group, or GID of group if none
i
inode number
l
number of hard links
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
A
time of last access, long form; Day-DD-MMM-YYYY-HH:MM:SS
m
time of last modification, short form
M
time of last modification, long form
c
time of last change, short form
C
time of last change, long form
=
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
-
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
for amc, shows:
if < 60 minutes, MMmSS; for < 24 hours, HHhMM; for < 100 days, DDdHH; else DDDd
for AMC, shows:
DDDd-HH:MM:SS
for a future timestamp:
the format is preceded by '+'
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
Note that when using '%' syntax, you must do it like this:
%-%m
not like this:.
%-m
0123456789
custom command output (see the -e option)
"-o<sort-chunks>"
order output, select any or all of
+
sort the following chunks ascending (default)
-
sort the following chunks descending
n
filename (default)
b
number of blocks
s
number of bytes
d
file type part of the file protection mode (that is, directory, character special, normal file, etc.)
p
full file protection mode (probably silly)
u
UID
U
Username of owner
g
GID
G
Group name of group owner
i
inode number
a
time of last access
m
time of last modification
c
time of last change

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.

Ordering is performed by qsort(3)

"-p[ad,]"
print style, one of:
a
list across rows
d
list down columns (default)
,
list comma-separated
-a
show all files, even those beginning with a "."
-A
show all files, even those beginning with a ".", except for "." and ".."
-c<compare-file>
use the appropriate timestamps of the compare-file instead of the current system time when displaying file ages
-d
for directories, show their information rather than their contents
-e<line:word:command>
specify a command to extract custom information about a file; 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

Example:

limo -e "1:1:wc -l" -f P0n

will list each file with its permissions and line count, and

limo -e "1:0:file -b" -f 0sn will show the file's content type, size and name.

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, 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.

-h
show usage information and list of available chunks
-l
approximate the behaviour of "ls -l" by setting "-f PlUGSm+n" (or whatever is in LIMO_FORMAT_L; see ENVIRONMENT)
-q
display unprintable characters in filenames as '?'
-R
recursively list subdirectories
-r
recursively list subdirectories, but do not traverse filesystems
-s
approximate the behaviour of "ls -s" by setting "-f sn" (or whatever is in LIMO_FORMAT_S; see ENVIRONMENT)
-S<character>
set the default chunk separator character (default is a space)
-v
verbose mode; explain a few things along the way
-w<width>
assume a display width of 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
-W<columns>
force output to be in the given number of columns, regardless of screen width
-/
display full pathnames of files

ENVIRONMENT

LIMO_FORMAT
the default output format, overridden by -f
LIMO_FORMAT_L
output format used with the -l switch
LIMO_FORMAT
the default output format, overridden by -f
LIMO_ORDER
the default output order, overridden by -o
LIMO_STYLE
the default printing style, overridden by -p
COLUMNS
column width to use for output, if attempts to find it fail (default 80)

BUGS

The behavior of limo reflects the preferences of the author. For the most part it emulates the general behaviour of ls but departs from it in some respects:

columns
output is identical whether writing to a terminal or other file (by default ls turns multi-column output off when not writing to a terminal)
colour
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)
-q
character quoting is simplistic, and assumes ASCII/ISO8859
custom commands (-e)
option is bordering on the baroque, and puts limo one step away from being able to read mail

SEE ALSO

ls(1); chdir(2); ioctl(2); lstat(2); readlink(2); fork(2); pipe(2); execv(3); qsort(3); strftime(3)

AUTHOR

Fraser McCrossan <joat@joat.ca>