v0.4 10/24/2000 Rui Sousa Index 1. Logging in .1 RedHat 6.1 2. Basic Unix commands man, cp, ls, cd, rm, top, kill, ps. 3. Compiling and running programs .1 gcc .2 g77 .3 Running .4 make 4. E-mail netscape, pine, exmh, elm, mail 5. Remote access telnet, ssh, ftp 6. Internationalization Gnome KDE Gnu programs 7. Printing lpr, lpq, lprm lpr -Plaser abc.pdf e.g. lpr -Plaser -o sides=two-sided-long-edge -o fit-to-page -o media=letter -o page-ranges=1-2 abc.pdf ------------------------------------------------------------------------------- 1. Logging in 1.1 RedHat 6.1 Place the mouse over the login dialog and enter your name and password. On the top bar you have three menus: "Session" allows you to choose different Graphical Users Interface (GUI) and/or different Window Managers (WM). "Language" gives you the choice for the language used by applications. Translations are far from complete but you can give it a try and see how much you hate it ;) This is only used by Gnome. For KDE change the default Language in the "Settings/Desktop/Language" menu (inside kde) "System" menu gives you opportunity to cleanly reboot or halt the computer. If the computer is in a state where you can actually use the menu then you shouldn't need to reboot. Leave it alone. 2. Basic Unix commands man - Gives you the manual page for a command. One of the _most_ important commands, IMHO. man some_command cp - Copies files cp this_file new_file ls - Lists files in a directory cd - Change directory cd some_path rm - Deletes file rm garbage.txt mkdir - Creates new directories. mkdir new_directory rmdir - Deletes directories. rmdir go_away_directory top - Shows running processes. Quit using "q" (this is a hard one to remember ;) kill - Kills processes. You need the process ID number, use top to get it. You can only kill your own processes. kill PID ps - Another way of listing running processes. Most useful in the form: ps uax tail - shows the end of a file head - shows the beginning of a file grep - searches a file for a regular expression cat - shows an entire file 3. Compiling and running programs 3.1 gcc- C/C++ compiler usage: gcc source.c -o program_name to compile with the math library (when including math.h) use gcc source.c -lm -o program_name You also may want to try the following options: -O3 provides lots of optimizations (your code runs faster) -Wall warns you about all possible mistakes (may help you solve bugs) Example: gcc -O3 -Wall source.c -lm -o program 3.2 g77- Fortran compiler g77 source.f -o program_name For more options see above (gcc). 3.3 Running run with: ./my_program The initial "." means "the directory I'm in", the "/" is just the usual separator in Unix paths (the dos "\"). So the command stands for run the program my_program which is in this directory. Most useful for when the "." directory is not in your PATH environment variable. to run programs in the background use (you can logout and the program continues to run) use: ./my_program & if you are reading/writing to the terminal ("printf","scanf","WRITE(6,*)", "READ(5,*)","cout <<","cin >>") you can redirect input/output with: ./my_program > output.file < input.file & input.file should contain what you usually type at the command prompt. To look at the output you can use: tail -f output.file 3.4 make- if you are compiling reasonable sized programs with several source files have a look at this command (man make). 4. E-mail Several e-mail clients are installed: netscape, pine, exmh, elm, mail. Choose the one to your liking. 5. Remote access. You can access grad.physics.sunysb.edu remotely using: ftp (file transfer), ssh (secure shell), pop3 (mail server), imap (mail server). In addition, to the outside you can use: telnet, rsh. 6. Internationalization 6.1 Gnome Just choose your language in the login box. 6.2 KDE Choose your language inside KDE in the Settings/Desktop/Language menu. KDE is (essentially) a German project and so should have very good/complete translations to German. 6.3 Gnu utils (Gnome does this auto-magically) set the environment variables LINGUAS and LANG to your country code (us, gr, fr, pt, el). In bash (the command shell we are all using) just do: export LINGUAS=pt export LANG=pt You can put this in your ~/.bash_profile ("~" stands for you home directory) 6.4 Dictionaries You can now use ispell to check the spelling of documents in your native language (only in the redhat-6.1 computers). Use: ispell -d my_language_dictionary The available dictionaries (and their correct names) can be checked with: ls /usr/lib/ispell The dictionary name doesn't include the "." or anything after it. (I think I will use it to check this document :) 7. Printing lpr - Submit job to printer lprm - Deletes job from the printing queue lpq - Lists jobs in the printing queue The printer identification is no longer needed (the "-P glps" thing)