looking for two gui accessible applications
Linux for blind general discussion
blinux-list at redhat.com
Sun Nov 28 01:02:31 UTC 2021
The two main places where tab completion comes into play are in not
having to type full names of commands with long names and making
specifying local files and directories as arguments to commands
quicker and less error prone.
For example, on my system, I have a directory of custom-made scripts
I've added to my path(the list of directories the cli searches for
executables matching the command provided). One of these scripts is
titled uncompress.sh and automates extracting all the .zip and .rar
files in the working directory to their own directory(so I don't end
up with files vomited all over my working directory if the zip/rar
lacks a single top level directory to contain everything else.
Instead of typing uncompress.sh manually, I
type unc (i need three litters because their are other commands
begining with un).
press tab to get uncompress(a standard alias of gunzip, the extract
for gzip archives that is standard on most Linux(and probably other
Unix-like systems) systems).
type a dott and press tab again to get the sh.
Another example is that I have rename.ul for batch renaming files, and
while there are other commands on my system starting with ren, I only
need to type rena and then tab to get the full command name...
Admittedly, completing command names can be of limited use with how
many of the most command commands are single, short words or
abbreviated down to just two or three letters(e.g. the standard file
management commands such as ls to list, rm to remove/delete, mv to
move, cp to copy, du for disc usage, wc for word count, cd to change
directory, mkdir to make directories and rmdir to remove
directories(granted, those last two are five letters each, but style,
very short command).
Where tab completion really shines is in providing a quick, error
resistent, means of not having to type out filenames and directories
in their intirety when providing them as command line arguments.
For example, say you have the following in your home directory:
Except for the Ds, to change to any of those directories, you just
need to type cd, the first letter of the directory name, tab, and prss
enter, and at worse, you just need to type cd dow or cd doc before
doing a tab enter.
Or lets say the current directory contains somthing like:
and you want to open a specific chapter in the nano text editor. You
can type nano, a space, tab to get Chapter\ the number of the chapter
you want, then tab again for the .txt... and the tab completion
automatically adds the backslashes for spaces and any other characters
in the filename that need to be escaped.
And the keystroke savings can really stack up...
if you had a folder with files like:
absurdly ridiculous ludicrously long filename.extension
bafflingly ridiculous ludicrously long filename.extension
confusingly ridiculous ludicrously long filename.extension
ludicrously absurdly ridiculous ludicrously long filename.extension
ridiculous absurdly ludicrously long filename.extension
for each, you'd just need to type the first letter and tab to get the
rest, and all the backslashes would be added as needed.
Or lets say you have a directory structure like:
As long as no two items in the same subdirectory start with the same
letter, you could do something like type cd D tab C tab B tab A tab to
ANd if there is any point in that path where there's only one item at
a given level, you don't even need to type anything before tabbing
again(though, tab completion always pauses at a slash, but if you had
a very deep, unbranched directory tree, you could just hold tab to get
all the way to the bottom.
I'm long past the point where using tab completion is second nature,
but I hope these examples of how it works are helpful in understanding
how to use it.
But in general, it's most useful when either:
A. Every file/directory in a directory starts with a different letter.
B. Everything in a directory has the same beginning and the first
deviation is something like a number.
but even when the contents of a directory are more random, much of the
time, by the time you type the first word worth of unique characters,
a tab will take you, if not to the end, then two the point of entering
a number because there are files whose name differ only in a number or
an extension because you have files with names that are identical
excapt for the extension.
More information about the Blinux-list