gcc prog1.c       C compiler.   executable in a.out
gcc -o prog1 prog1.c            executable in prog1

g++ prog1.cpp     C++ compiler

javac Hello.java  Java compiler
java Hello        JVM


Standard I/O with command line arguments:

ANSI terminal control:

Curses library:
g++ -lncurses filename.cpp

gcc Xlib_Beginner.c  -L/usr/X11R6/lib -lX11

bash built-in commands:  help

type x    to determine if x is  alias, shell reserved word/keyword, shell
          function, shell builtin, or disk file.

which x    search PATH for x
whereis x  

Shell order of evaluation of command line: simplified
   1. keywords (if, case, for, function, while, !, {} ...)
   2. aliases
   3. built-in commands (alias, cd, echo, export, history, jobs, kill,
        read, set, shift, test, trap, umask ...)
   4. functions
   5. PATH search for command

bash shell scripts


Shell functions
--kept in memory (faster than script: No overhead of searching PATH, --opening file from disk, spawning subshell)
--like a built-in command
--variables are global with shell unless typeset to create local variables
--private arguments (alias cannot have args in ksh/bash)
--define in environment file .bashrc, interactively, or in script
typeset -f to list them. or as part of output of set
declare -f
l() {
  ls -l $* | more

usage() {
  echo "Usage: et [-a name number | -d name | -p | name]"
  exit $1

e() {
  emacs -fg white -font 9x15bold -geometry 90x30+0+0 $* &


calc() {
  echo "$*" | bc -l
Create interactively:
function myfunname { cmds ;}
tarball: some software is distributed as "tarball", a compressed tar archive of source code files etc.

5 commands to unpack, compile, install:

1. tar -xzf tarballfilename.tar.gz #or .tgz Unpack. creates a subdirectory.
2. cd tarballdirectory
3. ./configure    #Generate customized makefile for the system.
4. make    #Compile using that makefile.
5. make install    #As root, install onto system.