Home Page The Club Computers News Links Glossary EYAWTK
Before Amiga Background ICS OCS ECS AGA ??? PPC
U-Boot SLB Linux Amiga OS Dual Boot Motherboards Peripherals Other
Initialisation Installation OS4 Updates About OS4 File Systems Networking Printing Other
Introduction File System Workbench Preferences Commands Error Msgs Miscellaneous

AmigaOS 4.0 - About OS4 - Commands

LIST AmigaDOS
Purpose: Lists specified information about files and directories.
Format: LIST [{<dir | pattern | filename>}] [P | PAT=<pattern>] [KEYS] [DATES] [NODATES] [TO=<name>] [SUB=<string>] [SINCE=<date>]
[UPTO=<date>] [QUICK] [BLOCKS] [NOHEAD] [FILES] [DIRS] [LFORMAT=<string>] [SORT=<string>] [USERS] [GROUPS] [ALL]
Template: DIR/M, P=PAT/K, KEYS/S, DATES/S, NODATES/S, TO/K, SUB/K, SINCE/K, UPTO/K, QUICK/S, BLOCKS/S, NOHEAD/S, FILES/S, DIRS/S, LFORMAT/K, SORT/K, USERS/S, GROUPS/S, ALL/S,
Path: C:LIST
LIST displays information about the contents of the current directory. If you specify a <dir>, <pattern>, or <filename> argument, LIST displays information about the specified directory, all directories and files that match the pattern, or the specified file, respectively. The PAT argument lets you specify an additional pattern to match.

Unless other options are specified, LIST displays the following:

name The name of the file or directory.
size The size of the file in bytes. If there is nothing in this file, the field reads "empty". For directories, the entry reads "Dir".
protection The protection bits that are set for this file are shown as letters. The clear (unset) bits are shown as hyphens. Most files show the default protection bits for readable, writable, executable and deletable, i.e. '– – – – r w e d'. See the PROTECT command for more information on protection bits.
date and time The date and time that the file was created or last changed.
comment The comment, if any, placed on the file using the FILENOTE command. It is preceded by a colon (:).

LIST uses the following options to change the way the output is displayed:

KEYS Displays the block number of each file header or directory.
DATES Displays dates. (For example, DD-MMM-YY is the USA default.)
NODATES Does not display date and time information.
TO <name> Specifies an output file or device for LIST; by default, LIST outputs to the current window.
SUB <string> List only file containing the substring <string>.
SINCE <date> List only files timestamped on or after the specified date.
UPTO <date> List only files timestamped on or before the specified date.
QUICK List only the names of files and directories.
BLOCK Displays file sizes in 512-byte blocks, rahter than bytes.
NOHEAD Suppresses printing of the header and summary information.
FILES List files only (no directories).
DIRS List directories only (no files).
LFORMAT <string> Defines a string to specially format LIST output.
SORT <string> Specifies that the output is to be sorted according to the <string> value, where <string> can be one of the following:
N or NAME Sort in ascending order by directory/file name.
S or SIZE Sort in ascending order by file size.
D or DATE Sort in ascending order by file date.
T or TYPE Sort in ascending order by file type.
RN or REVERSENAME Sort in descending order by directory/file name.
RS or REVERSESIZE Sort in descending order by file size.
RD or REVERSEDATE Sort in descending order by file date.
RT or REVERSETYPE Sort in descending order by file type.
USERS Includes user names in the output.
GROUPS Includes group names and all level of protection bits (owner, group & other) in the output.
ALL Lists the contents of all directories and sub-directories.

The LFORMAT option modifies the output of LIST and can be used as a quick method of generating script files. When using LFORMAT, specify an output format string; this string is output for each file or directory normally listed. It can contain any text you specify, plus the usual LIST output information. When LFORMAT is specified, the QUICK and NOHEAD options are automatically selected. To save the output, you must redirect it to a file by using the > operator or specifying a TO file.

The available substitution operators are:

%A Prints file attributes ((protection bits).
%B Prints size of file in blocks.
%C Prints any comments attached to the file.
%D Prints the date associated with the file.
%E Prints just the file extension.
%K Prints the file key block number.
%L Prints the length of the file in bytes.
%M Prints the file name only, omitting any extension.
%N Prints the name of the file.
%P Prints the file parent path.
%S Superceded by %N and %P; still functional.
%T Prints the time associated with the file.

You can put a length specifier and/or a justification specifier between the percentage sign (%) and the field specifier. To specify left justification, place a minus sign (-) before the length specifier. Otherwise, the information displayed is right justified. The default output of the LIST command uses the following specification:

%-24 %7L %A %D %T Example 1: 3.OS4:> LIST Dirs
Directory ":" on Monday 31-Oct-05
Kickstart Dir ----rwed 27-Aug-05 11:40:56
WBStartup Dir ----rwed Yesterday 11:51:53
Utilities Dir ----rwed Yesterday 12:18:58
Tools Dir ----rwed Yesterday 11:52:29
System Dir ----rwed 02-Oct-05 21:45:44
Storage Dir ----rwed 27-Sep-05 08:43:49
S Dir ----rwed 26-Aug-05 14:46:22
Prefs Dir ----rwed Yesterday 12:20:22
Locale Dir ----rwed 26-Aug-05 14:46:13
Libs Dir ----rwed 12-Oct-05 09:29:06
L Dir ----rwed 26-Aug-05 14:45:57
Internet Dir ----rwed Wednesday 09:20:21
Devs Dir ----rwed Friday    18:52:02
Classes Dir ----rwed 27-Aug-05 11:40:56
C Dir ----rwed Wednesday 19:42:41
Trashcan Dir ----rwed 22-Jul-05 21:18:53
Fonts Dir ----rwed 26-Aug-05 14:45:52
Documentation Dir ----rwed Wednesday 21:25:59
18 directories - 40 blocks used
only the directories in the current directory, in this case SYS:, are listed.

Example 2:

3.OS4:> LIST LI#? TO RAM:Libs.file LIST searches for any directories or file that start with LI, and outputs the result to Libs.file in RAM:.

Example 3:

3.OS4:> LIST Work:Documents UPTO 09-Oct-05 only the files or directories in the Documents directory of Work: that have not been changed since October 9, 2005 are listed.


Return to Commands Selection

Disclaimer: Amiga Auckland have prepared the above information for the use of its members based on our experiences and as such is subject to revision at any time. Amiga Auckland cannot guarantee any of the information and cannot be held accountable for any issues that may result from using it.


Copyright 2006 Amiga Auckland Inc. All rights reserved.
Revised: February 9, 2006.