Getting started
The basic cycle
- Switch on your monitor.
- Switch on your PC.
- Allow the machine to boot. Wait till the login prompt comes.
- Supply your login and password:
Login: e<nn>
Password: e<nn>
Here <nn> is the number of your PC. This opens your
window manager (usually KDE) with icons, the bottom
panel and so on. You are now ready to start your work.
- Click on the terminal icon to open a shell (command prompt).
- Edit your program (new or already existing) by an editor.
We recommend using the emacs editor. This is how you can run emacs:
emacs myprog.c &
(Note that the ampersand in the last command was not necessary, but is
helpful in the sense that it runs emacs in the background and the
shell is free to listen to your other commands.)
- Write your program in the editor and save it.
- Go to the shell and compile your program:
cc myprog.c
If compilation is successful, an executable called a.out
will be created.
- Run your program:
a.out
You may have to give the command ./a.out in case you are issued
a message like a.out: Command not found.
- Continue your edit-compile-debug-run-debug-print work.
...
Finally, it's pretty late. It's time to pack up. Wait! You still have some more
things to do, before you rush for your lunch.
- Close all the windows you opened.
- Logout from your window manager. This leaves you again in
the login console.
- Select the item to shut down the machine. Wait till the
machine completely shuts down.
- Switch off your monitor.
- You can now leave. Don't remember later that you have forgot to
sign the attendance sheet. You may not rely on our memory to certify in
the next week that you were present in this lab session.
Some useful Unix commands
Here is a short list of useful commands that you can use from your shell
(in addition to running emacs and compiling and running your program).
|