w w w . T H E B I T S . c o . u k


Files

Home Contents Previous Next

Filename Guidelines

* A filename can be between 1 and 256 characters.

* The following characters are not advised:

space < > ' " * { } [ ] ( ) ^ ! \ | & $ ? ~

...although you can use them by enclosing filenames in ' ' or " " whenever filenames contain these characters.

* Filenames are case-sensitive (e.g. The shell would see 'hello' and 'Hello' as two different files).

* Start a filename with a period ('.') to make it hidden (to view hidden files enter: 'ls -a').

Note

If a filename entered begins with a '/' then it is the absolute path i.e. starts at root ('/'), otherwise, it is a relative path name i.e. relative to the current directory.


Wildcards

+-------+----------------------------------+
|   ?   | Represents any single character  |
+-------+----------------------------------+
|   *   | Represents any character         |
+-------+----------------------------------+
| [...] | Represents a range of characters |
+-------+----------------------------------+

Any time a filename is used you can replace parts of the filename or all of it with wildcards. Any sensible combination you can think of can be used. In many instances, you may even want to add wildcards to directory names.

Examples

Consider the following directory:

cartoon.gif   ex2.html   ex10.html    logo.gif
ex1.html      ex3.html   index.html

rm e*
Remove 'ex1.html', 'ex2.html', 'ex3.html' and 'ex10.html'.

ls *.gif
Display 'logo.gif' and 'cartoon.gif'.

rm ex[13]*
Remove 'ex1.html' and 'ex3.html'.

ls ex[1-3].txt
Display 'ex1.html', 'ex2.html' and 'ex3.html'.

rm ex?.txt
Remove 'ex1.html', 'ex2.html' and 'ex3.html'.


By Laurence Hunter >> laurence@thebits.co.uk

Home Contents Previous Next

Download Latest Manual

www.THEBITS.co.uk - updated daily...