This is my bash files Project for Linux. It also works on Mac OS X with a few minor limitations. The project grew out of the tweaks and additions I applied for my personal use.
Some inspiration was taken from projects such as oh-my-zsh , bash-it and others.
Bash files is a work in progress project, everything is still a bit quick and dirty and constantly moving. I hope you enjoy it nevertheless.
Feel free to contribute, reuse, clone, etc.
-binaryanomaly
---
The current version (15.03.2015) looks like this:
---
09.5.2015
- Added CPU core info for Linux and OS X
11.04.2015
- Minor tweaks and enhancements
---
- Config vars for features
- OS type detection support for Linux and OS X
- Cross-platform robust checks
- Aliases
- Hostname (figlets, lolcat supported)
- CPU, RAM info
- Distribution info
- External (public) IP
- SSH connection info
- System info (kernel, architecture)
- File system info
- Last logins
- Random bash comand info (whatis)
- Reboot required check and message on welcome screen and/or in prompt
Most sections can be turned on and off in config/config.sh
- extip - Display external (public) ip using dig/opendns
- colors - Display the 256 colors/nr that can be used with bash
---
Clone the repository into your home directory, it will create the .bash_files subdirectory:
git clone https://github.com/binaryanomaly/bash_files ~/.bash_filesAdd the following to the end of your .bash_profile in your home directory:
# .bash_files initialization
if [ -f ~/.bash_files/init.sh ]; then
. ~/.bash_files/init.sh
fiWe put this in .profile and not .bashrc because we only want it to be executed when bash is executed i.e. a user is logging in - aka login shell.
The following Standard Linux commands are needed:
digto determine the public ip via opendnsfreefor ram infodffor diskspace infolastfor last loginswhatisfor command related infos
The following optional packages are recommended to be installed:
figletfor big ascii letter hostnamelolcatto colorize the ascii letter hostname
Install them using apt (Linux) or homebrew (Mac)
The script will autodetect if each of those is installed and disable the features if not found.
---
The project lives in ~/.bash_files/
| Directory | Description |
|---|---|
| aliases/ | Directory for alias definitions - *aliases.sh gets sourced |
| config/ | Directory for config files - *config.sh gets sourced |
| lib/ | Directory where base functionality is stored - base*.sh gets sourced |
| File | Description |
|---|---|
| init.sh | Init file that sources all the other dirs/files |
---
- Use
_bf_prefix for variable names
