Command | Options | Lesson |
---|---|---|
ls |
Show this command by itself; introduces filenames and directories. |
|
filenames |
Then show it with filenames as arguments, which is not a lot of use in itself, but preparatory for the next one. |
|
*.c or whatever suits your example directory |
Then wildcards, thus introducing wildcard
expansion. Explain that this is done by the shell, not by
|
|
-l |
Introduce the idea of options, and the usual syntax and mnemonic value of them. Introduce the idea of file ownership and permissions; perhaps a brief mention of execute permissions. (Probably gloss over groups at this stage.) With options like this, giving individual filenames becomes useful again. |
|
-a |
Introduce |
|
-R |
More about the hierarchical directory structure. |
|
-1 |
Explain that this is useful for feeding the output into other programs. |
|
-tl , -rtl |
Explain about the file timestamps. |
|
cd , pwd |
Introduce the idea of the working directory. |
|
more |
Introduce the |
|
tail |
Another thing to use in pipes |
|
grep |
Introduce the idea of storing data in a line-based file |
|
-i |
Ignore case -- often useful |
|
-l |
Locate which files a string occurs in. |
|
-n |
Give the line numbers |
|
-v |
Negati |
|
sort |
Another useful pipeline element. This is a good stage at which to introduce redirection of input/output from/to files. |
|
-u |
Makes a set from a collection |
|
+2 etc |
Sorts by different columns |
|
echo |
almost anything | A built-in command -- explain the difference between this
and commands that run programs. Explain why |
*.c |
Re-iterate that it is the shell that expands wildcards, not
programs such as |
|
$PATH |
Introduce the idea of environment variables, explaining
that some of them, such as |
|
which |
ls and other program names |
Explain that, like the shell itself, this searches the path. |
`` |
Introduce the shell backquote syntax, first using
|
[Operating Systems] | ![]() |
Last modified: Thu Nov 24 12:24:48 GMT 2005 |