Can I use cut() with -d '(' and -d ')'
arp -a | sed -n 's/.*(\(.*\)).*aa:bb:cc:dd:ee:ff.*/\1/p'
where aa:bb:cc:dd:ee:ff is your MAC address.Code:arp -a | sed -n 's/.*(\(.*\)).*aa:bb:cc:dd:ee:ff.*/\1/p'
The problem is that you may get a list of IP addresses but you won't know which one is the one you want to access without further checks. If you have the MAC address it's more straightforward if you use arp().nmap can also tell you the IP address (and much more, e.g. hostname) of any host that runs ssh, just use the proper scan type and options:
nmap -PS22 192.168.0.0/24
If you have managed switches you can even lookup on which port the host is connected by looking at the switch's tables.If you have the MAC address it's more straightforward if you use arp().
where aa:bb:cc:dd:ee:ff is your MAC address.Code:arp -a | sed -n 's/.*(\(.*\)).*aa:bb:cc:dd:ee:ff.*/\1/p'
.*(\(.*\)).*