Linux: A Sort User Manual
Using a Linux Machine
How do I log in to my Linux account ?
Answer:
If you are using a machine in the department laboratory,
at the welcome screen, you will be asked for
your user name. Enter your user name. Then you will be asked for your
password. Once you enter that you will be logged in.
If you are trying to log in from outside the department.
Use ssh. The easiest way is to type at the command prompt:
ssh username@linux.cs.uiowa.edu
Then you shall be prompted for your password. Enter that and you shall
be logged in.
If you have any other remote login client other than ssh, you can use
that too provided you know how to use it. The machine you need to log
in to is 'linux.cs.uiowa.edu'. For authentication you need to enter
your user name and password again.
How do I compile a program ?
First, click on the terminal icon to get to the terminal.
At the command prompt, type the following command
gcc [-o output] filename.c
where filename.c is your source C file. -o output is an optional
parameter which is the name you want to give to the executable
program. If specified, the output file 'output' is produced as the
executable program, otherwise 'a.out' is the executable program
generated by C compiler. Of course this happens if no syntax errors
are discovered in your C program.
How do I execute the program ?
After C compiler has produced the 'output or 'a.out' as a
result of compilation you can execute your program by typing
'./output parameter1 parameter2 ...'
if you named your executable 'output' or
'./a.out parameter1 parameter2 ...'
if you let the compiler to generate the default 'a.out' as executable.
If you want to use the executable name "output" or 'a.out' rather than
"./output" or './a.out' type in your .schrc file the command:
set path = ( $path . )
Note 1
parameter1 parameter2 ... is the list of 0 or more parameters or
command line arguments.
Note 2
You have to type './' before an executable file name because for
security reasons you do not have the privilege to execute files from
your login.
How do I compile multiple files ?
This is similar to compiling a single file. Just list the files you wish
to compile separated by space. For e.g. to compile 2 files file1.c and
file2.c type the following at the command prompt
gcc -o output file1.c file2.c
How to find more information about commands ?
Simply type the following at the command prompt.
man 'commandname'
For example, to find out more about gcc type
man gcc