[PLUG] remembering often-used commands

Rogan Creswick creswick at gmail.com
Mon Mar 20 03:35:33 UTC 2006


On 3/18/06, John Jason Jordan <johnxj at comcast.net> wrote:
> But your points above are very good. Nevertheless, I think a simple bookmark-like
> click-and-select feature would be useful. If the command needs to be run in a specific folder,
>then the user can type the whole path before saving it. I don't see
why such a feature has to
> handle everything that a script could do. Its purpose is just to pop in one command.
>Consider it like a super-tab feature. Maybe it could just be a plugin
or extension for
>gnome-terminal.

You could use aliases for some of this.  Take the command you want to
use later, copy it verbatim, then make a line like this in your
.bashrc file (at the end, to be safe )

    alias chrootResolv="sudo ln -f /chroot/breezy/32bits/resolv.conf
/etc/resolv.conf"

(where chrootResolv is the name of your "new" command)
load the new .bashrc with

    source ~/.bashrc

(or open a new terminal)
and run chrootResolv to build your link...

You can also use the .bash_history file for a lot of what you want. 
Dan Haskell already mentioned using ctrl-r (which I *strongly*
recommend also -- you can just keep hitting ctrl-r to get to what you
want, at which point hit enter to run it, or use the arrow keys to
move the cursor and make modifications).  There are other tricks also,
though:  command history (up/down keys scroll through recent
commands), and you can grep the .bash_history file directly, if you
want (or cat, tail, less, etc...)

At one point I put it in cvs, and added the ci/update commands to my
.bash_login / logout files, but that became problematic..

>
> By the way, I just tried doing the above link command using tab. It took six tabs to get it
> all, and after each tab I had to type more letters to get tab to go to the next stop. It would
> have been faster just to type it and forget about tabs. The problem with tab is that you try
> it, it doesn't work, and you have to type some more, back and forth, back and forth. I'm
> not saying it's useless, just that it sometimes isn't much help.
>

If you hit tab twice (eg: /etc/ <tab><tab> ) you get a list of all the
possible completions, from which you can narrow the search.


--Rogan

> _______________________________________________
> PLUG mailing list
> PLUG at lists.pdxlinux.org
> http://lists.pdxlinux.org/mailman/listinfo/plug
>



More information about the PLUG mailing list