This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#make sure you have xclip installed (E.g: sudo apt install xclip) | |
#Add the below lines to your ~/.bashrc (or something similar), don't forget to: source ~/.bashrc | |
#Inside your terminal you can now press ctrl+p to copy the ip of interface 'tun0' to your clipboard | |
#function to get the IP of the specified interface name and copy it to the x11 clipboard | |
copy_interface_ip() { | |
ip addr show $@ | grep inet -m1 | awk '{print $2}' | echo -n $(cut -d/ -f1) | xclip -selection c | |
} | |
#new bind (ctrl+p) to execute the copy_interface_ip function |