Command Box: Basic Navigation

On this page

After installation, you can run CommandBox simply by typing box into your terminal or CommandLine. The first time you run it, it will take a few moments to start up. It will be faster on subsequent uses.

So what does CommandBox do and why are we using a command line tool when we have windows based programs so readily available? The quick answer is that it turns out that developers type a lot and frequently they have to run programs and tasks where the options are both numerous and different each time they run them. Therefore, it is just plain faster to not have to grab a mouse, change the options and then run the task. It's easier to just type them all. With a little practice, this will be much less foreign of a concept and you'll find the workflow and tools you like using the most. Let's walk through some simple activities.

Basic folder navigation

  1. Open the Sites folder with whatever tool you normally use to browse the folders on your computer ( Windows explorer, the Finder, etc ) and put it side by side with CommandBox so you can see both of them. If this doesn't work you can flip back and forth between the two windows.

  2. In Command Box type LS and press enter. I used caps there to avoid confusion between an L and a I but lower case is fine. You should see the same list of files and folders in CommandBox as you so in your other tool. LS stands for list

  3. In CommandBox, type mkdir myNewExpFolder. You should see a new folder appear in the other window. MKDIR stands for Make Directory.

  4. This also works in reverse. Make a new folder in your GUI and when you type ls in CommandBox, you should see the same folder. You are looking in the same folder just using two different tools to do so.

  5. In CommandBox, type touch newFile.txt. You created a new file called newFile.txt in that folder.

  6. In CommandBox, type cd MyNewExpFolder and press enter. The prompt will change to say MyNewExpFolder. You are now in the folder MyNewExpFolder and any command you run will occur in that folder. To go up a level, type cd ... CD stands for change directory.

Lesson 2 of 5 - CommandBox