{"id":154,"date":"2017-03-04T20:35:24","date_gmt":"2017-03-04T20:35:24","guid":{"rendered":"https:\/\/thinkdebian.net\/blog\/?p=154"},"modified":"2017-11-26T12:07:27","modified_gmt":"2017-11-26T12:07:27","slug":"enable-arrow-keys-support-in-nslookup","status":"publish","type":"post","link":"https:\/\/thinkdebian.net\/blog\/enable-arrow-keys-support-in-nslookup\/","title":{"rendered":"enable arrow keys support in nslookup"},"content":{"rendered":"<p>I use nslookup daily, and I find the fact that I can&#8217;t access previous commands or the command history inside nslookup command prompt frustrating to say the least.  Looking for a solution, I stumbled across an apple.stackexchange.com <a href=\"http:\/\/apple.stackexchange.com\/questions\/69612\/how-can-i-make-the-up-arrow-work-in-terminals-nslookup-command\">question and answer<\/a> and solved the annoyance.<\/p>\n<p>In Debian, do the following (as root, or with sudo):<\/p>\n<pre lang=\"bash\">\r\napt-get install rlwrap\r\n<\/pre>\n<p>This will install the rlwrap utility, to enable readline support to apps that don&#8217;t support it natively.<\/p>\n<p>Afterwards, run nslookup through rlwrap:<\/p>\n<pre lang=\"bash\">\r\nrlwrap nslookup\r\n<\/pre>\n<p>Now arrow keys, reverse history (Ctrl+r) work nicely, which saves a lot of keystrokes and copy\/paste \ud83d\ude42<\/p>\n<pre lang=\"bash\">\r\napt-cache search ^rlwrap$\r\nrlwrap - readline feature command line wrapper\r\n<\/pre>\n<p>To avoid wasting keystrokes, you can create an alias in your shell login file.  I added the following line to my ~\/.bashrc:<\/p>\n<pre lang=\"bash\">\r\nalias nslookup='rlwrap nslookup'\r\n<\/pre>\n<p>Exit the shell and login again or simply do the following to have the change effective in the current shell (applies to bash shell):<\/p>\n<pre lang=\"bash\">\r\nsource ~\/.bashrc\r\n<\/pre>\n<p>or<\/p>\n<pre lang=\"bash\">\r\n. ~\/.bashrc\r\n<\/pre>\n<p>Credit goes to user <a href=\"http:\/\/apple.stackexchange.com\/users\/33046\/alan-shutko\">alan-shutko<\/a> on   <a href=\"http:\/\/apple.stackexchange.com\">apple.stackexchange.com<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>I use nslookup daily, and I find the fact that I can&#8217;t access previous commands or the command history inside nslookup command prompt frustrating to say the least. Looking for a solution, I stumbled across an apple.stackexchange.com question and answer and solved the annoyance. In Debian, do the following (as root, or with sudo): apt-get &#8230; <a title=\"enable arrow keys support in nslookup\" class=\"read-more\" href=\"https:\/\/thinkdebian.net\/blog\/enable-arrow-keys-support-in-nslookup\/\" aria-label=\"More on enable arrow keys support in nslookup\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2,4],"tags":[],"_links":{"self":[{"href":"https:\/\/thinkdebian.net\/blog\/wp-json\/wp\/v2\/posts\/154"}],"collection":[{"href":"https:\/\/thinkdebian.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thinkdebian.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thinkdebian.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thinkdebian.net\/blog\/wp-json\/wp\/v2\/comments?post=154"}],"version-history":[{"count":9,"href":"https:\/\/thinkdebian.net\/blog\/wp-json\/wp\/v2\/posts\/154\/revisions"}],"predecessor-version":[{"id":158,"href":"https:\/\/thinkdebian.net\/blog\/wp-json\/wp\/v2\/posts\/154\/revisions\/158"}],"wp:attachment":[{"href":"https:\/\/thinkdebian.net\/blog\/wp-json\/wp\/v2\/media?parent=154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thinkdebian.net\/blog\/wp-json\/wp\/v2\/categories?post=154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thinkdebian.net\/blog\/wp-json\/wp\/v2\/tags?post=154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}