This is my personal bash configuration file.
bashrc->source "${HOME}/.bashrc"clr->clear..->cd .....->cd ../...3->cd ../../...4->cd ../../../...5->cd ../../../../..e->$EDITORm->micro
Will use eza if installed, else will use ls. You can use \ls to use the GNU ls.
ls-> Colors and Directories Firstll-> Long listingla-> Long listing including hidden fileslt-> Tree Listinglg-> Display group ownershipld-> Directories only
If Available, It will replace certain command with alternative ones. You can use \command to use the the original command.
grep->rgRipgrep alternativecat->bat/batcatBat alternativefind->fdFind alternative
gagitadd->git addgallgitall->git add -Agcgitcommit->git commit -a -S -mgpgipush->git pushgrmgitrm->git rm --cachedgrmdgirmd->git rm -r --cachedgsgitstatus->git statusgugitaddu->git add -ugitpull->git pull
dcup->docker compose up -d --forcerecreate && docker compose logs -tfdcdwn->docker compose downdcupt->docker compose pull && docker compose up -d --remove-orphans && docker compose image prune && docker compose logs -tfdclogdclogs->docker compose logs -tf
Useful functions that can be use in the shell.
mkcd->mkdir -p+cdcdls->cd+lscdll->cd+llcdla->cd+la
ex
You can use this function to extract one or multiple archives of various format.
Require the following programs:
tar->*.cbt|*.tar.bz2|*.tar.gz|*.tar.xz|*.tbz2|*.tgz|*.txz|*.tar7z->*.7z|*.arj|*.cab|*.cb7|*.chm|*.deb|*.dmg|*.iso|*.lzh|*.msi|*.pkg|*.rpm|*.udf|*.wim|*.xarunzip->*.cbz|*.epub|*.zipunrar->*.cbr|*.rarunace->*.cba|*.aceunlzma->*.lzmabunzip2->*.bz2gunzip->*.gzuncompress->*.zunxz->*.xzcabextract->*.execpio->*.cpio
backup
You can use this function to backup a file -> file-YYYY-MM-DD.bck or a directory -> directory-YYYY-MM-DD.tar.gz.
cleanbck
You can use this function to cleanup all .bck files in the given directory (Not recursive)
The prompt is aimed to be minimal and only display information when needed.
If use is not root, and connection to the terminal is local.
HH:MM ●●● ~/.../path/3/depth
⮊
If user is root
HH:MM ●●● ~/.../path/3/depth
ROOT ⮊
If use inside a container, the prompt change a bit.
HH:MM ●●● [CT] [hostname] ~/.../path/3/depth
user ⮊
If use inside a SSH session, the prompt change a bit.
HH:MM ●●● (SSH) (hostname) ~/.../path/3/depth
user ⮊
If use inside a SSH session to a container machine.
HH:MM ●●● (SSH) [hostname] ~/.../path/3/depth
user ⮊
If current directory is a git repository with a defined branch.
HH:MM ●●● ~/.../path/3/depth (branch|+MDR?S)
⮊
branchis the branch name+OPTIONAL files have been staged (ready for the next commit)MOPTIONAL tracked files have been modified and not stagedDOPTIONAL tracked files have been deleted and not stagedROPTIONAL tracked files have been renamed and not staged?OPTIONAL untracked files in the directorySOPTIONAL stached filesOPTIONAL branch is ahead of remote (need push)OPTIONAL branch is behind of remote (need pull)Emptyinstead ofbranch, mean that git is initialized but the commit tree is empty for the branch.
It assumed that for the folder MY-Project, project name will be MY-Project, and the virtual environement is inside a .venv folder.
To create a virtual environment from inside the project root folder python -m venv .venv.
To activated the venv activate, to deactivate the venv deactivate
- White: Current directory have a virtual environment available. (No venv activated)
- Green: Current directory have a virtual environment available. (activated)
- Yellow: Current directory does not have a virtual environment available but one is activated!
HH:MM ●●● ~/.../path/3/depth |venv:project|
⮊
- Red: Current directory have a virtual environment available but another one is activated!
HH:MM ●●● ~/.../path/3/depth |venv:project ! activated: venv|
⮊
If current directory is a docker compose stack folder.
HH:MM ●●● ~/.../path/3/depth service1 service2
⮊
red There is a docker-compose file but no service runninggreen Services are running