Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit ce3dce3

Browse files
Update Unix Jupyter notebook Markdown lecture
- Add start up instructions - Change double quotes for single quotes when necessary. - Add exercise breaks - Add hints to exercises
1 parent cdbcb2a commit ce3dce3

File tree

1 file changed

+61
-30
lines changed

1 file changed

+61
-30
lines changed

‎notebooks/unix_outline_md.ipynb‎

Lines changed: 61 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,27 @@
1111
"# Linux/Unix Command and Bash Scripting (Markdown Code Blocks)"
1212
]
1313
},
14+
{
15+
"cell_type": "markdown",
16+
"metadata": {},
17+
"source": [
18+
"## Getting Started\n",
19+
"\n",
20+
"This lecture can be found on `state`.\n",
21+
"\n",
22+
"Let's all SSH into `state`.\n",
23+
"\n",
24+
"```sh\n",
25+
"ssh leunge@state.ohsu.edu\n",
26+
"```\n",
27+
"\n",
28+
"And navigate to your folder.\n",
29+
"\n",
30+
"```sh\n",
31+
"cd /home/courses/BMI565/students\n",
32+
"```"
33+
]
34+
},
1435
{
1536
"cell_type": "markdown",
1637
"metadata": {
@@ -67,47 +88,37 @@
6788
},
6889
{
6990
"cell_type": "markdown",
70-
"metadata": {
71-
"heading_collapsed": true
72-
},
91+
"metadata": {},
7392
"source": [
7493
"#### `pwd`"
7594
]
7695
},
7796
{
7897
"cell_type": "markdown",
79-
"metadata": {
80-
"hidden": true
81-
},
98+
"metadata": {},
8299
"source": [
83100
"You can use `pwd` to show you where you are in your computer."
84101
]
85102
},
86103
{
87104
"cell_type": "code",
88105
"execution_count": null,
89-
"metadata": {
90-
"hidden": true
91-
},
106+
"metadata": {},
92107
"outputs": [],
93108
"source": [
94109
"pwd"
95110
]
96111
},
97112
{
98113
"cell_type": "markdown",
99-
"metadata": {
100-
"heading_collapsed": true
101-
},
114+
"metadata": {},
102115
"source": [
103116
"#### `ls`"
104117
]
105118
},
106119
{
107120
"cell_type": "markdown",
108-
"metadata": {
109-
"hidden": true
110-
},
121+
"metadata": {},
111122
"source": [
112123
"After knowing where you are, you should find out what files and directories are around you.\n",
113124
"\n",
@@ -126,7 +137,6 @@
126137
"cell_type": "code",
127138
"execution_count": null,
128139
"metadata": {
129-
"hidden": true,
130140
"scrolled": false
131141
},
132142
"outputs": [],
@@ -937,6 +947,13 @@
937947
"- [Bash One-Liners Explained, Part III: All about redirections](http://www.catonmat.net/blog/bash-one-liners-explained-part-three/)"
938948
]
939949
},
950+
{
951+
"cell_type": "markdown",
952+
"metadata": {},
953+
"source": [
954+
"## Exercise Break! (See below)"
955+
]
956+
},
940957
{
941958
"cell_type": "markdown",
942959
"metadata": {},
@@ -1070,9 +1087,7 @@
10701087
},
10711088
{
10721089
"cell_type": "markdown",
1073-
"metadata": {
1074-
"heading_collapsed": true
1075-
},
1090+
"metadata": {},
10761091
"source": [
10771092
"#### Resources and More\n",
10781093
"\n",
@@ -1112,9 +1127,7 @@
11121127
},
11131128
{
11141129
"cell_type": "markdown",
1115-
"metadata": {
1116-
"heading_collapsed": true
1117-
},
1130+
"metadata": {},
11181131
"source": [
11191132
"#### Resources and More\n",
11201133
"\n",
@@ -1587,15 +1600,15 @@
15871600
"source": [
15881601
"```sh\n",
15891602
"# Create bash script\n",
1590-
"echo \"#!/usr/bin/env bash\n",
1603+
"echo '#!/usr/bin/env bash\n",
15911604
"\n",
15921605
"head -n 1 ../README.md\n",
15931606
"\n",
15941607
"if [[ $? -eq 0 ]]; then\n",
1595-
" echo 'Successfully read beginning of file'; exit 0\n",
1608+
" echo \"Successfully read beginning of file\"; exit 0\n",
15961609
"else\n",
1597-
" echo 'Failed to read beginning of file'; exit 1\n",
1598-
"fi\" > test_exit_codes.sh\n",
1610+
" echo \"Failed to read beginning of file\"; exit 1\n",
1611+
"fi' > test_exit_codes.sh\n",
15991612
"\n",
16001613
"# Run bash script from above\n",
16011614
"bash test_exit_codes.sh\n",
@@ -1826,6 +1839,13 @@
18261839
"- [Unix / Linux: sftp File From One Server To Another](https://www.cyberciti.biz/faq/sftp-file-from-server-to-another-in-unix-linux/)"
18271840
]
18281841
},
1842+
{
1843+
"cell_type": "markdown",
1844+
"metadata": {},
1845+
"source": [
1846+
"## Exercise Break! (See below)"
1847+
]
1848+
},
18291849
{
18301850
"cell_type": "markdown",
18311851
"metadata": {},
@@ -2047,9 +2067,9 @@
20472067
"all : file1_count.txt file2_count.txt file3_count.txt\n",
20482068
"\n",
20492069
"create :\n",
2050-
" echo -e \"1\\n2\\n3\\n4\\n5\\n6\" > file1.txt\n",
2051-
" echo -e \"Hello, world!\" > file2.txt\n",
2052-
" echo -e \"We're learning bash programming!\" > file3.txt\n",
2070+
" echo -e '1\\n2\\n3\\n4\\n5\\n6' > file1.txt\n",
2071+
" echo -e 'Hello, world!' > file2.txt\n",
2072+
" echo -e 'We're learning bash programming!' > file3.txt\n",
20532073
"\n",
20542074
"%_count.txt : %.txt\n",
20552075
" wc $< > $@\n",
@@ -2147,6 +2167,13 @@
21472167
"## Exercises"
21482168
]
21492169
},
2170+
{
2171+
"cell_type": "code",
2172+
"execution_count": null,
2173+
"metadata": {},
2174+
"outputs": [],
2175+
"source": []
2176+
},
21502177
{
21512178
"cell_type": "markdown",
21522179
"metadata": {},
@@ -2165,14 +2192,18 @@
21652192
"\n",
21662193
"### Exercise 2 Download Data and Chop It Up\n",
21672194
"\n",
2168-
"Create a bash script to download the processed Long Beach V.A. data `processed.va.data` from the [Heart Disease Data Set](https://archive.ics.uci.edu/ml/datasets/Heart+Disease)and filter out for just subjects with Class 0 (last column). Save this subset of the data to a separate file.\n",
2195+
"Create a bash script to download the processed Long Beach V.A. data `processed.va.data` from the [Heart Disease Data Set](https://archive.ics.uci.edu/ml/datasets/Heart+Disease)and filter out for just subjects with Class 0 (last column). Save this subset of the data to a separate file.\n",
21692196
"\n",
21702197
"The data can be found [here](https://archive.ics.uci.edu/ml/machine-learning-databases/heart-disease/).\n",
21712198
"\n",
2199+
"**Hint**: Use `wget`/`curl` to download file and `awk` to subset data.\n",
2200+
"\n",
21722201
"### Exercise 3 Search for Codons\n",
21732202
"\n",
21742203
"Using the random DNA sequence Python script from Exercise 1, generate a random sequence of DNA and count the number of times the DNA sequence \"TAA\" (a stop codon).\n",
21752204
"\n",
2205+
"**Hint**: Use `grep` to count number of occurrences. You can use the `-c` flag for `grep` to count things.\n",
2206+
"\n",
21762207
"**Bonus**: Simultaneously find all three stop codons: \"TAA\", \"TAG\", \"TGA\" and count them each."
21772208
]
21782209
},

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /