final_path=/var/www/noalyss sudo rm -rf $final_path for i in $(psql -l | grep "\" | awk '{print $1}') do su postgres -c "dropdb $i" done su postgres -c "dropuser noalyss"