Prev | Current Page 185 | Next

Christopher Negus

"Linux Bible, 2008 Edition: Boot up to Ubuntu, Fedora, KNOPPIX, Debian, openSUSE, and 11 Other Distributions"


Another way to work with your history list is to use the fc command. Type fc followed by a history
line number, and that command line is opened in a text editor. Make the changes that you
want. When you exit the editor, the command runs. You can also give a range of line numbers (for
example, fc 100 105). All the commands open in your text editor, and then run one after the
other when you exit the editor.
The history list is stored in the .bash_history file in your home directory. Up to 1,000 history
commands are stored for you by default.
53
Running Commands from the Shell 2
Some people disable the history feature for the root user by setting the HISTFILE to
/dev/null or simply leaving HISTSIZE blank. This prevents information about the
root user??™s activities from potentially being exploited. If you are an administrative user with root
privileges, you may want to consider emptying your file upon exiting as well, for the same reasons.
Connecting and Expanding Commands
A truly powerful feature of the shell is the capability to redirect the input and output of commands
to and from other commands and files. To allow commands to be strung together, the shell uses
metacharacters. As noted earlier, a metacharacter is a typed character that has special meaning to
the shell for connecting commands or requesting expansion.


Pages:
173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197