Pages

Wednesday, January 20, 2010

UNIX for Quants

here i will discuss some basic command that are usually a quant need.

  • pwd -> to know in which directory person is working.
  • cd -> to change directory
  • df -> to check disk space
  • finger -> to see who is on the system
  • ls -> to check files in the current directory
  • passwd-> to change the password
  • logout -> to logout from the system.
  • rm -> to delete files
  • man -> to find help on commands
Running a C++ code in UNIX.

  • vi code.cpp (a text editor will open where you can type the code)
  • :wq (to save the changes and quit)
  • :q (to quit)
  • g++ code.cpp (to compile the code)
  • ./a.out (to run the code)

Making make files

Make files are used in project which have dependencies in number of files. By running make you can implement all the changes at one go.Following is the MakeFile example.

all: code

code: code1.o code2.o (to link both object files)
g++ code1.o code2.o -o code

code1: code.cpp (to make code1 object file)
g++ -c code1.cpp
code2: code.cpp (to make code2 object file)
g++ -c code2.cpp
clean: (to clean all created files)
rm -rf *o code


to find details any of the above command type man command which will take you to help file.

No comments:

Post a Comment