From 5e15fc3254431fa543b49bc90a8ca40607c7cf2a Mon Sep 17 00:00:00 2001
From: Tristan-Raz
First, follow the directions given in
@@ -157,8 +157,8 @@ You should see a listing of files and directories. -
@@ -189,8 +189,8 @@ lrwxrwxrwx 1 root root 7 Mar 24 2022 bin -> usr/bin Thus, the
@@ -219,9 +219,9 @@ lrwxrwxrwx 1 root pearcej 7 Mar 24 2022 bin -> usr/bin
Occasionally, you need to change permissions of a file. For example, you might need to change permissions to make a file executable. Changing file permissions is done with the
@@ -242,8 +242,8 @@ lrwxrwxrwx 1 root pearcej 7 Mar 24 2022 bin -> usr/bin
ls -lra
- @@ -333,8 +333,8 @@ lrwxrwxrwx 1 root pearcej 7 Mar 24 2022 bin -> usr/bin pwd -
@@ -484,9 +484,9 @@ wc -w < temp.txt Try it! This is an improvement because it is faster and avoids the use of a temporary file. -
@@ -546,9 +546,8 @@ wc -w < temp.txt chmod +x hellouser.sh ./hellouser.sh -
@@ -614,8 +613,8 @@ rm -i newfile4.txt
And, if you respond with "n", then the removal will not happen.
-@@ -681,7 +680,7 @@ rm: remove regular file 'newfile2_cp.txt'?
As you can see, these search patterns give you a lot of power and control.
-
+
This and subsequent subsections are written to be followed as an extended exercise with explanations given as we go.
First, follow the directions given in
The reason you see something like this is because the SHELL environment variable stores the location of the shell program. This location, called the
@@ -156,9 +157,9 @@
You should see a listing of files and directories.
+@@ -187,10 +188,10 @@ lrwxrwxrwx 1 root root 7 Mar 24 2022 bin -> usr/bin
Thus, the
@@ -219,9 +220,9 @@ lrwxrwxrwx 1 root pearcej 7 Mar 24 2022 bin -> usr/bin
Occasionally, you need to change permissions of a file. For example, you might need to change permissions to make a file executable. Changing file permissions is done with the
@@ -242,8 +243,8 @@ lrwxrwxrwx 1 root pearcej 7 Mar 24 2022 bin -> usr/bin
ls -lra
- @@ -333,8 +334,8 @@ lrwxrwxrwx 1 root pearcej 7 Mar 24 2022 bin -> usr/bin pwd -
@@ -484,9 +485,9 @@ wc -w < temp.txt Try it! This is an improvement because it is faster and avoids the use of a temporary file. -
@@ -546,8 +547,9 @@ wc -w < temp.txt chmod +x hellouser.sh ./hellouser.sh -
@@ -613,21 +615,19 @@ rm -i newfile4.txt
And, if you respond with "n", then the removal will not happen.
-- -
-
- The up arrow key retrieves the previous shell command. If you press it multiple times, it will take you back through multiple commands in your shell history. This is a useful way to repeat a command. For example, if you had a typo, you can use the up arrow, edit the command, and push enter to fix the command. Analogously, the down arrow will move you in the reverse direction through the shell command history. For more useful shell commands, type
+ The up arrow key retrieves the previous shell command. If you press it multiple times, it will take you back through multiple commands in your shell history. This is a useful way to repeat a command. For example, if you had a typo, you can use the up arrow, edit the command, and push enter to fix the command. Analogously, the down arrow will move you in the reverse direction through the shell command history. For more useful shell commands, type
- An additional efficiency-enhancing feature is the
- Here's an example of what might be displayed when the
1 git init @@ -638,9 +638,8 @@ And, if you respond with "n", then the removal will not happen. 6 history-
+
This paragraph is intended to alert you to some useful search features. A couple examples of very common search patterns are using wildcards for zero or more characters or for a single character. The asterisk (*) specifies zero or more characters to match. In bash the question mark (?) is used for matching exactly one single character. -
- For example, if we type the following: -
-++ For example, if we type the following: +
+rm -i newfile?.txt-+
Then the question mark will match with any single character, and we will see the following prompts:
-+rm: remove regular file 'newfile2.txt'? rm: remove regular file 'newfile4.txt'?-+
If we instead type:
-++rm -i newfile*.txt --+
Then the asterisk will match with any number of characters (including zero), and we will see the following prompts:
-+rm: remove regular file 'newfile2.txt'? rm: remove regular file 'newfile4.txt'? rm: remove regular file 'newfile2_cp.txt'?--As you can see, these search patterns give you a lot of power and control. +
+As you can see, these search patterns give you a lot of power and control.
-
- Hopefully, you now feel a bit more comfortable using the shell. The shell commands discussed above are summarized in Appendix
+ Hopefully, you now feel a bit more comfortable using the shell. The shell commands discussed above are summarized in Appendix
You have a file named
Here are some commands you may need to perform the task. Rearrange the correct commands in the correct order by dragging and dropping.
-
-
-
-
-
-
-
-
-
This and subsequent subsections are written to be followed as an extended exercise with explanations given as we go.
-Try each of the following commands on your own machine.
-
- First, follow the directions given in
+ This section is written to be followed as an extended exercise with explanations given as we go. +
Try each of the following commands on your own machine.
+
@@ -678,49 +679,52 @@ rm: remove regular file 'newfile2_cp.txt'?
As you can see, these search patterns give you a lot of power and control.
+ + +
+ You have a file named
apple +orange +banana +grape ++
+ Your task is to create a new file named
+ Here are some commands you may need to perform the task. Rearrange the correct commands in the correct order by dragging and dropping. +
+
+
+
Hopefully, you now feel a bit more comfortable using the shell. The shell commands discussed above are summarized in Appendix
- You have a file named
apple -orange -banana -grape --
- Your task is to create a new file named
- Here are some commands you may need to perform the task. Rearrange the correct commands in the correct order by dragging and dropping. -
-
-
-
- This and subsequent subsections are written to be followed as an extended exercise with explanations given as we go. -
-- This section is written to be followed as an extended exercise with explanations given as we go. -
-Try each of the following commands on your own machine.
+ This and subsequent subsections are written to be followed as an extended exercise with explanations given as we go. +
++ This section is written to be followed as an extended exercise with explanations given as we go. +
@@ -96,9 +93,9 @@
The reason you see something like this is because the SHELL environment variable stores the location of the shell program. This location, called the
@@ -158,9 +155,9 @@
You should see a listing of files and directories.
-@@ -190,9 +187,9 @@ lrwxrwxrwx 1 root root 7 Mar 24 2022 bin -> usr/bin
Thus, the
@@ -221,9 +218,9 @@ lrwxrwxrwx 1 root pearcej 7 Mar 24 2022 bin -> usr/bin
Occasionally, you need to change permissions of a file. For example, you might need to change permissions to make a file executable. Changing file permissions is done with the
@@ -244,8 +241,8 @@ lrwxrwxrwx 1 root pearcej 7 Mar 24 2022 bin -> usr/bin
ls -lra
- @@ -335,8 +332,8 @@ lrwxrwxrwx 1 root pearcej 7 Mar 24 2022 bin -> usr/bin pwd -
@@ -486,9 +483,9 @@ wc -w < temp.txt Try it! This is an improvement because it is faster and avoids the use of a temporary file. -
@@ -548,9 +545,9 @@ wc -w < temp.txt chmod +x hellouser.sh ./hellouser.sh -
@@ -616,8 +613,8 @@ rm -i newfile4.txt
And, if you respond with "n", then the removal will not happen.
-@@ -715,12 +712,11 @@ grape -