You are on page 1of 1

Chester’s Cheat Sheet for Using Cygwin, but not installing it

cd C: (goes to C: cygwin directory)


cd CS1Projects (open the project folder)
xemacs blank.cpp (code editor)
emacs blank.cpp (code editor)
“Type the code in, when finished ctrl-x ctrl-c, press y. Double-check for coding errors
For exiting the cygwin editor
“F10 f qy”
For exiting emacs editor
ls (for seeing all the files within)
“compile it with g++”
g++ -o blank –Wall blank.cpp (use an ls to see if a blank.cpp & a blank.exe exist)
./blank.exe (this runs the program)
g++ -Wall –o exec_name blank1.cpp blank2.cpp blank3.cpp
Type (exit) to exit the cygwin
Useful UNIX Commands
To list files in your current directory ls or ls-1 (“el es”)

To copy a file cp oldfile newfile

To delete (remove) a file rm filename

To change a filename mv oldfile newfile

To get information on how to use a command man command

To print a file lpr -Pprintername filename

To view a file one screen at a time less filename

To advance one screen, hit the spacebar

To sign off logout

To create a subdirectory mkdir directoryname

To change the current directory to a cd directoryname


subdirectory

To change the current directory to the parent cd ..


directory

To interrupt a running job Control C

Zip a directory zip –r files_name.zip hw1

Find out which version gcc –version or g++ --version

List the path directory pwd

Compile just a cpp file g++ -c blank.cpp

Compile all the .o files into an .exe g++ blank1.o blank2.o blank3.o -o hw#

You might also like