-
Notifications
You must be signed in to change notification settings - Fork 0
/
03-bash.Rmd
36 lines (21 loc) · 2.24 KB
/
03-bash.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
```{r, include = FALSE}
ottrpal::set_knitr_image_path()
```
# Bash
## Goal
Gain an understanding of what bash is and what it can do for you
## Learning Objectives
After going through this chapter, students should be able to:
* Explain the difference between the command line and bash
* List advantages of bash over a graphical user interface (GUI)
## What is bash
In order to understand what bash is, we first need to define what the command line is. The command line is the text interface with your computer that is brought up when you run `terminal` or another similar program. In computers with no graphical interface, the command line is the only way to interact with the computer.
Bash is a command line interpreter. There are several different interpreters, but bash is quite common and the default on the provided CMDB laptops. Bash allows you to:
1. navigate through the filesystem
2. interact with files by creating, editing, examining, moving, or deleting them
3. run built-in tools
4. perform some basic logical operations, i.e. a simple form of programming
Though it lacks some of the features of other programming languages (which we will discuss in the Chapter 5), bash is similar in that it executes commands. Bash is particularly specialized for file system navigation and management, networking, and administration tasks, such as setting up the environment (what programs are available to be used), and chaining together code written in other languages.
## Bash vs. a graphical user interface (GUI)
While all of us are very familiar with GUIs (e.g. macOSX or windows, excel, gimp, photoshop), many will be less (or not) familiar with getting the same or more functionality out of the command line through bash. Some of the most powerful features of using bash are text manipulation and performing repetitive tasks. While on a GUI there is not an easy way to perform the same task or set of tasks repeatedly, bash allows you to create a script that can easily handle even complex sets of tasks repeated on each input.
The biggest disadvantage of the command line and bash compared to a GUI is the learning curve. Many people are nervous to use the command line because of its unfamiliarity, but with a few simple commands, you will be using bash with ease.