Linux Ask!

Linux Ask! is a Q & A web site specific for Linux related questions. Questions are collected, answered and audited by experienced Linux users.

Linux Ask!

Jan 262012
 

Install bash completion for Mac OSX

Answer:

Bash completion (bash-complete) is a tool that allow you to auto complete commands and their arguments easily using the "tab" keys.

Firstly, make sure you have installed Homebrew, then

# brew install git bash-completion

And add the following lines in your ~/.bash_profile

if [ -f `brew --prefix`/etc/bash_completion ]; then
    . `brew --prefix`/etc/bash_completion
fi

Restart your terminal and now you can see the effect of bash complete by tabbing..

Jan 172012
 

How to perform a reverse DNS lookup in Linux

Answer:

To perform a reverse DNS lookup for a domain in Linux, you can use the dig command, e.g.

# dig -x 8.8.8.8

; <<>> DiG 9.7.0-P1 <<>> -x 8.8.8.8
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 59808
;; flags: qr rd ra; QUERY: 1, ANSWER: 1, AUTHORITY: 0, ADDITIONAL: 0

;; QUESTION SECTION:
;8.8.8.8.in-addr.arpa.          IN      PTR

;; ANSWER SECTION:
8.8.8.8.in-addr.arpa.   86328   IN      PTR     google-public-dns-a.google.com.

..