Skip to content

Commit 457bf22

Browse files
authored
Merge pull request UofT-DSI#349 from dtxe/main
add readme and disclaimer to optional extras section
2 parents 6fa9163 + 5e322b3 commit 457bf22

2 files changed

Lines changed: 29 additions & 21 deletions

File tree

01_materials/bash_quick_reference.md

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -85,24 +85,3 @@ Place this at the top of every Bash script to indicate which shell to use:
8585

8686
---
8787

88-
## ⚙️ Optional extras for customizing bash
89-
#### Append to ~/.bash_profile for extra spacing between previous commands and the subsequent shell prompt**
90-
```
91-
export PS1="\n\n$PS1"
92-
```
93-
94-
#### Append to ~/.bash_profile to track live command history
95-
```
96-
export PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
97-
alias showhistory="clear; tail -n0 -F ~/.bash_history | nl"
98-
```
99-
* clear: clear the terminal
100-
* tail: command for displaying the last few lines of a file
101-
* -n0: display no lines currently in the file
102-
* -F: watch the file for changes and display any new lines
103-
* ~/.bash_history: command history file for bash
104-
* | nl: line numbering
105-
106-
#### To display live updated command history, run this in a separate window:
107-
showhistory
108-
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
## ⚙️ Optional extras for customizing bash
2+
These commands are what I use to setup my environment for teaching and demonstrations.
3+
* These modifications are **not recommended** for learners
4+
5+
⚠️ Beware: mistakes when editing your profile script can **cause significant issues and impact your ability to use the terminal**. ⚠️
6+
7+
On Windows, these commands should be appended to `~/.bash_profile`.
8+
On MacOS, these commands should be appended to `~/.zshrc`.
9+
10+
#### Append to the shell profile for extra spacing between previous commands and the subsequent shell prompt**
11+
```
12+
export PS1="\n\n$PS1"
13+
```
14+
15+
#### Append to the shell profile to track live command history
16+
```
17+
export PROMPT_COMMAND="history -a; $PROMPT_COMMAND"
18+
alias showhistory="clear; tail -n0 -F ~/.bash_history | nl"
19+
```
20+
* clear: clear the terminal
21+
* tail: command for displaying the last few lines of a file
22+
* -n0: display no lines currently in the file
23+
* -F: watch the file for changes and display any new lines
24+
* ~/.bash_history: command history file for bash
25+
* | nl: line numbering
26+
27+
#### To display live updated command history, run this in a separate window:
28+
showhistory
29+

0 commit comments

Comments
 (0)