-
Notifications
You must be signed in to change notification settings - Fork 0
/
bash.Rmd
86 lines (55 loc) · 3.37 KB
/
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
---
title: "Set up for bash"
params:
linux_version: "Ubuntu 18.04 LTS"
linux_version_link: "https://www.microsoft.com/en-ca/p/ubuntu-1804-lts/9n9tngvndl3q?activetab=pivot:overviewtab"
linux_version_cli: "Ubuntu-18.04"
---
Many biocomputing tools are only accessible and executed from a Unix-like Command Line Interface (CLI). All instructions in EDUCE materials related to CLI assume that you use a particular shell called `bash`.
## {.tabset .tabset-fade .tabset-pills}
### Windows 10
Out-of-the-box, Windows 10 does not support Unix-like commands. Fortunately, it is possible to add this functionality by installing "Windows Subsystem for Linux" (WSL), which will allow you to run a Linux distribution (in our case, "Ubuntu") on top of Windows. You will have to restart your computer as part of the installation, so make sure to save any changes before you continue.
#### Installation
- First [update to the latest version of Windows 10](os.html#windows).
- Go to [Microsoft Store Windows Terminal website](https://aka.ms/terminal) > click the "Get" button to install the app.
- Select the Windows Start button > type `terminal` ![](images/one.png){width=3%} > choose "Run as administrator" ![](images/two.png){width=3%} > choose "Yes" in the prompt that opens > enter your administrator password if prompted
![](images/windows_terminal_as_admin.png){width=75%}
- In the Terminal app, enter the following commands to install WSL and the default Linux Ubuntu distribution
```
wsl --install
```
and restart your computer. If you encounter any problems, please see the [WSL installation troubleshooting guide](https://docs.microsoft.com/en-us/windows/wsl/troubleshooting#installation-issues). If you do not run the latest version of Windows, you will have to [install WSL manually](https://docs.microsoft.com/en-us/windows/wsl/install-manual).
- Now, you can start Ubuntu from the Terminal by entering:
```
wsl
```
- As a final step, we will update all installed programs of your new Ubuntu installation. In Ubuntu, enter the following commands:
```{bash eval = FALSE}
sudo apt update && sudo apt upgrade
```
#### Resources
- [Windows Subsystem for Linux Documentation](https://docs.microsoft.com/en-us/windows/wsl/)
- [Install WSL](https://docs.microsoft.com/en-us/windows/wsl/install)
- [Manual Installation of WSL](https://docs.microsoft.com/en-us/windows/wsl/install-manual)
- [Create a user account and password for your new Linux distribution](https://docs.microsoft.com/en-us/windows/wsl/user-support)
### macOS
To ensure that you are using `bash` (and not the new macOS default `zsh`), open the Terminal app and enter the following command after the prompt `$`:
```{bash eval = FALSE}
chsh -s /bin/bash
```
After the command is finished (i.e. you see the prompt `$` and your cursor again), quit and restart the Terminal app.
### Linux
We will ensure that you are using `bash` and have a program called `curl` installed to download files.
- To switch, open the Terminal app and enter the following command after the prompt `$` (all distributions):
```{bash eval = FALSE}
chsh -s /bin/bash
```
- Install `curl`
For Debian-based distributions (e.g. Ubuntu, Linux Mint):
```{bash eval = FALSE}
sudo apt update && sudo apt install curl
```
For RPM-based distributions (e.g. Fedora, CentOS):
```{bash eval = FALSE}
sudo yum update && sudo yum install curl
```