You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/filesystem.md
+34-34Lines changed: 34 additions & 34 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -17,11 +17,11 @@ This section will be a basic overview of the Linux filesystem concepts, not an i
17
17
- Learn about options (flags) and arguments to shell commands
18
18
- Learn about the **tab completion**
19
19
20
-
{: style="width: 500px;float: right"}
20
+
{: style="width: 400px;float: right"}
21
21
22
-
The Linux filesystem directory structure starts with the top root directory, which is shown as <code>/</code>. Below this are several other standard directories. Of particular interest are <code>usr/bin</code>, <code>home</code>, <code>usr/lib</code>, and <code>usr/lib64</code>. A common directory which you will also often find is <code>usr/local/bin</code>.
22
+
The Linux filesystem directory structure starts with the top root directory, which is shown as `/`. Below this are several other standard directories. Of particular interest are `usr/bin`, `home`, `usr/lib`, and `usr/lib64`. A common directory which you will also often find is `usr/local/bin`.
23
23
24
-
The picture on the right shows typical subdirectories under <code>/</code> (note that the command `tree` does not work at all HPC centers, though it does work on Tetralith---see the page [tree](../tree) under the "Extras" section for how to install if it is missing). Some of the directories have a **symbolic link** to a different name---this is often done to make it quicker to write, but can also be for compatibility reasons since some software have hardcoded paths.
24
+
The picture on the right shows typical subdirectories under `/` (note that the command `tree` does not work at all HPC centers, though it does work on Tetralith---see the page [tree](../tree) under the "Extras" section for how to install if it is missing). Some of the directories have a **symbolic link** to a different name---this is often done to make it quicker to write, but can also be for compatibility reasons since some software have hardcoded paths.
25
25
26
26
!!! Note
27
27
@@ -40,16 +40,16 @@ The file system could also be illustrated like this:
40
40
41
41
{: style="width: 500px;float: left"}
42
42
43
-
!!! warning "Note"
43
+
!!! important "Note about `/`"
44
44
45
45
The character `/` can be
46
46
47
-
1. the root directory, if it is at the front of a file or directory name
48
-
2. a separator if it appears inside a path.
47
+
1. the root directory, if it appears alone or at the front of a file or directory name
48
+
2. a separator if it appears in other positions within the path.
49
49
50
50
!!! note
51
51
52
-
If you are on a local cluster, on an HPC center, etc. where you are not root, you will as default be in your home directory when you login. You can use `cd ..` a couple times to go to the root of the system and do `tree` there if you want, or do `tree` in your home directory (you can always return there with just `cd`).
52
+
If you are on a local cluster, on an HPC center, etc. where you are not root, you will be in your home directory by default when you login. You can use `cd ..` a couple times to go to the root of the system and do `tree` there if you want, or do `tree` in your home directory (you can always return there with just `cd`).
53
53
54
54
!!! caution
55
55
@@ -84,7 +84,7 @@ There are is also an "environment variable" that can be used as shortcut for the
84
84
85
85
## pwd
86
86
87
-
The command ``pwd`` (print working directory) will print out the full pathname of the working directory to the screen.
87
+
The command `pwd` (**p**rint **w**orking **d**irectory) will print out the full pathname of the working directory to the screen.
88
88
89
89
You can use this to find out which directory you are in.
90
90
@@ -142,7 +142,7 @@ On Tetralith, user ``x_birbr``:
142
142
143
143
## ls - listing files/directories
144
144
145
-
The `ls` command is used to list files. If you just give the command `ls` with no flags it will list all files in the current directory except for hidden files.
145
+
The `ls` command is used to list files and/or directories. If you just give the command `ls` with no flags, it will list all files and subdirectories in the current directory except for hidden files.
146
146
147
147
<div>
148
148
```bash
@@ -154,30 +154,30 @@ This way you can to list files/subdirectories for any directory, but the default
154
154
155
155
Some examples:
156
156
157
-
-<code>ls /</code> lists contents of the root directory
158
-
-<code>ls ..</code> lists the contents of the parent directory of the current
159
-
-<code>ls ~</code> lists the contents of your user home directory
160
-
-<code>ls *</code> lists contents of current directory and subdirectories
157
+
-`ls /` lists contents of the root directory
158
+
-`ls ..` lists the contents of the parent directory of the current
159
+
-`ls ~` lists the contents of your user home directory
160
+
-`ls *` lists contents of current directory and subdirectories
161
161
162
162
!!! Note "Commonly used flags"
163
163
164
-
- <code>-a</code> lists content including hidden files and directories
165
-
- <code>-l</code> lists content in long table format (permissions, owners, size in bytes, modification date/time, file/directory name)
166
-
- <code>-lh</code> adds an extra column to above representing size of each file/directory
167
-
- <code>-t</code> lists content sorted by last modified date in descending order
168
-
- <code>-tr</code> lists content sorted by last modified date in ascending order
169
-
- <code>-s</code> list files with their sizes
164
+
- `-a` lists content including hidden files and directories
165
+
- `-l` lists content in long table format (permissions, owners, size in bytes, modification date/time, file/directory name)
166
+
- `-lh` adds an extra column to above representing size of each file/directory
167
+
- `-t` lists content sorted by last modified date in descending order
168
+
- `-tr` lists content sorted by last modified date in ascending order
169
+
- `-s` list files with their sizes
170
170
171
-
To get more flags, type <code>ls \--help</code> or <code>man ls</code> in the terminal to see the manual.
171
+
To get more flags, type `ls --help` or `man ls` in the terminal to see the manual.
172
172
173
173
!!! tip
174
174
175
175
You can often get more info on flags/options and usage for a Linux command with
176
176
177
-
- <code>COMMAND \--help</code>
178
-
- <code>man COMMAND</code>
177
+
- `COMMAND --help`
178
+
- `man COMMAND`
179
179
180
-
where COMMAND is the Linux command you want information about, like <code>ls</code>, <code>mkdir</code>, etc.
180
+
where COMMAND is the Linux command you want information about, like `ls`, `mkdir`, etc.
181
181
182
182
!!! Example "The output for a few of the flags, for a directory with two subdirectories and some files"
183
183
@@ -253,13 +253,13 @@ To get more flags, type <code>ls \--help</code> or <code>man ls</code> in the te
253
253
254
254
## Wild cards
255
255
256
-
Wild cards are useful "stand-ins" for one or more character or number, that you can use for instance when finding patterns or when removing/listing all files of a certain type.
256
+
Wild cards are useful "stand-ins" for one or more characters or numbers, that you can use for instance when finding patterns or when removing/listing all files of a certain type.
257
257
258
258
Wild cards are also called "glob" or "globbing" patterns.
259
259
260
260
??? Globs
261
261
262
-
Globs, also known as glob (or globbing) patterns are patterns that can expand a wildcard pattern into a list of pathnames that match the given pattern.
262
+
Globs, also known as glob (or globbing) patterns are special characters that can expand a wildcard pattern into a list of pathnames that match the given pattern.
263
263
264
264
On the early versions of Linux, the command interpreters relied on a program that expanded these characters into unquoted arguments to a command: `/etc/glob`.
265
265
@@ -272,11 +272,11 @@ Wild cards are also called "glob" or "globbing" patterns.
272
272
-**`[ ]`** represents a range of alphanumeric characters in ascending order.
273
273
-**`{ }`** the terms are separated by commas and each term must be a wildcard or exact name.
274
274
-**`[!]`** matches any character that is NOT listed between `[!` and `]`. This is a logical NOT.
275
-
-**`\`** specifies an "escape" character, when using a subsequent special character.
275
+
-**`\`** specifies an "escape" character, when using a subsequent special character.
276
276
277
277
!!! Warning
278
278
279
-
You may need quotation marks around some wildcards as well.
279
+
You may need quotation marks around some wildcards as well.
280
280
281
281
!!! Warning
282
282
@@ -286,7 +286,7 @@ Wild cards are also called "glob" or "globbing" patterns.
286
286
287
287
!!! tip "Try some of the commands below"
288
288
289
-
Useful files for these examples are found in ``exercises/patterns``
289
+
Useful files for these examples are found in `exercises/patterns`.
290
290
291
291
!!! Example "Some examples of the use of wildcards"
292
292
@@ -387,10 +387,10 @@ The command `cd` is used to change directory.
387
387
388
388
!!! summary
389
389
390
-
- Your home directory is generally located in ``/home/USERNAME`` or ``/home/U/USERNAME``
390
+
- Your home directory is generally located in `/home/USERNAME` or `/home/U/USERNAME`
391
391
- Your home directory is also stored as the environment variable ``$HOME``
392
-
- ``pwd`` displays your path and current location
393
-
- ``cd DIR`` changes your current working directory to DIR
394
-
- Using ``cd`` without providing a destination takes you to your home directory
395
-
- ``ls`` is used to list files and directories
396
-
- Wildcards are metacharacters for one or more character or number and are useful when you are finding patterns or removing/copying/listing all files of a certain type
392
+
- `pwd` displays your path and current location
393
+
- `cd DIR` changes your current working directory to DIR
394
+
- Using `cd` without providing a destination takes you to your home directory
395
+
- `ls` is used to list files and directories
396
+
- Wildcards are metacharacters for one or more character or number, and are useful when you are finding patterns or removing/copying/listing all files of a certain type
0 commit comments