LINUX.IE, website of the Irish Linux Users' Group
Tux rules!

   
Home
New Users
Articles
Download
Projects
Community
Vendors

  Print Version
 
Archives:


planetILUG

Recent News

News Archive


Join the
ILUG
on FaceBook


Join the
ILUG
on LinkedIn


Join the
ILUG SETI
Group



















 
 :: Mailing Lists

[ILUG] Shell tip: bang commands...

[ILUG] Shell tip: bang commands...

Sarah Fortune fortunes at tcd.ie
Sun May 14 02:48:08 IST 2006


kevin lyda <kevin at ie.suberic.net> quoth:
> Most modern shells support csh's bang commands - bash, tcsh and zsh
> all do.  While some bang commands don't work in all those shells, all
> of the following do.  The plus side to using them is that no matter what
> shell you're using, these shortcuts will work.
> 
> For the purposes of these tips, every tip will assume these are the last
> three commands you ran:
> 
>     % which firefox
>     % make
>     % ./foo -f foo.conf
>     % vi foo.c bar.c
> 
> Getting stuff from the last command:
> 
>     Full line:     % !!            becomes:   % vi foo.c bar.c
>     Last arg :     % svn ci !$     becomes:   % svn ci bar.c

In bash you can use Alt-. to fill in the last argument, it's nicer than !$
because you can see what it is before running the command.

Sarah



More information about the ILUG mailing list
Read this without the formatting.
                                                                                                    

 

Hosted by HEAnet


Maintained by the ILUG website team. The aim of Linux.ie is to support and help commercial and private users of Linux in Ireland. You can display ILUG news in your own webpages, read backend information to find out how. Networking services kindly provided by HEAnet, server kindly donated by Dell. Linux is a trademark of Linus Torvalds, used with permission. No penguins were harmed in the production or maintenance of this highly praised website. Looking for the Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!
RSS Version
Powered by Dell