eg-253:unix4
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
eg-253:unix4 [2007/09/21 14:55] – eechris | eg-253:unix4 [2011/01/14 12:45] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ====== UNIX Tutorial Four ====== | ||
+ | |||
+ | ===== 4.1 Wildcards ===== | ||
+ | ==== The * wildcard ==== | ||
+ | |||
+ | |||
+ | The character '' | ||
+ | or more character(s) in a file (or directory) name. For example, in | ||
+ | your **unixstuff** directory, type | ||
+ | < | ||
+ | This will list all files in the current directory starting with **list....**. | ||
+ | |||
+ | Try typing | ||
+ | < | ||
+ | This will list all files in the current directory ending with **....list**. | ||
+ | |||
+ | |||
+ | ==== The ? wildcard ==== | ||
+ | |||
+ | The character ''?'' | ||
+ | So **?ouse** will match files like **house** and **mouse**, but not **grouse**. | ||
+ | Try typing | ||
+ | < | ||
+ | |||
+ | |||
+ | ===== 4.2 Filename conventions ===== | ||
+ | |||
+ | In naming files, characters with special meanings such as **/ * & %**, should be avoided. Also, avoid using spaces within names. The safest way to name a file is to use only alphanumeric characters, that is, letters and numbers, together with **_** (underscore) and **.** (dot). | ||
+ | |||
+ | ^ Good filenames | ||
+ | |'' | ||
+ | |'' | ||
+ | |'' | ||
+ | |||
+ | File names conventionally start with a lower-case letter, and may end with a dot followed by a group of letters indicating the contents of the file. For example, all files consisting of C code may be named with the ending **.c**, for example, **prog1.c**. Then in order to list all files containing C code in your home directory, you need only type ls ***.c** in that directory. | ||
+ | |||
+ | <note warning> | ||
+ | |||
+ | For example, some compilers, unless given the appropriate option, produce compiled files named **a.out**. Should you forget to use that option, you are advised to rename the compiled file immediately, | ||
+ | |||
+ | ===== 4.3 Getting Help ===== | ||
+ | |||
+ | |||
+ | |||
+ | ==== On-line Manuals ==== | ||
+ | |||
+ | |||
+ | There are on-line manuals which gives information about most commands. The manual pages tell you which options a particular command can take, and how each option modifies the behaviour of the command. Type '' | ||
+ | |||
+ | For example, to find out more about the '' | ||
+ | < | ||
+ | |||
+ | Alternatively | ||
+ | < | ||
+ | gives a one-line description of the command, but omits any information about options etc. | ||
+ | |||
+ | ==== Apropos ==== | ||
+ | |||
+ | When you are not sure of the exact name of a command, | ||
+ | < | ||
+ | will give you the commands with keyword in their manual page header. For example, try typing | ||
+ | < | ||
+ | |||
+ | |||
+ | ===== Summary ===== | ||
+ | |||
+ | ^ **Command** | ||
+ | | '' | ||
+ | | ''?'' | ||
+ | | '' | ||
+ | | '' | ||
+ | | '' | ||
+ | |||
+ | ---- | ||
+ | |||
+ | [[eg-253: | ||
+ | |||
+ | --- // | ||