LinuxMall.com Got Linux? CD Offer
Newbie's Linux Manual
Files
by Laurence Hunter
[ Home ] [ Contents ] [ Download*] [ Previous ] [ Next ]
* In Linux enter: unzip nlm.zip
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

The above 4 rules also hold true for "directorynames", since technically a directory is just a file that holds special information.

Wildcards
+-------+-----------------------------------------------------+
|   *   | Represents any mix of characters.                   |
+-------+-----------------------------------------------------+
|   ?   | Each ? represents any character, and only one.      |
+-------+-----------------------------------------------------+
| [...] | Represents a range of user-specified 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. You can even use wildcards to specify directories.

Examples

Consider the following directory:

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

rm e*
Would remove: ex1.html; ex2.html; ex3.html; and ex10.html


ls *.gif
Would list: cartoon.gif; and logo.gif


rm ex[13]*
Would remove: ex1.html; and ex3.html


ls ex[1-3].txt
Would list: ex1.html; ex2.html; and ex3.html


rm ex?.html
Would remove: ex1.html; ex2.html; and ex3.html (but not ext10.html).


rm ex??.html
Remove ex10.html.

[ Home ] [ Contents ] [ Download*] [ Previous ] [ Next ]
* In Linux enter: unzip nlm.zip

W W W . L I N U X D O T . O R G

The Newbie's Linux Manual is reproduced on LinuxMall.com by permission. The Newbie's Linux Manual is written and maintained by Laurence Hunter. You can find much more of Laurence's work at his site: www.Linuxdot.org

© 1999 Linuxdot.org | Manual's Copyright Terms