Hi! For reference, you can store this cheatsheet after you take the lectures in this section.
You can also print this cheatsheet and then follow the video lectures in this section along with it.
Enjoy!
---
## COMMANDLINECOMMANDS:
* Enter into a directory:`cd directoryPath`
* **WINDOWS:**
* List files in a directory: `dir`
* **OSX&LINUXes:**
* List files in a directory:`ls`
---
## BUILDING&RUNNINGPROGRAMS:
* **Build a Go program:**
* While inside a program directory, type:
*`go build`
* **Run a Go program:**
* While inside a program directory, type:
*`go run main.go`
<br/><br/><br/><br/>
_See the next page..._
<divstyle="page-break-after: always;"></div>
## WHATIS$GOPATH?
* _$GOPATH_ is an environment variable which points to a directory where the downloaded and your own Go files are stored.
* **On Windows**, it's in: `%USERPROFILE%\go`
* **On OSX&Linux**, it's in: `~/go`
* **NOTE:**Never set your GOPATH manually. It's by default under your users directory.
* **GOPATHhas 3 directories:**
* **src:**Contains the source files for your own or other downloaded packages. You can build and run programs while in a program directory under this directory.
* **pkg:** Contains compiled package files. Go uses this to make the builds (compilation&linking) faster.
* **bin:** Contains compiled and executable Go programs. When you call go install on a program directory, Go will put the executable under this folder.
* _You might want to add this to your `PATH` environment variable if it's not there already._
* BTW, There's a new *Go Modules* support which allows you to run your programs in any directory that you want. After the section ends, you'll also find an information about it.
> For more tutorials: [https://blog.learngoprogramming.com](https://blog.learngoprogramming.com)