www.LinuxHowtos.org howtos, tips&tricks and tutorials for linux | |
from small one page howto to huge articles all in one place
poll results Last additions: using iotop to find disk usage hogs using iotop to find disk usage hogs words:887 views:200501 userrating:average rating: 1.7 (102 votes) (1=very good 6=terrible) May 25th. 2007: Words why adblockers are bad 486 Views253189 Workaround and fixes for the current Core Dump Handling vulnerability affected kernels Workaround and fixes for the current Core Dump Handling vulnerability affected kernels words:161 views:142298 userrating:average rating: 1.4 (42 votes) (1=very good 6=terrible) April, 26th. 2006: Words New subdomain: toolsntoys.linuxhowtos.org 38 Views102121 You are here: System Assign commands to keyA lot of programs (esspecially Bash) use the GNU Readline library for command line input. Readline allows to define each key with a custom value. This definition is stored in the file .inputrc in the users home directory. If you want to assign an often used command, e.g. less /var/log/message to the key F1, you'll need to add the following line to your .inputrc: "e[11~": "less /var/log/messages^M" The last char in e[11~ is a tilde char. All characters have to be entered exactly as given, with only one exception: the ^M at the end. The ^M means Enter and causes a direct execution of the command. Without the ^M, the command would be simply copied into the command line and which would wait for the input of enter or a different char. The way you enter the ^M depends on the editor you use. In vi you have to press ctrl-V and Enter. The character sequence e will be interpreted as an Escape char from Readline. The given sequence works in X11. In the console the sequence differs, but both definitions can be in the same .inputrc file. The change in .inputrc applies with a fresh started Shell. You can refresh the setting with the key sequence ctrl-X and ctrl-R in the running shell. F1 should work now. How to use the trick with other keys? First you have to know the code that the key generates. More details of the usage of readline can be found in the bash manpage (man bash). Translated from rate this article: current rating: average rating: 1.6 (16 votes) (1=very good 6=terrible) Your rating: back Support us on Content Nation |
|
- Powered by LeopardCMS - Running on Gentoo -
Copyright 2004-2020 Sascha Nitsch Unternehmensberatung GmbH
Valid XHTML1.1 : Valid CSS : buttonmaker
- Level Triple-A Conformance to Web Content Accessibility Guidelines 1.0 -
- Copyright and legal notices -
Time to create this page: 47.0 ms