I tend to use sudo arp-scan --localnet --interface wlan0
a lot, but I find it cumbersome to type this each time. To speed things up, I've created a script, called arp-lw-scan
, which should do this for me.
Contents of ~/Scripts/arp-lw-scan
:
#!/bin/bash
arp-scan --localnet --interface wlan0
I've added ~/Scripts
to my $PATH
in ~/.profile
, so each script in that folder can get executed from any location by just typing its name in the terminal.
However, I'm having trouble executing arp-lw-scan
in an easy way, because it requires root access. Just typing arp-lw-scan
while being in my home directory gives an error about not having root rights. I can type sudo ~/Scripts/arp-lw-scan
, and that works, but that's still pretty much to type. I want to be able to just type sudo arp-lw-scan
to execute the given script.
How can I achieve this?
sudo
in the single lined script there?~/bin
directory instead of~/Scripts
, it would've been added to PATH automatically, no need to modify~.profile