Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Just Enough Command Line for Installing
This is your friend.
It goes by various names: terminal, command line, bash, shell, PowerShell; and looks a little different in each operating system.
|Window’s Command Prompt||Mac OS X’s Terminal|
Open a Terminal Window
In the Search box, type "Command Prompt", then in the list of results, double-click Command Prompt.
In OS X:
Open the Applications folder and then the Utilities folder. Click on Terminal.app
The Current Working Directory
The lowest line in the terminal displays the current working directory--the folder that can be affected by any commands that are entered at the command line.
The Command Prompt
Following the current working directory is a character that indicates where the command line begins. This is the command prompt. In Windows, it is the greater-than sign:
>; in OS X and Linux, it is a dollar sign:
Regardless of which operating system is being used, coding instructions sometimes indicate a command by preceding it with the dollar sign.
$ npm install -g grunt-cli
The dollar sign is not typed as part of the command.
Running a Command
After typing your command on the command line, press Enter or Return.
Sometimes the commands you run in the terminal need to be run by a user with elevated permissions...
The technique you use will depend on your version of Windows. This guide explains different ways to open a command prompt as administrator in Windows.
In OS X:
Open a terminal in the usual way. Begin your command with
sudo followed by a space, as in the following example.
sudo npm install -g grunt-cli
If sudo does not work, consult your systems administrator.
What if I enter a misspelled command?
Generally speaking, the program will report back with an error message or tell you that the command was not recognized. Read through the message to determine if it was caused by an innocuous typo or by something more serious. If simply a typo, retype your command and try again.
When a command finishes, it returns control to the command prompt. The command prompt will reappear, and you’ll be able to enter another command. Sometimes a command starts a process that seems to get stuck or encounters an error. It does not look like it will ever return to the command prompt.
To interrupt a process, press: Ctrl+C
Take responsibility for your own actions because using this command in certain circumstances can have undesirable consequences, such as computer crashes and lost data.
Most often a command needs to be run within the folder that contains the file that understands the command. In other words, the current working directory associated with the command prompt needs to be the folder that contains that file. If it is not, you need to navigate to it.
To list the contents (both files and folders) of the current working directory:
ls (in OS X and Linux)
dir (in Windows)
To change to directory that is within the current working directory:
To change to subdirectory:
To move up to the folder that is the parent of the current working directory:
$ cd ..
To view previous commands entered:
Use the keyboard's up and down arrows.
To exit the terminal window:
If a program is installed, it typically has the ability to report its version number. If it is not installed, your computer will not recognize the commands.
The following commands will return version numbers for key programs used by Adapt.