How to find the process id listening on a port?

On Windows – Example trying to find which process is listening on port 1433 Show if any process is listening on port 1433 for example c:\temp> netstat -ano | find /I “1433” | find /I “LISTEN” Proto Local Address Foreign Address State PID TCP 0.0.0.0:1433 0.0.0.0:0 LISTENING 6244 Using tlist or task manager one can…

process control

# lists jobs in current session $ jobs # start job 1 (sleeps for 200 seconds) $ sleep 200 # suspended job 1 using control-z [1] + Stopped sleep 200 # start job 2 (sleeps for 400 seconds) $ sleep 400 # suspended job 2 using control-z [2] + Stopped sleep 400 # lists jobs…

Background process

There are multiple ways to place a program in background mode. Background mode is when the program runs and returns you the prompt back and the program is till running but it can be tied to the session or untied to the shell. The following scenario is when a process is tied to a shell:…

ksh – Process

— Get process id of current process $ echo $$ 6113 — shows process id $ ps PID TTY TIME CMD 2050 pts/2 00:00:00 ps 6113 pts/2 00:00:00 ksh Useful when creating a unique temp file example TEMPFILE=/tmp/tmpfile.$$ — Get process id of last background id $ sleep 10 & [1] 2078 $ echo $!…

How to change unix prompt?

C-shell (csh) Example: set prompt=”[%n@%m %c] \! %” oracle@localhost ~] 39 % In this above example sets prompt to display username, hostname, current working directory and history number. %n – username, %m – hostname, %c – pwd, \! – history number K-shell (ksh) Example: $ export PS1=’$USER [$PWD] $ ‘ oracle [/home] $ In the…

whereiz – find all version of a command

Using the following script it will find all version of a command in $PATH (from Unix Power Tools) $ cat /tmp/whereiz #!/bin/sh testx=”test -x” fixpath=”`echo $PATH | sed \ -e 's/^:/.:/' \ -e 's/::/:.:/g' \ -e 's/:$/:./'`” # echo $fixpath IFS=”: ” for command do where=”” for direc in $fixpath do $testx $direc/$command && where=”$where…