home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
RBBS in a Box Volume 1 #2
/
RBBS_vol1_no2.iso
/
014r
/
ls.zip
/
LS.DOC
next >
Wrap
Text File
|
1985-07-15
|
8KB
|
196 lines
ls.doc Page 1
(c)Copyright 1985 by Craig Anderson. All rights reserved.
Individuals, clubs, and other non-profit organizations are granted
permission by the author to freely copy the ls program and documentation,
as long as no price or other consideration is changed, and the program
or documentation are not modified in any way and are distributed together.
You are encouraged to copy and share this program with others, if you
find this program useful, please send a few dollars to:
Craig Anderson
2845 Alpine Street SE
Auburn, WA 98002
Contributions of $10 or more will recieve a copy of the ls source code.
Comments and suggestions are always welcome!
Description:
This is an improved directory listing program. It is meant to be used
with hard disks (or floppy disk systems only if ls is on a ram disk).
It provides directory listings in various formats, with many options
for sorting and selection.
The default sorting is alphabetical so you can find the file your looking
for without searching an almost unordered list. The -z option provides
useful file searches across directories.
It was originally more Unix like, but has undergone a metamorphosis to
make it more useful in the DOS environment. Multiple names may appear
on the command line to list more than one file or group of files.
The metacharacters * and ? are supported as usual.
Usage:
ls [names] [options]
Names:
[drive:][path][filename]
Optional drive followed by a ':', defaults to current drive.
Optional path, defaults to current directory.
To list files for a directory, the path must be followed
by a '\'. This program differs from the DOS dir command in
that the following '\' must be used.
Optional filename, defaults to showing all files (except
hidden and system files) in the directory.
More than one name may be used (e.g. "ls a*.com b*.com" will list
all .com files starting with 'a' or 'b'.)
ls.doc Page 2
Options:
Options can appear before or after the [names] and are preceded by a
'-' or a '/'. As many options as wanted can follow a single '-' or
'/' without spaces. (e.g. "ls -laf" is the same as "ls -l -a -f".)
Options may be upper or lower case letters as follows:
-a Show all files.
Hidden and system files are also listed.
-b Directories are not appended with a '\'.
-c Show copyright notice.
-d Show only directories.
Files (which are not directories) are not listed.
-e Sort files by extension.
Files are sorted alphabetically by extension then by name.
Directories are listed first.
-f Show only files.
Directories are not listed.
-g Puts directories first.
Directories are listed before any files. Both directories
and files are listed by the sorting type chosen.
-h Help.
Prints a list of options followed by a short description.
This is also printed when an unknown option is used.
-l Long listing
Lists files attributes, file size (in bytes), creation
date and time, and filename. The total number of files
listed and the total size are also shown.
The file attributes are shown in the following form:
dshrwa
If the attribute is not on then a '-' is shown instead.
where:
d shows the file is a directory.
s the file is a system file (excluded from normal
directory searches, use -a option)
h the file is a hidden file (also excluded from normal
directory searches, use -a option).
r The file is readable (always on).
w the file is writeable (if this is a '-' then the
file is read only).
a The file has not been modified since the last
backup.
normal files show ( ---rw- ), hopefully ( ---rwa) if backups
have been done.
-m Stream output.
Filenames are separated only by commas.
ls.doc Page 3
-n Natural sort (unsorted).
The files are listed in the order they appear in the
DOS directory.
-p Shows only programs.
Only files ending in '.exe' or '.com' are listed.
This is especially usefull in finding the executable
program in the midst of many data files.
-q Shows only programs and batch files.
Only files ending in '.exe', '.com', or '.bat' are
listed.
-r Reverse listing.
Reverses the order of any of the sorting criteria chosen.
-s Sort by size.
Files are listed in order of increasing size.
-t Sort files by time.
Files are listed in the order of increasing age. (Most
recent files shown first.)
-u Listing in uppercase.
Listing is shown in uppercase letters instead of the
default lowercase.
-w# Sets the number of columns.
Lists files in # columns where # is 1 - 5 (default 4).
-z Recursive directory listing.
Lists all files matching [names] in the current directory
or any subdirectory below the current directory.
The path is printed for each directory in which one or
more files are listed, followed by the files.
Thus to print all batch and 'com' files on the disk type:
"cd \" (move to topmost directory)
"ls -z *.bat *.com" (lists all batch and 'com' files)
This option is also valuable when trying to find a file.
"cd \"
"ls -fz <filename>"
will show the directory of the file(s) in filename. The
-f option lists only files so subdirectories matching the
filename patter will not be shown.
Environment Variables:
The environment variable LSOPTIONS can be used to set options
for the ls command.
This is useful to always turn the uppercase (-u) option on, to
set the number of columns (-w#), or to always show directories
first (-g), etc.
ls.doc Page 4
usage:
set LSOPTIONS=options
Where options are any of options above and must be preceded by a
'-' or a '/'.
Placed in the autoexec.bat file on the boot disk the following
line sets the defaults to 5 columns are always lists directories
first:
set LSOPTIONS = -w5g
Options on the command line may overide these options (e.g.
"ls -w4" will list files in 4 columns instead on the LSOPTIONS
set default of 5.)
Note:
Some options cannot be overidden on the command line (-u, -g,
and -q for example.)