{"id":328,"date":"2009-02-15T12:06:29","date_gmt":"2009-02-15T09:06:29","guid":{"rendered":"http:\/\/www.void.gr\/kargig\/blog\/?p=328"},"modified":"2009-02-15T12:09:11","modified_gmt":"2009-02-15T09:09:11","slug":"a-small-tip-for-more-efficient-command-line-usage-on-debian","status":"publish","type":"post","link":"https:\/\/www.void.gr\/kargig\/blog\/2009\/02\/15\/a-small-tip-for-more-efficient-command-line-usage-on-debian\/","title":{"rendered":"a small tip for more efficient command line usage on debian"},"content":{"rendered":"<p>Debian is one of the few distros that you can&#8217;t search the bash history backward or forward for past commands by default.<br \/>\nTo change that behaviour you need to uncomment two lines inside \/etc\/inputrc.<\/p>\n<p>Change:<br \/>\n<code><br \/>\n# alternate mappings for \"page up\" and \"page down\" to search the history<br \/>\n# \"\\e[5~\": history-search-backward<br \/>\n# \"\\e[6~\": history-search-forward<br \/>\n<\/code><br \/>\nTo:<br \/>\n<code><br \/>\n# alternate mappings for \"page up\" and \"page down\" to search the history<br \/>\n \"\\e[5~\": history-search-backward<br \/>\n \"\\e[6~\": history-search-forward<br \/>\n<\/code><\/p>\n<p>Example usage:<br \/>\nTo search through your old commands that started with &#8220;ssh&#8221; (e.g. ssh -p 551 koko@lala.gr, ssh foo@bar.gr, ssh test@koko.gr -L1111:1.2.3.4:9876), just type ssh and hit PgUp, you will see the previous ssh commands appearing on the command line.<br \/>\n<code>$ ssh[PgUp]<\/code> transforms to <code>$ ssh -p 551 koko@lala.gr<\/code> hit PgUp again and it transforms to<br \/>\n<code>$ ssh foo@bar.gr<\/code> PgUp and it becomes <code>$ ssh test@koko.gr -L1111:1.2.3.4:9876<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Debian is one of the few distros that you can&#8217;t search the bash history backward or forward for past commands by default. To change that behaviour you need to uncomment two lines inside \/etc\/inputrc. Change: # alternate mappings for &#8220;page up&#8221; and &#8220;page down&#8221; to search the history # &#8220;\\e[5~&#8221;: history-search-backward # &#8220;\\e[6~&#8221;: history-search-forward To: [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"ep_exclude_from_search":false,"footnotes":""},"categories":[3],"tags":[],"class_list":["post-328","post","type-post","status-publish","format-standard","hentry","category-linux"],"aioseo_notices":[],"views":9666,"_links":{"self":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/328","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/comments?post=328"}],"version-history":[{"count":0,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/328\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/media?parent=328"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/categories?post=328"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/tags?post=328"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}