This will open the manual page for `ls`. Use the space key to go
forward and b to go backwards. When you are done reading, just hit `q`
-to exit.
+to quit.
Programs that are run from the shell can get extremely complicated. To
see an example, open up the manual page for the `find` program,
word that contains the `*` character, it automatically looks for files
that match the given pattern. In this case, it identified four such
files. Then, it replaced the `*4*1` with the list of files, separated
-by spaces. In other the two commands:
+by spaces. In other words, the two commands:
ls *4*1
ls 0241 0341 0431 0481
hit the tab key, the shell will try to fill in the rest of the
directory name. For example, enter:
- cd S<tab>
+ cd b<tab>
The shell will fill in the rest of the directory name for
`boot-camps`. Now enter:
- ls 3<tab><tab>
+ ls s<tab><tab>
When you hit the first tab, nothing happens. The reason is that there
are multiple directories in the home directory which start with
-3. Thus, the shell does not know which one to fill in. When you hit
+`s`. Thus, the shell does not know which one to fill in. When you hit
tab again, the shell will list the possible choices.
Tab completion can also fill in the names of programs. For example,
less ~/boot-camps/shell/dictionary.txt
`less` opens the file, and lets you navigate through it. The commands
-are identical to the `man` program. Use "space" to go forward and hit
-the "b" key to go backwards. The "g" key goes to the beginning of the
-file and "G" goes to the end. Finally, hit "q" to quit.
+are identical to the `man` program.
+
+| "space" | to go forward |
+| "b" | to go backwarsd |
+| "g" | to go to the beginning |
+| "G" | to go to the end |
+| "q" | to quit |
`less` also gives you a way of searching through files. Just hit the
"/" key to begin a search. Enter the name of the word you would like
for the word "cat", `less` will not find it. You need to go to the
beginning of the file and search.
-Remember, the `man` program uses the same commands, so you can search
-documentation using "/" as well!
+Remember, the `man` program actually uses `less` internally and
+therefore uses the same commands, so you can search documentation
+using "/" as well!
* * * *
**Short Exercise**
* * * *
**Short Exercise**
-Use `>>`, to append the contents of all of the files which contain the
-number 4 in the directory:
+Use `>>`, to append the contents of all of the files whose names
+contain the number 4 in the directory:
/home/swc/boot-camps/shell/data/gerdal
to the existing `all_data` file. Thus, when you are done `all_data`
should contain all of the experiment data from Bert and any
-experimental data file from gerdal that contains the number 4.
+experimental data file from gerdal with filenames that contain the
+number 4.
* * * *
rm /tmp/all_data_backup
-The `mkdir` command is used to create a directory. Just enter `mkdir`
+The `mkdir` command is used to make a directory. Just enter `mkdir`
followed by a space, then the directory name.
* * * *
* * * *
**Short Exercise**
-Use the `man` command to find out how to sort the output from `wc` in
+1. Use the `man` command to find out how to sort the output from `wc` in
reverse order.
-* * * *
-
-* * * *
-**Short Exercise**
-
-Combine the `wc`, `sort`, `head` and `tail` commands so that only the
+2. Combine the `wc`, `sort`, `head` and `tail` commands so that only the
`wc` information for the largest file is listed
Hint: To print the smallest file, use: