Skip to content

Commit 9df237e

Browse files
author
purduercac-docs-bot
committed
Merge remote-tracking branch 'origin/main' into dev
2 parents 7027eda + a1839f0 commit 9df237e

26 files changed

Lines changed: 224 additions & 253 deletions
138 KB
Loading

docs/workshops/hpc_exchange/week1/access.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ comes with the `ssh` program already there as
2323
well. To use `ssh`, open a Terminal (in any system).
2424
And use the command:
2525

26-
```sh
26+
```sh linenums="0"
2727
$ ssh USERNAME@CLUSTER.rcac.purdue.edu
2828
```
2929
Where `USERNAME` is replaced with your Purdue username
@@ -32,7 +32,7 @@ trying to access.
3232

3333
You should see something that looks like this:
3434

35-
```
35+
``` linenums="0"
3636
************************************************************
3737
3838
***** Use of Purdue BoilerKey or SSH keys is Required ******
@@ -54,7 +54,7 @@ to the cluster you are trying to get into).
5454
When you're logged in, you prompt should change to be of
5555
the form of:
5656

57-
```
57+
``` linenums="0"
5858
USERNAME@loginXX.CLUSTER:[~] $
5959
```
6060

docs/workshops/hpc_exchange/week1/commands.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ every time. There are three parts to a command:
2121
3) The argument(s)
2222

2323
Here is an example of a copy command
24-
```bash
24+
```bash linenums="0"
2525
$ cp --verbose -r example-data data.bak
2626
```
2727
!!! note
@@ -40,14 +40,14 @@ As the last part of the command, we have the argument(s). These tell the program
4040

4141
Some options are unsupported for different programs. Some programs will be helpful and tell you that the option is invalid. Others will silently fail and you will be left wondering why
4242

43-
```bash
43+
```bash linenums="0"
4444
$ cp -z example-data data.bak
4545
cp: invalid option -- 'z'
4646
Try 'cp --help' for more information.
4747
```
4848
Another problem you may run into is a `command not found` error. This happens when the computer doesn't know where to find the program you are trying to run:
4949

