Results 1 to 8 of 8
Dear all,
Can some one help me how can i get full command as and when a partially finish typing in Linux Command prompt.
or is there a way i ...
- 05-17-2010 #1Just Joined!
- Join Date
- May 2010
- Posts
- 4
How to AutoFill Commands
Dear all,
Can some one help me how can i get full command as and when a partially finish typing in Linux Command prompt.
or is there a way i can get the command from history of commands executed automatically when i type instead of opening history and looking for the command??
- 05-17-2010 #2Linux User
- Join Date
- Nov 2009
- Location
- France
- Posts
- 292
Unless I misunderstood your wording, you can type the first characters of the command and press 'TAB' to complete the command or to be presented available commands beginning with the typed characters.
The 'history' command just shows all recorded commands within the $HISTSIZE limit, or the number of latest commands you specify. You can't automatically run a command, as far as I know, you have to validate by pressing 'return'.
You can also press 'CTRL+R' and start typing to get the latest command recorded in .bash_history starting with the typed characters.0 + 1 = 1 != 2 <> 3 != 4 ...
Until the camel can pass though the eye of the needle.
- 05-18-2010 #3Just Joined!
- Join Date
- Aug 2004
- Posts
- 4
History auto complete
Edit the file /etc/inputrc and uncomment the lines for history auto complete
or add
"\e[5~": history-search-backward
"\e[6~": history-search-forward
to .inputrc in home or to /etc/inputrc
- 05-18-2010 #4Linux Newbie
- Join Date
- Oct 2008
- Posts
- 140
Tab completion is your friend not just for commands , but also for filepaths. This is especially useful for lengthy filepaths.
The history command is more useful if you pipe it through grep. For instance, this
[kurt@Jupiter ~]$history | grep mkdir
will tell you the history for that command alone. Useful if you have forgotten where you made some directory that you can't think of the name of.
- 05-18-2010 #5Linux Newbie
- Join Date
- Jan 2008
- Location
- Canada
- Posts
- 109
Hi
One can type the '!' and the first letters [!mk] for mkdir (unique letters if possible) of the command in history. If there are more than one in history it will run the one last used in the history and then you can extend to make it unique.
Example:
$ find . -name junk
$ file *
$ find . -name list
<------->
$ !fi
The above will rerun the last find <find . -name list>
<------->
$ !fil
The above will run the <file *> command. Generally one knows part of the function or application which you want to repeat.
I use the above when compiling source code as it is always the <make> command like $ <!mak> wil invoke the last compile command.
One can also use the '!' with a particular history number such as !120 to run the command which is at line 120 in history. I assume you are using the Bash Shell for the above but these usually work in most Shells (C, Korn, etc).
Cheers..
Robert
- 05-18-2010 #6Just Joined!
- Join Date
- Mar 2010
- Posts
- 3
I found this I hope this helps
15 Examples To Master Linux Command Line HistoryLast edited by Cabhan; 05-18-2010 at 03:56 AM. Reason: Replaced huge amount of text with a link.
- 05-18-2010 #7Linux Newbie
- Join Date
- Jan 2008
- Location
- Canada
- Posts
- 109
- 05-18-2010 #8Just Joined!
- Join Date
- May 2010
- Posts
- 4
Thanks Buddies
thanks guys for your comments, it worked out...


Reply With Quote
