Miki

  • Archive
  • RSS

Bind a key to a command in Bash

You can bind, for example, the command ls -l to CTRL+l using:

bind -x '"\C-l":"ls -l\n"'

It may be useful to append this line in your .bashrc.

Now, every time you press CTRL+l, even in the middle of another command, a directory listing will appear! :)

    • #bash
    • #command line
    • #tricks
  • 1 year ago
  • Permalink
  • Share
    Tweet

About

Michele Spagnuolo.
IT Engineer, coder, dreamer.

Twitter

loading tweets…

Following

  • RSS
  • Random
  • Archive
  • Mobile

Effector Theme by Carlo Franco.

Powered by Tumblr