Posts

PS1 prod test example with color

PS1='\[\e[1;31m\][test]\[\e[1;32m\][\u@\h \W]\$\[\e[0m\] ' PS1='\[\e[1;35m\][test]\[\e[1;32m\][\u@\h \[\e[1;34m\]\W]\$\[\e[0m\] '

the first available executable in PATH wins

the first available executable in PATH wins

How To Suspend A Process And Resume kill -STOP 16143 kill -CONT 16143

How To Suspend A Process And Resume kill -STOP 16143 kill -CONT 16143

how to check SUDO permission $EUID = 0

#!/usr/bin/env bash if [[ $EUID = 0 && "$(ps -o comm= | sed -n '1p')" = "su" ]]; then echo "sudo!" else echo "not sudo!" fi

win+-> <- - allows to split terminal window (half size)

win+-> <- - allows to split terminal window (half size)

netstat tulpena find process id based on Inode in netstat

awsc1@ubuntu:~/dockerexamples/docker18.06/Dockerfile$ netstat -tulpena Proto Recv-Q Send-Q Local Address           Foreign Address         State       User       Inode      PID/Program name     tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      101        27118      -                           tcp6       0      0 :::4000                 :::*                    LISTEN      0          51306      -          ...

bash script header best practices

#!/bin/bash ######################## # Program Nmae: blabla   Author: John Miller # Description: The purpose of the script #------ # Change log: # Date  Programmer Description # 21.05.2018 Somebody    Initial implementation ########################