E-Mail:

Word Completion

Word Completion

If you’ve been following along the past week or so, you’ve seen that Linux commands can add up to a lot of typing.
What with all the options available for each command, life in the console window could easily be a quick trip up
carpal tunnel lane.

Linux provides a way to circumvent that wrist and finger irritation in the form of word completion. In short, Linux
is capable of finishing what you start when typing a command in a console screen. The secret to word completion in
Linux is a concept called “minimal completion.” In other words, you need only type enough of a command or file name
to distinguish it from other files in a directory. The magic key to word completion? The tab key. Here’s an
example.

    You type:    /usr/lo [tab]
    You get:      /usr/local/

    You type:    /home/t [tab]
    You get:      /home/tony/

Once the shell works its word completion hoodoo, all you need to do is press enter to move to the directory or
execute the command.

Another interesting feature of word completion in the bash shell is the ability to list all files with a
spelling similar to what you’ve typed. Again, the magic lies in the tab key. For this list, simply press the tab key
twice. Here’s an example:

    You type:    /usr/l [tab] [tab]
    You get:      lib    local

Tabbing twice lists all the subdirectories of /usr that begin with the letter l.

See? Linux can even save you from repetetive stress disorder.

What Do You Think?

 

Want to Start a Blog Here for Free?

Are you an expert in one subject or another? If your goal is to help others and dispense hard-earned information back to the community, stake a claim on your very own Lockergnome blog today! You can write about anything - no matter the topic. Sign-up to start blogging!

64 queries / 4.911 seconds.