function f-tutorial.2 () { clear bold cyan ; echo echo "In Which Indoctrination Continues..." white echo cat << EOI The first two tutorials ( zero and 1 ) were really just warm-ups. Let's start by going over what we've learnt so far, in summary. * A basic explanation of the way the file and directory system looks. * Navigating from one place to another within it, and knowing where we are. ( pwd, cd ) * Creating files and directories ( touch, mkdir ) * Seeing what files are there ( ls ) * One way to put text in a file, and read files ( cat ) * Moving files, and copying them. ( mv, cp ) * Removing files, and removing empty directories. ( rm, rmdir ) * Ending input, or exiting the shell ( CTRL+D, exit ) These are fundamental tools of the command line. We can do quite a lot using only these. Under the surface of the bare Bash command line, though, lurk literally thousands of possibilities. In fact, "bash" is a programming language in itself. (Strictly speaking, it is a "scripting" language.) Thus, Bash has at least two functions - interacting with the user to let the user issue commands, and glueing commands together into "scripts", which are programs in their own right. The code that runs "INX", including the menus and tutorials, is written in "bash". INX forms a kind of layer above the command line - it is an "easier" interactive layer that gives you a few choices, by implementing underlying commands. You had a glimpse of the files containing the INX-specific code when you ran EOI yellow echo "ls /usr/local/bin/" echo cyan echo "As before, hit to continue, < m > to return to the menu, < x > for a prompt." f-tutescape echo ; cyan echo "Some more control shortcuts." echo white echo "If you read \"Why INX?\" ( you did read it, didn't you?)," echo "you learnt at least two \"Help! Get me out of here!\" shortcuts - CTRL+D and CTRL+C" echo echo "There are other bash shortcuts that can make life easier. Here are some:" echo yellow echo "Shortcuts" white echo echo "CTRL+H : Erase the previous character." echo "CTRL+W : Erase the previous word." echo "CTRL+L : Clear the screen and place the prompt at the top." echo "ALT+F : Move forward one word." echo "ALT+B : Move back one word." echo "CTRL+F : Move forward one character." echo "CTRL+B : Move back one character." echo "CTRL+E : Move to the end of the current line." echo "CTRL+A : Move to the beginning of the current line." echo echo "There are quite a few others, but these are a useful set." echo "Read $HOME/shortcuts to review these and other helpful hints." echo cyan echo "Which brings us to our next topic..." f-tutescape echo ; cyan echo "Reading Useful things." echo white cat << EOU One thing that many do not know is that the system contains a lot of documentation. Some of it is rather technical, but knowing where to look is often helpful. The most common source is the manual... the command is "man". (Sadly, there is no "woman" command) To see the manual for a command, we simply type EOU echo yellow echo "man " white echo echo "I can hear the sound of hollow laughter, from those who have tried this, and come" echo "away more confused than enlightened... " echo echo "It is important to realise that \"man\" is more intended as a reference than a tutorial." echo echo "We introduce it here both to make you aware of it, and to demonstrate the use of the \"pager\"" cat << EOP The "pager" is a way around the limitations of "cat". It is used to read what is rather grandly termed "copious output" ;-) EOP cyan echo "What we now do is to see in action the reason that this exists..." f-tutescape echo ; cyan echo "Less is more." white echo echo "This was first said by the famous architect Ludwig Mies van der Rohe as a summary of his" echo "philosophy of architecture. You will see it applied by UNIX and Linux authors to pagers..." echo echo "First, let's see the \"why\" behind this." echo "I will now run the command" echo yellow echo "cat /usr/local/bin/f-tutorial.1" echo white echo "then exit back to this tutorial." echo cyan echo "Hit < space > to watch. Do not be alarmed by the result :-)" white echo unbold f-tutescape f-sup ; white ; unbold cat /usr/local/bin/f-tutorial.1 echo bold echo "Not very useful if you actually wanted to read the code... ;-)" echo "This time, I will run " echo yellow echo "less /usr/local/bin/f-tutorial.1" white echo echo "Use the spacebar to page down in the \"less\" pager, and hit < q > to quit" echo "Don't worry about what the code means ;-) " echo f-tutescape f-sup ; white ; unbold less /usr/local/bin/f-tutorial.1 echo bold echo echo "\"More\" was the pager that inspired \"less\". Use \"less\" - it is far more useful." echo f-tutescape cyan echo echo "Consulting the Man." white echo cat << EOM All that preamble was to familiarise you with the pager. The "man" command uses "less". This makes "man" easier than it otherwise might be. The "less" pager allows us to do a lot of useful tasks. For example, to search for text in the pager we can type EOM yellow echo echo "/searchterm" white echo echo "Try searching for \"information\" (without the quotes) in \"man intro\" " echo " I'll run man intro for you." echo echo echo "Remember, < q > to quit." f-tutescape f-sup ; white ; unbold man intro bold clear echo echo "That is just one of the many tricks of the \"less\" pager." echo echo "By the way, /usr/share/doc/howto does not exist on this system," echo "but there is a lot in /usr/share/doc . " echo echo "cd /usr/share/doc , then use ls to see. Within the directories you will" echo "quite often find files that look like \"some-name.gz\". You can read these" echo "with the program \"zless\" , which is a variant of \"less\" for compressed" echo "text files." echo echo "Of course, \"man less\" and \"man zless\" will tell you more... much more..." echo echo "Good habit to get into: to read a text file, type" yellow echo echo "less /path/to/file" echo white echo "Don't forget tab completion - if it beeps at you, hit tab again to see the options." echo cyan echo "That's it for tutorial 2. Tutorial 3 goes on to a few useful commands, including some" echo "shortcut commands that are only in INX, more for convenience than power." f-tutescape f-tutorial }