UNIX Tips for Hydrology Lab users
Here is a list of tips to help users in the UNIX environment, specifically
on hydrolab and hl2 workstations. Not all commands work on both machines
(ie, the Fortran compiler is only on hl2). The standard UNIX command syntax
is:
command_name [optional_arguments] required_arguments
Editors and Mail
Editors
- Emacs - standard all-purpose editor. Does almost everything you could want an editor to do (search, replace, paragraph formatting, rectangle editing, multiple buffers, macros, parenthesis matching), but keybindings can be a little tough to get used to. Once you learn it, you won't be disappointed. Works well in all environments. Read the book to find out more (first four chapters are highly recommended). Check out /home/rparry/.emacs for useful options.
- Xemacs - like emacs, but is better integrated with X Windows.
- Crisp - commercial editor. Does most tasks well. Especially good for working with C code because it color codes based on syntax. Keybindings work across X Windows and DOS telnet sessions (with slight modifications). X Windows version is: mcr and character based version is: cr. Add contents of /home/rparry/crisp.env to your $HOME/.profile for environment settings.
- pico - standard editor used with Pine. Character based, simple, but useful.
Mail Readers
These mail readers run only on UNIX, so you must log in to read your mail. We also have mail readers which will down load mail to your PC.
- Pine - easy to use
- Elm - perhaps more configurable
Development Tools
Compilers
Type the name of the command by itself to see a list of options. You can find help in the language and compiler guides. InfoExplorer also has the C users and reference guides on line.
- C - xlc and cc
- lint - C code syntax checker. A must if you write C. Check out the man page.
- Fortran - xlf
Useful compiler options:
-lm - (C only) References the math library. Use this if you get strange compiler error messages about math functions.
-O - optimize. (uppercase oh). Also can use -O2 and -O3 for other levels of optimization
-o filename - (lowercase oh). Specify name of compiled (output) program.
Scripts
- Korn shell - Easy to use and learn. Supports most flow structures (for, if, while, case), numerical expression evaluation, and single dimension arrays. Example scripts can be found at: /usr/local/tar/IncrBackup
- Perl - Practical Extraction and Reporting Language. A combination of C, awk, and sed. The best tool to use to process text files. Not too difficult to learn (a book available), very flexible, and it does everything. Example scripts can be found at: /home/rparry/morning.check.perl and /usr/local/bin/xferstats
Help
Most comands give you syntax help with the -h option.
- man [command | -k keyword] shows manual pages for a command or does a keyword search in database of available commands.
- info [-h keyword] InfoExplorer graphical help. System has online manuals and can search
for keywords. Use cntl-O (that's the letter oh) in the ascii mode to get access to the menu.
Printing
- enscript - converts text to PostScript. Must use this to print UNIX text files. Useful options include:
-2r two column rotated. Font is automatically adjusted.
-G gaudy mode, adds date/time and page number
-b "title" adds a title other than the name of the file.
- lpr [-P queue] send a file to a printe queue. Since all printers are PostScript, only use this with PS files. The default queue is the b&w PostScript.
- lpq [-P queue]
check the status of a print queue. The color printer queue is tekps and
is on hl2.
- lprm [-P queue] ###
remove job number ### from the print queue. Will need to precede the
command with sudo if your userid did not send the print job
- sudo qadm -U queue_name :will bring the print queue back up if you have already determined
that it is down (by using lpq)
Print Queues
on hydrolab:
and on hl2:
- lpq1 - b&w PostScript
- tekps - color PostScript
System Information
- w - shows who is logged into the system and the 1, 5, and 15 minute CPU load averages.
- psu [userid]script to show all processes belonging to your userid or the given userid .
- monitor [-top | -all]shows memory, paging, disk, I/O, and network activity. Use -top to show the top CPU users, use -all to show all info (only works with X Windows).
Network Information
- ping hostcheck to see if host is up. Use cntl-c to break.
- nslookup host [server]lookup host on a Domain Name Server. Returns the host's IP number.
RMP, May 31, 1995