Use the last command\’s output as input to a command without piping and bind to it to a key sequence in bash.

2010-09-01 181 words 1 min read

Use the last command’s output as input to a command without piping and
bind to it to a key sequence in <a class="zem_slink" title="Bash (Unix shell)" rel="homepage" href="">bash.

    <div class="bash codecolorer">
      &nbsp;<span class="kw3">bind</span> <span class="co3">\'</span><span class="st0">"\\C-h"</span>: <span class="st0">"\\<span class="es5">`fc\\ \\-s\\`</span>"</span><span class="co3">\'</span>

My comment : fc is the fix command of the bash builtin.
This is similar to using `!!` or

In bash 4.1 it seems you can bind directly to a shell command, but I&#8217;m
not running that version.

  • View this command to comment, vote or add to favourites
  • View all commands by rthemocap

by David Winterbottom (

<a class="zem_slink" title="Uniform Resource Locator" rel="wikipedia" href="">URL:
<a href=""><h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta <ul class="zemanta-article-ul"> <li class="zemanta-article-ul-li"><a href="">Google Translate | ( <li class="zemanta-article-ul-li"><a href="">Git Bash Prompt ( <li class="zemanta-article-ul-li"><a href="">Writing Better Shell Scripts – Part 1 | Innovations Technology Solutions | Blog ( <li class="zemanta-article-ul-li"><a href="">The Tar Pipe ( <div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href=""><img class="zemanta-pixie-img" style="border: medium none; float: right;" src="" alt="Enhanced by Zemanta" /><span class="zem-script more-related pretty-attribution">


Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it