---
# System prepended metadata

title: Introduction to the Command Line
tags: [3. Miscellaneous, command line, tutorials]

---

# Introduction to the Command Line
###### tags: `3. Miscellaneous` `tutorials` `command line`

## What is command line and why is it important

Command line interface (OS shell) is one of a few ways of interacting with a computer's operating system. There are several benefits to learning how to use the command line effectively. 

Normally, you would think about a graphical user interface (GUI) that uses combination of mouse and keyboard inputs. Think about Photoshop, Chrome browser, or even the Desktop. 

![image alt](https://www.researchgate.net/profile/Joerg-Lippert/publication/51042494/figure/fig3/AS:214159628214277@1428071042694/Graphical-user-interface-examples-The-software-is-build-to-allow-an-efficient-building.png "Graphical User Interface" )

In contrast, using the command line interface in OS shell, you are typing commands solely using keyboard inputs. For many bioinformatics tools are developed without graphical interface, you will want to work with genomic and metagenomic data using shell. 

![image alt](https://files.realpython.com/media/Python-argparse-Guide_Watermarked.a7affa701ed5.jpg "Command Line Interface")

Furthermore, using shell and not relying on graphical interface gives you speed and efficiency. If you are dealing with telabytes of data, and you want to run a job for 100 times, you would want the computer to run as efficiently as possible. 

Lastly, we will want to utilize remote computers or cloud computing--Duke's cluster is called [Duke Computing Cluster (DCC)](https://rc.duke.edu/dcc/)--for high computing power provided by your school/organization. You need to use shell to access these resources. We will be using DCC for analyzing genome sequence data. 

I am writing this document largely based on the [Carpentry lesson](https://duke-gcb.github.io/shell-genomics/). Please make sure to check them out for better, more detailed instruction.

## Getting Started

### 1. Opening your shell 
A shell is a computer program that presents a command line interface. Think about what the screen looks like in a movie scene where a genius hacker is typing really fast on a dark screen with green text running. You can do that too!! 

I have no experience working on a Window machine, so everything here is mainly written for Mac and Linux machine users. Using Window will have differences here and there, but I won't go into them because I simply don't know. 

A Mac has a built-in shell program called Terminal. You can launch it by searching the term "Terminal" in Spotlight. To open Spotlight, you can click the magnifying glass icon on the menu bar top right of your desktop, or simply press `command + space bar` (This may change depending on your input settings). 

You can change how your terminal looks like by clicking `Terminal` on the top left of the screen (next to the Apple icon), and select the `Preferences...` drop down.

### 2. Navigating your file system 

The dollar sign `$` and everything in front of it is a **command prompt.** It means the shell is waiting for your input. 

Let's type your first command! Type in `pwd` which stands for *print working directory.* 

```
$ pwd
$
```
