Quick reference guide Linux

Previous Contents Index Next 

11. Programming

The compilers listed below do usually accept the following options:

-c compile and create object output file, but do not link
-o file place output in file (link output or object file)
-Dmacro[=def] define macro as def
-Umacro undefine macro
-llibrary use the library named library when linking
-Idir search in dir for include files
-Ldir search in dir for libraries
-g add debugging information to the compiled output
-p add code to generate profile information at runtime (for prof)
-pg add code to generate profile information (for gprof)
-O[n] turn on optimization (level n, 0 means no optimization)

Most of the other options are compiler (and operating system) dependent. Consult manuals for details (user guide, optimization guide, language reference).

ar [-][dmpqrtx][abcisuvV] [membername] archive member[s] U
Create, modify, and extract from archives. The following modes are available:
-d delete members -m move members in an archive
-p print content of members -q append members to an archive
-r replace members -t display contents of an archive
-x extract members -v give verbose output
 
c++ [options] [file[s]] G
CC [options] [file[s]] UL
(GNU) C++ Compiler. See start of chapter for common options.  
gcc [options] [file[s]] G
cc [options] [file[s]] UL
(GNU) C compiler. See start of chapter for common options.  
cpp [options] [file[s]] UL
The C language preprocessor. See start of chapter for common options.  
cvs [options] command [command_options] [command_args] P
Concurrent Versions System based on RCS. The essential commands are:
cvs checkout module[s] cvs update
cvs add file[s] cvs remove file[s]
cvs commit file[s]
 
gdb [options] [program [corefile]] G
dbx [options] [program [corefile]] (Linux, Sun, SGI only) U
xdb [options] [program [corefile]] U
(GNU) Source-level debugger. Consult manual for instructions or use ddd.  
ddd [--help] [-dbx] [-gdb] [-xdb] [more_options] [program [corefile]] P
Graphical interface for the source-level debuggers dbx, gdb and xdb.  
g77 [options] [file[s]] G
f77 [options] [file[s]] UL
(GNU) FORTRAN 77 compiler. See start of chapter for common options.  
f90 [options] [file[s]] L
FORTRAN 90 compiler. See start of chapter for common options.  
gprof [-abcsz] [-eE name] [-fF name] [program [profile_file]] U
Display the execution profile of a program compiled with -pg (not Linux).  
java [options] [classfile] [argument[s]] L
java [options] -jar jarfile [argument[s]]  
Java interpreter. Executes compiled java code. For advanced use please consult the manuals. Available after ini jdk (or jdk3 or jdk4).  
javac [options] [file[s]] L
Java compiler. For advanced use please consult the manuals.  
ld [options] [file[s]] U
Linker. Combines object and archive files to create executables or prelinked modules. Usage similar to cc. System dependent options.  
ldd [file[s]] U
Prints the shared libraries required by file[s].  
m4 [-es] [-Dmacro[=defn]] [-Umacro] [file[s]] UF
Macro processor. Process file[s] or STDIN (and define or undefine macros with -D and -U). Enable line sync output for cpp (#line lines) with -s. GNU m4 has much enhanced macro capabilities.  
make [-deiknpqrst] [-f makefile] [target[s]] [macro=def] U
Make utility to maintain groups of programs. Targets in Makefile (or makefile) are brought up to date according to dependency rules. For compatibility among plattforms gmake is recommended on non Linux systems.
-d print debugging information
-e environment variables override makefiles
-i ignore errors from commands
-n no execution mode. Print commands only
-p print out the complete set of macro definitions and target descriptions
-r disable the built-in implicit rules
-t touch targets instead of remaking them
 
nm [-ACPuVv] [-t format] [file[s]] U
List symbols from object files. Use -C for C++ files, -u to print undefined symbols only. The format determines the radix for printing offsets.  
patch [-pnum] < patchfile Uf
Apply a diff file to an original. With -p strip the smallest prefix containing num leading slashes from each file name found in the patch file.  
perl [options] [script_file] [argument[s]] G
Practical Extraction and Report Language. The more common options are:
-d[:debugger] run scripts under debugger
-e 'script' execute script instead of script_file
-h print short usage text
-Idir add dir to @INC include path
-n assume 'while () { ... }' loop around script
-p as -n, print in addition line (as for sed)
-T turn on tainting checks
-V print perl configuration information
-w turn warnings on for compilation of script. Recommended
 
prof [-acnt] [-ox] [-m file] U
Analyze profile data (in mon.out or in file) for programs compiled with -p. On non Linux systems gprof is more powerful.  
ranlib archive U
Generate index to archive. On many systems no more needed (done by ar).  
strip [file[s]] U
Discard symbols from object file[s]. Used to reduce the size of executables.  
Tcl P
Script language. Often used together with the Tk (Toolkit) library to build applications with a GUI (see the man pages for tclsh and wish).  
test [expression] US
System command (see Shell above). Not useful as name of a user program.  
xmkmf [-a] UP
Create a Makefile from an Imakefile. With -a additionally execute
make Makefiles; make includes; make depend;
 

Previous Contents Index Next