matrix
· ssh secure shell -- remote log in
· PuTTy
linux commands
· most commands have a help options available via one or more of the following forms
· cmd -? (old school style, defacto standard)
· cmd -h (sometimes h means something else
which is what popularized the following)
· cmd -help (non-standard, old school sometimes worth trying)
· cmd --help (I think technically this is the standard)
· The options typically use the following formats today
cmd -letter (single hyphen with one letter abbreviated option)
cmd -letter -letter -letter (three options specified)
cmd -letterletterletter (shorthand for above)
cmd --word (double hyphen with word description of option)
· ls (show file listing of the present working directory)
some interesting options with ls
· ls --help
· ls -a (list hidden files too)
· ls --all (list hidden files too)
· ls -l (long listing, with details and other information)
· ls --color=none (no color)
· mkdir d -- create a directory d
· cd d -- move to directory d
some special forms
· cd .. (moves to parent directory)
· cd / (moves to root directory)
· cd ~ (moves to home directory of user)
· man [command] ( opens the man page for command. The man pages will cover
usage and options for any given command. Most installed programs
on a unix system are installed with man pages)
examples:
· man man (will give the man page for the man command
· man ls (will give the man page for the ls command
use this to learn how to order your listing,
include more or selected fields,
or include hidden files)
· man cd (will give the man page for the cd command)
quick reference guide
vi editor ( emacs is also a popular choice,
but, I like vi so don't ask me about emacs.
Emacs may have less of a learning curve.
Vi can be frustrating and
after vi notpad is frustrating.
If you do not understand, you will)
· vi -help (the vi help screen)
· vi -help > viHelpFile (send the vi help screen to a file)
· cat viHelpFile (prints this file to the screen)
· more viHelpFile (a viewer opened with the file)
· less viHelpFile (another viewer with the file)
· vi -help | more (piping the help screen to the viewer)
· vi -help | less (piping the help screen to the other viewer)
· vi viHelpFile (opening the file we created with vi -h > viHelpFile)
vi edit mode -- enter edit mode with one of these commands
· i (edit before curser (useful at beginning of line and everywhere))
· a (edit after curser (useful at end of line))
· o (edit new line under curser)
· I (edit at beginning of line)
· A (edit at end of line)
· O (edit new line over curser)
notice the relationship of i to I, a to A, o to O. These pattern recur in vi.
Once in edit mode, simply type. Characters you type will be inserted.
vi command mode -- pressing escape in any mode will move vi to command mode.
· [escape] (return to command mode
· x, dd, #dd, D, dw, #dw (# is some number, n)
· x (cut char)
· dd (cut line)
· #dd (cuts n lines)
· D (delete to end of line)
· dw (delete word (vi words are simple enough to learn with practice))
· #dw (delete n words)
· :wq (write and quit vi)
· :q! (quit vi without saving)
· learn other commands as you need them from the quick reference
quick reference guide
C++
#include <iostream>
using namespace std
int main() {
return 0;
}
cin >> var
cout << var
cout << endl
makefile
make step
step: dependency
instruction
dependency:
instruction
p1.cpp
#include <iostream>>
using namespace std;
int main(){
cout << "hello world" << endl;
return 0;
}
makefile
process: compile link run
compile: p1.cpp
g++ -c p1.cpp
link: compile
g++ -o p1.exe p1.o
run: link
./p1.exe
clean:
rm p1.o
rm p1.exe
make run
g++ -c p1.cpp
g++ -o p1.exe p1.o
./p1.exe
hello world