I am thinking about making a script that combines this tutorial's information with somehow grabbing automatically the gateway of the router. For that I'll have to study more about variables, though.
@XW0RKS: That is a good question. I've looked in the past and I have not been able to find a command that will find host names. Sorry. I'm sure it can be done, I just don't know how. When I need host names from my network I use Etherape, which is a GUI program, so it doesn't help us much here.
& means to not wait for this command to finish before running the next command (Basically it will speed things up. It will start ping all the ip's without waiting for a response for each one. )
>/dev/null just prevents the output of 'ping' from displaying on the screen.
@metalx1000 Thanks for your response. I also got your "Secure FTP with sftp and ssh" link. Very helpful. I tried ssh from my laptop (ubuntu 10.10) to my PC (ubuntu 10.10 partition) with no problem. I wanted to test it on a different OS. From my ubuntu laptop to my PC (windows 7 partition) I couldn't connect. Is it at all possible?
@Cryptoxicon: ssh is available on most OSes (Linux, Mac, BSD, etc...) But once again Windows Fails at being useful out of the box. I know you can use Putty as a ssh client on Windows, but I've never setup a ssh server on Windows. I know it's possible, but I think it talks a number of steps. If you just need file transfer, ftp would be a good option or SAMBA which allows you to access shared folders on a Windwos Machine.
@russjr08: Good Question. I'm sure there is a command for it. But I don't know what it is. Etherape will show you the hostname of computers. I'll look around and see if I can find an answer
@Tarnus88: My guess it that when I tried to ctrl+c it was kill that instance in the loop. So, if it still had 225 computers to ping I would have had to ctrl+c 225 more times. That's just a guess, but I would bet that's it.
@metalx1000 Hm, is there a way to get around that? Somehow build in something that checks if a certain button(q for example) was pressed and exits the loop after that?
@Tarnus88: could probably through the loop into the background with a '&' and then set you script to wait for user input. And on certain input kill the script. I'll play with it some tomorrow.
done. first line:
for i in $(netstat --route |grep default |awk '{print $2}' |cut -d\. -f1,2,3).{1..254}
vbarros92 2 months ago
Thanks a lot for this tutorial!
I am thinking about making a script that combines this tutorial's information with somehow grabbing automatically the gateway of the router. For that I'll have to study more about variables, though.
vbarros92 2 months ago
This has been flagged as spam show
@vbarros92 or just go for "for i in 192.168.{0 .. 10}.{1..254}". =)
vbarros92 2 months ago
@metalx1000 @XW0RKS
"nslookup" shows host names.
##
for i in 192.168.1.{1..254}; do nslookup $i; done | grep name
##
Karmaklaert 7 months ago
@Karmaklaert: I'll give that a try, but I didn't think that would work for computers on the local network.
metalx1000 7 months ago
what do you add to script so it can also display a host names of witch ips it founds ??? (i hope the question is put out the right way)
XW0RKS 8 months ago
@XW0RKS: That is a good question. I've looked in the past and I have not been able to find a command that will find host names. Sorry. I'm sure it can be done, I just don't know how. When I need host names from my network I use Etherape, which is a GUI program, so it doesn't help us much here.
metalx1000 8 months ago
Comment removed
Karmaklaert 7 months ago
Comment removed
Karmaklaert 7 months ago
Comment removed
Karmaklaert 7 months ago
for some reason this is the output I get
"root@bt:~# for i in 192.168.1.{1..254} ;do if ping -c1 -w1 $i &>/dev/null;then echo $i is up;else $i is down;fi;done
bash: 192.168.1.1: command not found
bash: 192.168.1.2: command not found
bash: 192.168.1.3: command not found
^Z
[7]+ Stopped ping -c1 -w1 $i >&/dev/null
"
orochinagi1111 1 year ago
@orochinagi1111: you for got the 'echo'
you wrote:
for i in 192.168.1.{1..254} ;do if ping -c1 -w1 $i &>/dev/null;then echo $i is up;else $i is down;fi;done
you should have wrote:
for i in 192.168.1.{1..254} ;do if ping -c1 -w1 $i &>/dev/null;then echo $i is up;else echo $i is down;fi;done
metalx1000 1 year ago
@metalx1000 thank you!!!!
orochinagi1111 1 year ago
could you please elaborate more on "ping -c1 -w1 $i &>/dev/null"
More specifically on -c1 and -w1 what are those?
I am guessing you are inputting in a place '/dev/null' with '>' symbol? what is '&' for?
Cryptoxicon 1 year ago
@Cryptoxicon: sure,
-c1 means ping only once.
-w1 means only wait 1 second for a reply
& means to not wait for this command to finish before running the next command (Basically it will speed things up. It will start ping all the ip's without waiting for a response for each one. )
>/dev/null just prevents the output of 'ping' from displaying on the screen.
metalx1000 1 year ago
@metalx1000 Thanks for your response. I also got your "Secure FTP with sftp and ssh" link. Very helpful. I tried ssh from my laptop (ubuntu 10.10) to my PC (ubuntu 10.10 partition) with no problem. I wanted to test it on a different OS. From my ubuntu laptop to my PC (windows 7 partition) I couldn't connect. Is it at all possible?
Cryptoxicon 1 year ago
@Cryptoxicon: ssh is available on most OSes (Linux, Mac, BSD, etc...) But once again Windows Fails at being useful out of the box. I know you can use Putty as a ssh client on Windows, but I've never setup a ssh server on Windows. I know it's possible, but I think it talks a number of steps. If you just need file transfer, ftp would be a good option or SAMBA which allows you to access shared folders on a Windwos Machine.
metalx1000 1 year ago
@metalx1000 Thanks, I'll research some more on that.
Cryptoxicon 1 year ago
@metalx1000 I've heard, OPENSSH is good on windows,
X3MVAN 1 year ago
This has been flagged as spam show
Trusted name on Latino women marriage service *rockmycity.info*
UidenajPjdjk 1 year ago
Is there a way to find out the hostnames?
russjr08 1 year ago
@russjr08: Good Question. I'm sure there is a command for it. But I don't know what it is. Etherape will show you the hostname of computers. I'll look around and see if I can find an answer
metalx1000 1 year ago
@metalx1000 Thanks!
russjr08 1 year ago
Interesting. Did you find out why you couldn't kill the process?
Tarnus88 1 year ago
@Tarnus88: My guess it that when I tried to ctrl+c it was kill that instance in the loop. So, if it still had 225 computers to ping I would have had to ctrl+c 225 more times. That's just a guess, but I would bet that's it.
metalx1000 1 year ago
@metalx1000 Hm, is there a way to get around that? Somehow build in something that checks if a certain button(q for example) was pressed and exits the loop after that?
Tarnus88 1 year ago
@Tarnus88: could probably through the loop into the background with a '&' and then set you script to wait for user input. And on certain input kill the script. I'll play with it some tomorrow.
metalx1000 1 year ago
Cool vid :)
draconian321 1 year ago