home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.update.uu.se
/
ftp.update.uu.se.2014.03.zip
/
ftp.update.uu.se
/
pub
/
rainbow
/
msdos
/
misc
/
ls.lzh
/
LS26.DOC
next >
Wrap
Text File
|
1985-10-21
|
3KB
|
123 lines
LS List Files Page 1
Directory lister ala Unix for MS-DOS. Advantages (admittedly a
matter of taste) over DIR:
o Alphabetical order by default
o Default is "wide" (/W in DIR-speak)
o Default is to omit ".", "..", hidden files, and volume ID
o Lists day of week
o Uses 24-hour time
o Lists byte-count & directory-count totals
o Shows file attributes
o Flags directories
Options to:
o List only files dated today
o List only files changed since last backup
o Recursively list sub-directories
o Show total file space only
o Sort directory by date & time
o Sort by file extension
o Exclude files from listing
Usage: ls [-aceflnorstv] [[-x] file] [[-x] file] ...
where
-a List ".", "..", hidden files, and volume ID if
matched
-c List only those changed since backup
-e Sort alphabetically on file extension
-f Single-column (filter-ready) listing
-l Long listing: dates, sizes & attributes
-n Sort by date & time, newest to oldest
-o Sort by date & time, oldest to newest
-r Search subdirectories recursively
-s List only total size
-t List only those dated today
-v Show LS version only
-x Exclude following file specification from
listing
File specification(s) may contain drive specifications,
wildcards, and path names. The default is *.*. Options may be
combined, e.g.
ls -aln *.c
or segregated:
ls -a *.c -ln
The -x option excludes files from being listed, e.g.
ls -x *.c
means list all files except .C files, and
ls -x *.exe p*.*
means list all files beginning with P except .EXE files.
LS List Files Page 2
Directory names in the listing are appended with a backslash.
A plain
ls
will list all files in the current directory (except hidden
files, volume ID, ".", and "..") sorted alphabetically, five
per line. The number of files matched is always given, along
with the total byte count of files matched.
In the attributes given in the long listing, W means
read/write, R means read-only, H means hidden, S means system
file, and A means changed since last archive (backup).
More examples:
o Long listing (a la DIR):
ls -l
o Long listing of files dated today:
ls -alt
o List all .EXE files, newest to oldest:
ls -n .exe
o List all non-.EXE and non-.COM files:
ls *.* -x .exe -x .com
o Count size and number of .exe files in current directory
and below:
ls -rs .exe
o List all files on current disk not backed up:
ls -cr \
o Get count and size of all files on current disk not backed
up:
ls -crs \
Written by Bryan Higgins. This program may be distributed
freely as long as it is not sold for profit.
The author may be reached at
1802 Channing Way
Berkeley, CA 94703