1,424 reputation
412
bio website sirlagz.net
location
age
visits member for 1 year, 1 month
seen Aug 13 at 5:15

Debian/Ubuntu/Xubuntu User.


Sep
24
awarded  Autobiographer
Sep
4
awarded  Yearling
Aug
11
comment How to check whether a particular port is open on a machine from a shell script and perform action based on that?
@user2809564 lsof will only be able to get ports opened by the user that is running lsof. If you need to run it as a different user, user sudo lsof
Aug
11
comment How to check whether a particular port is open on a machine from a shell script and perform action based on that?
@VolkerSiegel Bingo :) I always use -P when using lsof :)
Aug
11
comment How to check whether a particular port is open on a machine from a shell script and perform action based on that?
man lsof should explain the parameters fully, but in short - -i is get all open IPv4/6 ports, -P is show port numbers rather than service, and -s TCP:LISTEN is select TCP ports that are listening
Aug
11
comment How to check whether a particular port is open on a machine from a shell script and perform action based on that?
@user2809564 yes, it will show current connections. If you use lsof -i -P -sTCP:LISTEN | grep 8080 it should show you just the open port.
Aug
11
comment How to check whether a particular port is open on a machine from a shell script and perform action based on that?
@user2809564 try lsof -i -P | grep 8080
Aug
11
comment How to check whether a particular port is open on a machine from a shell script and perform action based on that?
@VolkerSiegel I meant that port 8080 is commonly assigned to a proxy or web server, so running lsof -i would show something like test_server 1473 user 11u IPv4 9822 0t0 TCP *:http-alt (LISTEN) rather than the output of test_server 1473 user 11u IPv4 9822 0t0 TCP *:8080 (LISTEN) that you're expecting
Aug
11
comment How to check whether a particular port is open on a machine from a shell script and perform action based on that?
You probably want to use lsof -i -P | grep 8080. Port 8080 is probably showing up as a proxy port of some sort.
Aug
11
comment Upon bootup, all iptables are lost because the kernel module ip_set is not loaded
@EeroVolotinen So you're saying the error messsage iptables-restore v1.4.7: Kernel module ip_set is not loaded in. is saying it's not a kernel module ?
Aug
11
answered Recommendations for Free Linux monitoring tools
Jul
31
comment two if conditions in for loop bash scripting
Whats the output of $(netstat -na | grep ':3708' | grep ESTABLISH | wc -l) within the script ? Is it only 2 lines ? I would echo it out to double check whether it's 2 lines or not. If it's not 2 lines, then you won't get a NOT - OK response.
Jul
31
comment How to prevent certain memory location to be accessed
My answer is still "Get New RAM"
Jul
31
comment Segfault everywhere even when reinstalling the OS
Time for new RAM !
Jul
31
comment Segfault everywhere even when reinstalling the OS
@Kokizzu I would do the memory test first.
Jul
31
answered Segfault everywhere even when reinstalling the OS
Jul
31
comment home-built router - slow throughput
What's the CPU usage on this laptop like when you're using the internet ? and what's it like when downloading large files ?
Jul
31
comment Where can I find the list of [[ ]] options?
Or for a web based version of the man page - gnu.org/software/bash/manual/…
Jul
31
comment Where can I find the list of [[ ]] options?
Like these - tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.html ?
Jul
30
awarded  Good Answer