Skip to content

Tag Archives: bash

Get the PID of a running Java process using only BASH tools

22-Jul-10

I need to get the PID of a running Java process, in this case Glassfish 3 to see if it is running before I run some asadmin commands. ps -ax | grep "java -cp /opt/bmam/glassfish" | grep -v "grep" | cut -d " " -f 1 26306

My Favorite PS1 Prompt Definition and Aliases

12-Oct-09

Here are a couple of aliases I create on a fresh OSX machine. alias dir=’ls -AlGh’ alias spot=’mdfind -onlyin . $1′ The dir alias is all the most useful ls options all at once. mdfind is the command line interface to the Spotlight service on OSX. You can use the option -name to restrict the [...]