Terminal
- To change the terminals prompt:
- nano ~/.bash_profile
- export PS1="yourFancyPromptName\t " Displays as: yourFancyPromptName01:25:53
- Customization flags: "\d" – Current date "\t" – Current time "\h" – Host name "#" – Command number "\u" – User name "\W" – Current working directory "\w" – Current working directory w/ full path
- Slightly distracting prompt colors: force_color_prompt=yes
- For more details: https://man.cx/bash
- Customize ls with flags
- nano ~/.bash_profile
- alias ls='ls -GFh'
-G adds color to output
-F adds a '/' for directories '*' for executables '@' for symlinks -h makes sizes readable -l detailed output
- Reset PATH. Use if bash commands aren't working. This way you can edit your .bash_profile mistake (-___-)
- export PATH=/bin:/usr/bin:/usr/local/bin
- Change font size on-the-fly
- (Command +)
- (Command -)
- Divider between commands with timestamp (Modified AJ's code from OSXDaily.com)
- Four things need to be added to your .bash_profile
- export PS1='$fill \t\n'"myPROMPT "
- fill="--- "
- function prompt_command { let fillsize=${COLUMNS}-9 fill="" while [ "$fillsize" -gt "0" ] do fill="-${fill}" # fill with underscores to work on let fillsize=${fillsize}-1 done }
- PROMPT_COMMAND=prompt_command
- Create separate file for aliases.
- nano .bash_aliases
- if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi
- More color customization
- https://geoff.greer.fm/lscolors/ example use: export CLICOLOR=1 export LSCOLORS=exfxcxdxbxegedabagacad