Basic Unix commands

You should need very few Unix commands for 342. Develop your C++ program using whatever application you choose. Completely write, debug, and test all your code. Don't use any fancy I/O, use simple >> and <<. When your program is completely done, and you're ready to turn it in, make sure it compiles under unix using the g++ compiler on a Unix machine.

Execute it too because using a machine that you don't own, that you're not the administrator for can help find bugs. On your machine at home, you can write over most memory because it's yours. Under unix, if you try to write to some memory that isn't yours (a bug you don't know you have), you're program will probably crash. It's always better for you to find bugs than to have me find them!

If you try to access memory that isn't yours on goodall, or you have some garbage address you're trying to access, the error you get is
     "Segmentation fault (core dumped)"
First, to terminate any process under unix, enter Ctrl-c (e.g., you find your program is in an infinite loop).

Here are the minimal unix commands you may need. Enter these at the prompt.

To list your files:
Compile and link all .cpp files (list as many .cpp files as you have for your program) then create an executable file called a.out:
     g++ file1.cpp file2.cpp 
Execute your program:
Remove/delete a file, say file1.cpp:
     rm file1.cpp
Copy file1.cpp and name it file2.cpp:
     cp file1.cpp file2.cpp
View a file, say file1.cpp, at the screen, one screen at a time:
     more file1.cpp
     ("space" for next screen, "enter" for next line, "q" to quit viewing)
Move (rename) a file, say file1.cpp to file2.cpp:
     mv file1.cpp file2.cpp
Log out: