Linux Classes
Linux Classes
Share This With a Friend
LINUX CLASSES - LINUX BASICS

Can I Recall Previous Commands?

Command History and Editing

Bash remembers what commands you've recently entered so that you can recall and issue them again easily. If you press the up-arrow key, bash places the contents of the previous command on the command line. Repeatedly pressing the up or down arrow naviga tes through the command history; you can even modify the text in the recalled commands with the left and right arrows, as well as the insert and delete keys, before pressing enter to issue the recalled command. Command Completion: Linux Can Even Read Your Mind

If you're a lazy typist, you'll love this feature. Let's say you have a directory containing the following files:

cars-are-fun
cats-are-bad

dogs-are-good
birds-have-lips

Typing rm cat and then pressing the tab key magically expands your command line to

rm cats-are-bad

matching a file in your current directory that starts with the word cat. The shell looks at what you've typed so far and then checks to see if there is a single file that starts with those characters. If there is, the shell finishes typing that file name for you. If there isn't such a file, nothing happens. If multiple files match, a beep will sound. You can then press tab twice to see all the matches, or just keep typing the filename.

You still have to press enter, but if you remember this nifty feature, you can save a lot of keystrokes and pretend that the computer is actually reading your mind!

Previous Lesson: Wildcards
Next Lesson: Aliases

[ RETURN TO INDEX ]



Comments - most recent first
(Please feel free to answer questions posted by others!)

sekhar (01 Jan 2013, 07:04)
I want window 7 video tutorial cd
sadrul (07 Oct 2012, 23:42)
How do I display the command history without the leading numbers.
Sunny (19 Nov 2011, 04:29)
I have learnt many knowledgeable things from your notes.
VKM (09 Jan 2011, 13:19)
And too, command history saves in /root/.bash_history
This is common text file.
Suresh Kumar (07 Jul 2010, 08:23)
Its really good to know about linux...

I welcome your comments. However... I am puzzled by many people who say "Please send me the Linux tutorial." This website *is* your Linux Tutorial! Read everything here, learn all you can, ask questions if you like. But don't ask me to send what you already have. :-)

NO SPAM! If you post garbage, it will be deleted, and you will be banned.
*Name:
Email:
Notify me about new comments on this page
Hide my email
*Text:




Copyright © by - Privacy Policy
All rights reserved - Redistribution is allowed only with permission.

Popular Linux Topics

Linux Intro
Linux Files
Linux Commands
Change Password
Copy Files
Linux Shell Basics

Linux Tutorial

Who is Doctor Bob?
What is Linux?
History of Unix
Operating Systems
What's Next?

Linux Basics

Living in a Shell
Root and Other Users
Virtual Consoles
Logoff and Shutdown
Choosing a Shell
The Command Prompt
Wildcards
Command History
Aliases
Redirection
Pipelines
Processes
Stopping a Program
Environment Variables
Help!

Linux Files

The Linux File System
Linux File Names
Linux Directories
Directory Terminology
Navigating the File System
Listing Linux Files
Displaying Linux Files
Copying and Renaming Files
Creating Files and Directories
Deleting Files and Directories
Linux Files - Wildcards
The Nine Deadly Keystrokes
Linux File Permissions
Changing File Permissions

Linux Commands

Important Linux Commands
Changing Your Password
Switching Users
Who is Logged In?
Date and Time
The Echo Command
Spell Checking
Printing Linux Files
Joining Files
Searching for Files
Comparing Files
Task Scheduling
Linking Files

Linux Editors

The Vi Editor
The Emacs Editor
The Pico Editor

Linux Data Manipulation

Slicing & Dicing
Heads or Tails?
Sorting Data
Eliminating Duplicates
Selecting Columns
Selecting Records
Search & Replace
Crunching Data
Finding Files
Pipe Fitting

Linux Shell Programming

Linux Shell Scripts
Executing a Script
Shell Script Variables
Shell Script Logic
Shell Script Looping
Shell Script Debugging

Perl Programming

Perl Basics
Perl Variables
Perl Arguments
Perl Logic
Perl Looping
Perl and Files
Perl Pattern Matching

Linux and Email

Sending Email
Reading Email
Other Mail Commands
Using Pine for Email
The Pine Inbox
Pine Email Basics
Pine Email Folders
Pine for Power Users

Compression and Encoding

Linux File Compression
Archiving With Tar
Compression With Gzip
Compress and Zcat
Zmore and Zless
Zip and Unzip
Encoding and Decoding
Encryption

Linux Does DOS

Accesing DOS Files
Accesing DOS Partitions
Running DOS Programs

Managing Linux

Updating Your Linux System
Installing Packages with RPM
Uninstalling Packages w/ RPM
Upgrading Packages with RPM
Querying Packages with RPM

AltStyle によって変換されたページ (->オリジナル) /