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
First, to terminate any process under unix, enter Ctrl-c (e.g., you find
your program is in an infinite loop).
"Segmentation fault (core dumped)"
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:
Execute your program:
g++ file1.cpp file2.cpp
Remove/delete a file, say file1.cpp:
Copy file1.cpp and name it file2.cpp:
View a file, say file1.cpp, at the screen, one screen at a time:
cp file1.cpp file2.cpp
Move (rename) a file, say file1.cpp to file2.cpp:
("space" for next screen, "enter" for next line, "q" to quit viewing)
mv file1.cpp file2.cpp