This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision Next revision Both sides next revision | ||
unix_survival [2020/04/08 20:06] joshd |
unix_survival [2020/04/08 21:25] joshd |
||
---|---|---|---|
Line 1: | Line 1: | ||
**UNIX Command Reference** | **UNIX Command Reference** | ||
- | The command prompt in UNIX is called the // | + | The command prompt in UNIX is called the //shell//, which typically uses a dollar sign ($) as its prompt. Here is a list of common UNIX commands which will work across many different versions of UNIX with discrepancies in Example/ |
||Command||Description||Examples||Notes|| | ||Command||Description||Examples||Notes|| | ||
Line 30: | Line 30: | ||
** Useful UNIX References ** | ** Useful UNIX References ** | ||
+ | |||
+ | [[http:// | ||
+ | |||
+ | [[https:// | ||
[[https:// | [[https:// | ||
Line 41: | Line 45: | ||
This wiki cannot provide an extensive tutorial for the C language, but we'll provide an example or two to get you started. | This wiki cannot provide an extensive tutorial for the C language, but we'll provide an example or two to get you started. | ||
- | Use the editor of your choice to create the source file. We'll use //ed// here, as it's common to all UNIX systems, but //vi// may be a more friendly choice. | + | Use the editor of your choice to create the source file. We'll use //ed// here, as it's common to all UNIX systems, but //vi// may be a more friendly choice. |
< | < | ||
Line 98: | Line 102: | ||
</ | </ | ||
+ | Here's a more complex program. | ||
+ | |||
+ | < | ||
+ | $ ed table.c | ||
+ | ?table.c | ||
+ | a | ||
+ | int main(argc, argv) | ||
+ | int argc; | ||
+ | char** argv; | ||
+ | { | ||
+ | int i,j; | ||
+ | | ||
+ | /* Use nested ' | ||
+ | for(i=1; | ||
+ | { | ||
+ | for(j=1; | ||
+ | { | ||
+ | /* ' | ||
+ | printf(" | ||
+ | } | ||
+ | | ||
+ | /* ' | ||
+ | for the next row of the table */ | ||
+ | printf(" | ||
+ | } | ||
+ | |||
+ | return 0; | ||
+ | } | ||
+ | . | ||
+ | w | ||
+ | 516 | ||
+ | q | ||
+ | $ | ||
+ | </ | ||
+ | |||
+ | Compiling this as in the above example and running it yields: | ||
+ | |||
+ | |||
+ | < | ||
+ | $ cc table.c | ||
+ | $ ./a.out | ||
+ | 1 x 1 = 1 1 x 2 = 2 1 x 3 = 3 1 x 4 = 4 | ||
+ | 2 x 1 = 2 2 x 2 = 4 2 x 3 = 6 2 x 4 = 8 | ||
+ | 3 x 1 = 3 3 x 2 = 6 3 x 3 = 9 3 x 4 = 12 | ||
+ | 4 x 1 = 4 4 x 2 = 8 4 x 3 = 12 4 x 4 = 16 | ||
+ | $ | ||
+ | </ | ||