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 LISTENING 6244 Using tlist or task manager one can... Continue Reading →


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... Continue Reading →

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:... Continue Reading →

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 $!... Continue Reading →

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... Continue Reading →

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... Continue Reading →

Run a logout script in k-shell

By setting trap one can run a logout script when a k-shell is being terminated. The built-in command trap in k-shell allows one to customize shell when a signal is received. # Set to run $HOME/.logout script when shell is terminated $ trap '. $HOME/.logout' 0 # display list of signals setup $ trap trap... Continue Reading →

Create a free website or blog at

Up ↑