BASH notes
which
not working to find program
If you do a which
and the program isnβt in your path, but it shows as installed, try this. Example with iptables
:
whereis iptables
Simple Prompt that tells you if the last command failed or not
This prompt one is only if emojis already work in your terminal :3 so make sure you can enable utf-8 for your terminal first:
PS1="\`if [ \$? = 0 ]; then echo π; else echo π; fi\` \[\e[94m\][\@]\[\e[0m\]\\$ "
Use this one if you donβt have emojis in your terminal
# prompt will show ^_^ on successful commands or O_O on failures, then user, then time
PS1="\`if [ \$? = 0 ]; then echo \[\e[32m\]^_^\[\e[0m\]; else echo \[\e[31m\]O_O\[\e[0m\]; fi\`[\u.\@]\\$ "