A filename consists of four parts: directory, (short) name, extension, and version number.
The full Windows file name
e:\glindra\html\dir_summary.html.~2~splits into
| e:\glindra\html\ | Directory |
| dir_summary | Short name |
| .html | Extension |
| .~2~ | Version number |
Under Linux it works the same, except that the directory would not contain any drive letter, and forward slash would be used as directory delimiter.
The version numbers follow the convention used by the Emacs editor and other standard Gnu utilities, and are described on the page File Version Numbers.
Filenames are case insensitive under Windows, but case sensitive
under Linux.
| e:\glindra\html\ \\share\public\ |
Absolute path, which starts with either a device name
terminated by a colon, or a share name starting with two backslashes.
In either case, the device or share name must be followed by a
backslash before any subdirectory names. This means that the directory
path starts at the root directory for that device. |
| \glindra\html\ | Semi-absolute path, which starts with a backslash to signify the root directory, but does not contain any disk drive letter or other device. The device is defaulted to the current device. |
| subdir\xyz\ |
Relative path, which starts in the current directory on the current device. |
The Glindra programs do not support relative paths that
begin
with a drive letter.
> d C:subdir\
[FATAL-ERROR] Filename syntax error: C:subdir\
("\" missing after ":", relative paths after device name are not supported)
Under Linux, there is no drive letter, and the directories are separated by forward slashes instead of backslashes.
| /home/glindra/html/ | Absolute path. |
| subdir/xyz/ |
Relative path. |
There are three special names of directories, that can be used in directory specifications. These are:
|
. |
"This" directory (the directory that the directory specification so far is referring to). |
|
.. |
The parent directory of "this" directory. |
|
~ |
The "home directory" of the current user, as defined by the environment variable HOME. If HOME is undefined, the default home directory is /home/$USER/ under Linux, and the My Documents folder under Windows. |
The short name ca not contain any dots, since everything after the first dot counts as the extension. Similarly, it ca not contain colons, backslashes or slashes, since these would count as part of the directory.
The short name may not begin or end with spaces.
For files with a single dot followed by some characters, this corresponds to what Windows considers to be the extension.
For filename extensions that contain more than one dot, like for example myfile.tar.gz, the extension is considered to be .tar.gz, rather than just .gz.
The definition of where the line is drawn between the filename proper and extension is important when applying default extensions, or when interpreting wildcard file specifications. The wildcard specification *.gz is not considered to match myfile.tar.gz. In order to match that file, you would instead have to write either *.tar.gz or *.*gz.
If a file does not have any dot at all in the filename, it is considered to have an empty extension. This means that the file specification myprog. is considered to match the physical filename myprog (without any dot after the name).
For a Windows user this is just the normal way that Windows/DOS has
always treated files with a
zero extension, but the Glindra programs use this convention under Linux
as well. This is a
deliberate departure from the way that most Linux programs look upon
filenames. Traditionally under
Linux there is no formal concept of a filename extension; instead, the
dot is considered to be just
another character that may or may not appear in a filename.
The wildcards that are available are:
| * | Any string of zero or more characters. |
| ? | Any single character. |
| [set] | Any character that is a member of set. |
| [!set] | Any character that is not a member of set. |
| *** | In directory paths: all subdirectories. |
Each wildcard in a file specification applies to a single field only. This can be either the directory, the name, the extension, or the version number. This follows the Windows tradition, where the file system is aware of the concept of extensions.
To get all files you normally have to write *.* like in Windows, and not just * like you normally would under Linux. This applies even if you are executing the command under Linux.
| *.* | All files in the current directory (i.e.: any name followed by any extension). |
| *.xyz | All files with the extension .xyz. |
| abc*.* | All files where the name starts with abc. |
| *abc*.* | All files where the name contains the string abc. |
| abc?.* | All files where the name consists of the letters abc followed by exactly one character. |
| *.??? | All files with the extension is exactly three characters long |
| *.???* | All files where the extension is three or more characters long. |
The wildcard [set] means all the characters listed in set, whereas [!set] means all the characters that are not in set. You can specify a range of characters using a hyphen, as in [A-C], which means one of the characters A, B, or C.
| *.[ch]pp | All files where the extension is either .cpp or .hpp. |
| *.[!ch] | All files where the extension consists of a single character that is neither .c or .h. |
| *[0-9]*.* | All files that contain a digit somewhere in the name. |
| [!A-Za-z]*.* | All files where the name does not begin with a letter. |
The interpretation of such ranges is dependent on the underlying character representation, but it is generally considered safe to assume only that a-z, A-Z, and 0-9 are each in sequence, and not make any assumptions about other characters, or about the order between the respective letter/digit ranges.
If you want a hyphen "-" to be part of a set, you must place it either as the first or the last character within the brackets. If you want an exclamation mark "!" to be part of a set, you must place it somewhere else than in the first position after the opening bracket.
There are no escape characters available within the brackets, so you will not be able to specify some of the more pathological characters directly as members of a set.
A directory specification consists of a number of different directory filenames separated by "directory delimiters". The directory delimiters are colon : and backslash \ under Windows, and forward slash / under Linux.
Any wildcards are applied to the individual directory names.
This means that the Windows specification
\home\[abc]*\*\or the Linux specification
'/home/[abc]*/*/'would mean "all first level subdirectories to directories that begin with either a, b, or c, in the top level directory /home".
In addition to the basic wildcards, there is one more wildcard that is available in directory specifications only. This wildcard is inspired by the OpenVMS ellipsis ..., which means "this directory and all its subdirectories at all levels below it". This corresponds to the dir /s command under DOS, or the ls -R command under Linux.
If you give the command
> d ***under Windows, you will get a list of all files in the current working directory and all directories below it.
Under Linux, the wildcard file specification must be enclosed in quotes, to prevent the shell from globbing the wildcard into oblivion:
> d '***'
The *** wildcard can also be part of a more complex directory specification.
> d "c:\Documents and Settings\Alice\***"lists of all files in the directory c:\Documents and Settings\Alice\, and all directories below it.
> d '/home/***/old/'lists all old directories at any level below /home.
The *** wildcard eliminates the need for a separate program option to specify that the search for files should be done "recursively". Any program that can handle Glindra style wildcards will automatically get the "recursive" capability. The *** wildcard also provides greater flexibility than a "recursive" program option, since it can be part of a more complex directory specification.
But note:
*** means "the current working directory and all its subdirectories".
\*** means "the entire directory structure for all users".
Don't mix them up when you're giving commands that could destroy files!
The dele (delete) and pu (purge) commands will demand special confirmation if you try to us the \*** wildcard to specify the entire directory structure, but other potentially dangerous programs might not have this safeguard.
The only wildcard that is allowed for the version number field is .* which means "all versions".
> dele 'myfile.txt.*'deletes all versions, including the latest one, of myfile.txt.
If you just specify a dot "." as the last character in a filename specification, the final dot will be interpreted to mean "the highest version".
If you realize that you have made a mistake when working with a file, and you want to delete the last version of the file in order to revert to the previous one, you would use a command like
> dele myfile.txt.which deletes only the latest version of myfile.txt
Programs that are equipped to handle multiple input files through
wildcards will also accept a list of filenames and/or file selection options. See Input File Specifications for details.