Book-bot.com - read famous books online for free

Debian GNU/Linux : Guide to Installation and Usage by John Goerzen;Ossama Othman
page 68 of 298 (22%)
Command History and Editing the
Command Line

Whatever you type after the shell prompt and before pressing Enter is
called a command line. It's a line of text that commands the computer to
do something. The Debian default shell offers several features to make
entering command lines easy.

You can scroll up to previous commands to run them again, or you can
modify them slightly and then run them again. Try this: Enter any command,
such as whoami; then press the Up Arrow key. The whoami command will
reappear at the prompt. You can then press Enter to run whoami a second
time.

If you've entered several commands, you can keep pressing the Up Arrow key
to go back through them. This feature is handy if you're doing the same
thing several times, or if you type a command incorrectly and want to go
back to fix it. You can press the Down Arrow key to move in the other
direction, toward your more recent commands. If there are no more commands
to move to, the computer will beep.

You can also move around on the command line to make changes. The easiest
way is with the Left and Right Arrow keys. Try typing whoasmi instead of
whoami, and then use the Left Arrow key to move back to the s. You can
erase the s with the Backspace or Delete keys.

There are more advanced features as well (no need to memorize them all
now, though). Try pressing Ctrl-a. This moves you to the beginning of the
line. Ctrl-k (the k stands for ``kill'') deletes all characters until the
end of the line; try it from the middle of the command line. Using Ctrl-a
DigitalOcean Referral Badge