check whether postgres is running or not code example Example: check whether postgres is running or not pgrep -u postgres -fa -- -D