Red Hat NETSCAPE MANAGEMENT SYSTEM 6.0 - CUSTOMIZATION User Manual Page 271

  • Download
  • Add to my manuals
  • Print
  • Page
    / 300
  • Table of contents
  • BOOKMARKS
  • Rated. / 5. Based on customer reviews
Page view 270
17.3 Command History and Tab Completion 259
Voila!Wenowseethecontentsofsneakers.txt.
The bash shell can store up to 1,000 commands.
Tip: By typing the env command at a shell prompt, we can see the environment
variable that controls the size of the command-line history. The line which reads, HIST-
SIZE=1000 tells us that bash will store 1,000 commands in its history.
The command-line history is actually kept in a le, called .bash
history in our login directory. We
canreaditinanumberofways:byusingpico, cat, less, more, and others.
Be prepared, though: the le can be pretty long.
Letsreaditwithmore:
more .bash_history
To move forward a screen, press
Space ; to move back a screen, press B ;toquit,press Q .
Another time-saving tool is known as tab completion. If you type part of a le or pathname then hit
the
Tab key, bash will present you with either the remaining portion of a the le/path, or a beep. If
we get a beep, we can press
Tab again to obtain a list of the les/paths that match what weve typed
so far.
So even if we do turn off the machine at the end of the day, we probably wont have to work too
hard in order to remember the command to update locates database: The chances are good that the
command will be stored in the command-line history or can be completed with tab completion (as
long as we remember the start of the pathname for the command).
Both tab completion and command-line history can be useful to help you use a command youve
forgotten, as well.
Lets try tab completion to update locates database. First, su to root.
Now, at a shell prompt, type the beginning of the path:
/etc/cr
Now, press the
Tab key and tab completion will complete the path to /etc/cron (and youll hear
a beep). Press
Tab again, and youll be presented with a list of possible completions:
cron.daily cron.hourly cron.monthly cron.weekly crontab
Page view 270
1 2 ... 266 267 268 269 270 271 272 273 274 275 276 ... 299 300

Comments to this Manuals

No comments