50-
```bash
50+
```bash linenums="0"
5151
$ blah
5252
-bash: blah: command not found
5353
```

docs/workshops/hpc_exchange/week1/editing.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ whitespace as delineating the arguments of a program.
1111
So, if you had a folder named `example data`, and ran
1212
this command:
1313

14-
```bash
14+
```bash linenums="0"
1515
$ ls example data
1616
```
1717
It would try to list everything in the `example` and
@@ -22,11 +22,11 @@ you can escape it by using the escape character (`\`)
2222
to tell the command line to take that character as
2323
is and not try to interpret it. So you could do:
2424

25-
```bash
25+
```bash linenums="0"
2626
$ ls example\ data
2727
```
2828
or
29-
```bash
29+
```bash linenums="0"
3030
$ ls "example data"
3131
```
3232

@@ -60,11 +60,11 @@ friendly.
6060
To start `nano` you can do one of two ways:
6161

6262
Simply type `nano` to start it in a new file:
63-
```
63+
``` linenums="0"
6464
$ nano
6565
```
6666
Or provide a file name to start editing that file:
67-
```
67+
``` linenums="0"
6868
$ nano document.txt
6969
```
7070
Nano looks similar to this:
@@ -97,7 +97,7 @@ specify and `Exit` quits out of the editor.
9797
### vim:
9898
Starting vim is similar to nano, you can either specify a file you want to edit or make, or simply type `vim`:
9999

100-
```bash
100+
```bash linenums="0"
101101
$ vim document.txt
102102
```
103103

@@ -126,13 +126,13 @@ the name of the file you want to change it to, or if it's
126126
a directory, it's the place you want to put the file.
127127

128128
Changing the name of the file:
129-
```bash
129+
```bash linenums="0"
130130
$ mv document.txt paper.txt
131131
```
132132
Which will change the name of the file to be `paper.txt`
133133

134134
Changing the location of the file:
135-
```bash
135+
```bash linenums="0"
136136
$ mv paper.txt ~/Desktop/
137137
```
138138
Which will move the file into the `Desktop`
@@ -141,7 +141,7 @@ directory, but keep the same name.
141141
!!! note "Moving Multiple Files"
142142
If you provide more than 2 arguments, `mv` will require the last argument to be a destination directory. Like:
143143

144-
```bash
144+
```bash linenums="0"
145145
mv file1.png file2.png *.txt Desktop
146146
```
147147

@@ -151,7 +151,7 @@ The `cp` or `copy` program is similar to the `mv` program
151151
except that it leaves the original copy intact. This is
152152
useful if you want to create a backup or a fork of
153153
something. The command:
154-
```bash
154+
```bash linenums="0"
155155
$ cp ~/example-data/paper.txt ~/thesis.txt
156156
```
157157

@@ -166,14 +166,14 @@ directory, but still keep the original file around.
166166

167167

168168
Let's try backing up a directory:
169-
```bash
169+
```bash linenums="0"
170170
$ cp example-data/ data.bak
171171
cp: example-data/ is a directory (not copied).
172172
```
173173
Oops, what happened here?
174174

175175
We can't copy directories without recursively copying its contents, which `cp` does not do by default. You can copy directories with the `-r` (recursive) option:
176-
```bash
176+
```bash linenums="0"
177177
$ cp -r example-data/ data.bak
178178
```
179179

@@ -186,15 +186,15 @@ there is no concept of a trash bin, **if you remove a file,
186186
it's gone forever, no way to get it back**. So make sure
187187
you know what you're deleting before you run `rm`.
188188

189-
```bash
189+
```bash linenums="0"
190190
$ rm thesis.txt
191191
```
192192

193193
To delete directories, you need to use the `-r` or
194194
recursive option. This will delete the directory and
195195
everything inside of it. Again, this is permanent, so
196196
be very careful to know exactly what you're deleting.
197-
```bash
197+
```bash linenums="0"
198198
$ rm -r data.bak
199199
```
200200

docs/workshops/hpc_exchange/week1/filesystem.md

Lines changed: 24 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ As a user, you can picture a filesystem as a series of nested files and folders(
1212

1313
`pwd` is a program that is occasionally helpful, but is a good way to get your feet wet in trying out different UNIX commands. All it does is print out what directory (folder) you are currently in. Usually you will already know where you're at from the prompt, but it can be helpful to know the full path. `pwd` stands for *print working directory*:
1414

15-
```bash
15+
```bash linenums="0"
1616
$ pwd
1717
/home/username
1818
```
@@ -21,7 +21,7 @@ $ pwd
2121

2222
Most shells start in your home directory!
2323

24-
```bash
24+
```bash linenums="0"
2525
$ pwd
2626
/home/username
2727
```
@@ -30,7 +30,7 @@ $ pwd
3030

3131
`ls` is one of the most common UNIX programs that you may use while on UNIX systems. By default, it lists the contents of your current working directory:
3232

33-
```bash
33+
```bash linenums="0"
3434
$ ls
3535
data.csv Documents bin Desktop
3636
```
@@ -55,12 +55,12 @@ argument to list contents of that directory.
5555

5656
You can substitute these in to match specific patterns like so:
5757

58-
```bash
58+
```bash linenums="0"
5959
$ ls *.txt
6060
file1.txt file2.txt file3.txt
6161
```
6262

63-
```bash
63+
```bash linenums="0"
6464
$ ls data?.[ct]sv
6565
data1.csv data2.tsv data3.csv
6666
```
@@ -69,7 +69,7 @@ argument to list contents of that directory.
6969

7070
Check with `$ ls --all`! These will vary depending on what you have installed, but most will be configuration files for programs you have installed. Common ones are:
7171

72-
```
72+
``` linenums="0"
7373
.bashrc - bash startup customization file
7474
.conda - Conda python environments
7575
.cache - Cached data (like photo thumbnails)
@@ -87,7 +87,7 @@ is `cd`, which stands for *change directory*, but should be
8787
thought of as *change working directory*. This will change
8888
which directory you are currently working in.
8989

90-
```
90+
``` linenums="0"
9191
$ pwd
9292
/home/username
9393
$ cd Desktop/data
@@ -120,13 +120,13 @@ $ pwd
120120

121121
The last program we'll go over in this section is the `mkdir` or *make directory* command. This does what it sounds like and will create the directory noted in the argument if it doesn't already exist.
122122

123-
```
123+
``` linenums="0"
124124
$ mkdir example-data
125125
```
126126
You can also put multiple arguments and `mkdir` will
127127
create all of them. A helpful option to pass to the `mkdir`
128128
program is `-p`, which will create parent directories as needed.
129-
```
129+
``` linenums="0"
130130
$ mkdir -p another_one/test1
131131
```
132132
Which will create the `another_one` directory in your current
@@ -137,14 +137,14 @@ directory.
137137

138138
There are several ways! We could first `cd` to the Desktop, and run `mkdir`:
139139

140-
```bash
140+
```bash linenums="0"
141141
cd /home/user/Desktop
142142
mkdir myfolder
143143
```
144144

145145
Or we could make it from our home directory by specifying the path:
146146

147-
```bash
147+
```bash linenums="0"
148148
mkdir Desktop/myfolder
149149
```
150150

@@ -159,12 +159,12 @@ a slash (`/`). Relative paths are relative to your current working
159159
directory and do not start with a slash.
160160

161161
### Absolute path
162-
```
162+
``` linenums="0"
163163
$ ls /home/username/Desktop
164164
output_of_ls
165165
```
166166
### Relative path
167-
```
167+
``` linenums="0"
168168
$ ls Desktop
169169
output_of_ls
170170
```
@@ -180,7 +180,7 @@ UNIX file systems:
180180
* The `-` represents the previous working directory (the directory you were in before your current one)
181181
* You can run `cd -` to navigate to the previous directory you were in.
182182

183-
```bash
183+
```bash linenums="0"
184184
$ cd Desktop/data
185185
$ cd -
186186
$ pwd
@@ -203,7 +203,7 @@ $ pwd
203203
* The `..` represents the parent directory of the directory you are currently in. For example, if you are in `/home/username/Documents/mydata`, the command `cd ..` will change your directory to `/home/username/Documents`
204204
* You can also stack these! For example, to move "up" two directories, you could use the command `cd ../../`
205205

206-
```bash
206+
```bash linenums="0"
207207
$ cd Desktop/data
208208
$ cd ..
209209
$ pwd
@@ -213,7 +213,7 @@ $ pwd
213213
![cd dot dot ](/assets/images/workshops/hpc_exchange/cd_dotdot.png)
214214

215215
??? question "How would we move from the `data` directory to the Downloads directory with one command?"
216-
```bash
216+
```bash linenums="0"
217217
cd ../../Downloads
218218
```
219219

@@ -225,8 +225,8 @@ the command `ls -l` which runs the `ls` program with the `l` option
225225
which tells `ls` to print out more information about the files.
226226

227227
The following code block shows an example of what you might see from
228-
the longer `ls` output:
229-
```bash
228+
the longer `ls` output of your `.ssh` directory:
229+
```bash linenums="0"
230230
$ ls -a -l -h ~/.ssh
231231
total 6.0K
232232
drwxr-xr-x 2 username student 4 Jul 17 11:19 .
@@ -235,9 +235,11 @@ drwx------ 14 username student 28 Jul 16 22:26 ..
235235
-rw-r--r-- 1 username student 0 Jul 17 11:19 config
236236
```
237237

238-
The three program options used here are: `a`, which displays all files/folders,
239-
even hidden ones; `l` which lists out more information about each listing;
240-
and `h` which shows the size of items in a human-readable format.
238+
The three program options used here are:
239+
240+
* `a`, which displays all files/folders,even hidden ones
241+
* `l` which lists out more information about each listing
242+
* `h` which shows the size of items in a human-readable format
241243

242244
In the first ten columns of the output are the permissions of that item, details of which will be discussed in the next paragraph. The next number is the number of hardlinks to the file, which for most use cases isn't important.
243245

@@ -304,7 +306,7 @@ hear the term *man page* which is just short for *manual page*, or
304306
running the program `man` with the argument being the program you
305307
want more information about.
306308

307-
```
309+
``` linenums="0"
308310
$ man ls
309311
```
310312
The `man` program pulls up a page that you can scroll up and down
@@ -313,13 +315,5 @@ pressing the `q` key. It is up to each program to provide its
313315
own `man` page, so not all programs have them, but when they do
314316
it can be helpful.
315317

316-
<!-- As a quiz, who can find (using the `ls` `man` page) what are the
317-
options necessary to list items by reverse chronological order
318-
(older items listed first).
319-
320-
.. admonition:: Answer
321-
:collapsible: closed
322-
323-
The command would be `$ ls -t -r` -->
324318

325319
Next section: [Editing Files](./editing.md)

docs/workshops/hpc_exchange/week1/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Week 1
22

33
This is the outline for our first week of the HPC Exchange. It is
4-
an intoduction to Unix and how to use it. We will discuss how to
4+
an introduction to Unix and how to use it. We will discuss how to
55
navigate the filesystem and common commands you may encounter while
66
working with Unix systems.
77

0 commit comments

Comments
 (0)