General :: Function Of Netstat -a Terminal Command?
Jan 26, 2011
I had a dream least night in which I was on my computer and I was typing the command Netstat -a in command prompt in Ms-Dos. And I was wondering why it looks so much like a Linux terminal command? This question persisted in my mind after I woke up. So what is the story about it?
When I typed netstat -lna, the output: Active Internet connections (servers and established) Proto Recv-Q Send-Q Local Address Foreign Address State tcp 0 0 0.0.0.0:580 0.0.0.0:* LISTEN ... ...
Active UNIX domain sockets (servers and established) Proto RefCnt Flags Type State I-Node unix 2 [ ACC ] STREAM LISTENING 23581 ... ...
Can anyone explain to me: 1. What is "Active Internet connections" & "Active UNIX domain sockets"? 2. What is unix Proto? 3. Difference between LISTEN and LISTENING state.
While issuing the command netstat -M it shows netstat: no support for `ip_masquerade' on this system. But this system is used as a gateway and iptable rules are set for ip forwarding. Also internet is getting another machine through this machine. What about the message?
I just found something "strange" by using netstat tcp 0 0 myhost.deprecated:53719 amaretti.chimfar.:54406 ESTABLISHED How can I check what is the program that is responsible for this line?
I have a small office network (about 30 machine) with linux gateway (6Mbps internet bandwidth). Every user get only 500Kbps bandwidth, and they use the internet very poor. The internet getting slow lately, and I noticed that there are huge amount of small packets (78 byte, 48 byte) coming to linux machines. My question is: How can I solve which machine(s) sending those small packets? Do you have any ideas with netstat command?
The first call to "somefunction" works as expected. The function prints "endfunction" and a process in background sleeps 30 seconds. In the second call I thought it should work in the same way, but the script sleeps 30 seconds before it prints "endfunction".Does someone know the reason of this behavior? Is there another way to do a command substitution of a function that has a background process without have to waiting for that process?
I am using openSUSE 10.3.When I install software from tarball then to record time required I send output of date to beg.txt(when installation begins) and end.txt (when installation finishes).How can I append output of date to a file so I don't need two files?
I am developing a node application and there is an option to set the process title (process name). This only sets it in some tools (like ps and top), but not in htop or netstat.
I found this article that explained how most applications do it, but it doesn't change in netstat.
That lead me to wonder where those programs are getting the process name. Would they be getting it from /proc/##/cmdline? (## being the PID of the process)
I figure messing with things in /proc is a bad idea (and probably not possible), so if this is where those programs are getting it, is there a way to change it?
the function terminates if no key is pressed for 10 consecutive seconds. I tried using the -t option as suggested in some forums, but my version of showkey doesn't have the option of changing the timeout. The options I get are:
-h --helpdisplay this help text -a --asciidisplay the decimal/octal/hex values of the keys -s --scancodesdisplay only the raw scan-codes -k --keycodesdisplay only the interpreted keycodes (default).
Is it possible to write a script to use this function and still keep the function active until an interrupt is recieved?
how I cat to filter out information about Unix Domain Sockets from netstat output without grep? Is there some option for command (I not found it in man of netstat).
I wrote this little function that I use from my '~/.bashrc' (from a script I also made, with help) to run a program on a timer, however there is one small issue I'm having.
Code: ##### Run program on a timer # Usage: program-timer <program> <runlength (in secs)> function program-timer() { $1 & mypid=`eval ps ax|grep "$1"|grep -iv "grep"| awk '{print $1}'`
[Code]...
Basically, it works just fine, but the issue I'd love to get help with is when the timer runs out, it doesn't shutdown the program. That is, not until I close gnome-terminal. I've tried 'exit' in several places, but it doesn't seem to close it.
Now, the above script does what I want, but using 'killall gnome-terminal' not only closes the gnome-terminal window I am running the function on, but ALL gnome-terminal windows I may have open.
Does anybody see a simple way to fix my small dilemma, to have it close only the gnome-terminal window I'm running the function on?
I want to run a linux command with apache through web browser and that's is not working. and it's working properly when I execute this command through terminal, where is the problem?
NOTE: apache have the privileges to execute the command
I am looking into creating my own terminal command from scratch. I researched online for some information on this subject was only able to view stuff related to OS X. I understand that they are both Unix based, are they both similar in creating these commands? Basically all I would like is for someone to point me towards the right direction to start or complete this task.
I open up 2 xterms on my desktop, A(/dev/pts/0) and B(/dev/pts/1).I can write from A to B using redirection e.g. echo "test" > /dev/pts/1How do I run a command from A on B? e.g. "clear"Basically I'm putting the 2 terminals side by side, and using terminal B to display the contents of the current working directory, by running the following in A:export PROMPT_COMMAND="ls -a > /dev/pts/1"but this fills up the screen pretty fast. I was actually looking for a way to clear up the second terminal.
Something unfortunate just happened. I was editing the bash file from my terminal and changed a source. After this I was no longer able to input commands for interpreting in the terminal.
Is there a way by which I can read RSS feeds from the terminal itself ? Something that would display the titles and a link to follow. Or maybe a software which works from within the terminal.