Skip to content

Instantly share code, notes, and snippets.

Last active Sep 13, 2021
What would you like to do?
Debian/Ubuntu .bashrc
# fix dir colors in wsl
alias q='exit'
alias upup='sudo apt update && sudo apt upgrade -y'
alias ls='clear && ls --color=auto'
alias ll='clear && ls --color=auto -alhF'
alias lll='clear && ls --color=auto -alhF *'
alias cp='cp -v'
alias mv='mv -v'
alias md='mkdir -pv'
alias ip='ip -color=auto'
alias grep='grep --color=auto'
alias fgrep='fgrep --color=auto'
alias egrep='egrep --color=auto'
alias diff='diff --color=auto'
alias free='free -h'
alias tree='tree -C --dirsfirst --noreport'
alias ls='clear && lsd --color=auto --group-dirs=first --icon-theme=fancy --size=short'
alias ll='clear && lsd --color=auto -alhF --group-dirs=first --icon-theme=fancy --size=short'
alias lll='clear && lsd --color=auto -alhF --group-dirs=first --icon-theme=fancy --size=short *'
alias tree='lsd --tree'
alias ds='clear && duf'
alias dsi='clear && dua i'
alias neofetch='clear && neofetch'
alias bat='bat --theme=ansi'
alias cat='bat --pager=never'
alias less='bat'
alias rmnm='find . -name "node_modules" -type d -prune -exec rm -rfv "{}" +'
alias rmempty='find . -type d -empty -delete'
alias cfgb="nvim $HOME/.bashrc"
alias cfgbs="source $HOME/.bashrc"
alias cfgnvim="nvim $HOME/.config/nvim/init.vim"
alias emacs='emacs -nw'
alias v='nvim'
alias vim='nvim'
# nix
alias nxgc='nix-collect-garbage -d'
alias nxi='nix-env -i'
alias nxls='nix-env -q'
alias nxr='nix-env -e'
alias nxu='nix-env -u'
ex() {
case $1 in
*.tar.bz2) tar xjf $1 ;;
*.tar.gz) tar xzf $1 ;;
*.bz2) bunzip2 $1 ;;
*.gz) gunzip $1 ;;
*.tar) tar xf $1 ;;
*.tbz2) tar xjf $1 ;;
*.tgz) tar xzf $1 ;;
*.zip) unzip $1 ;;
*.7z) 7z x $1 ;;
*.rar) 7z x $1 ;;
*.iso) 7z x $1 ;;
*.Z) uncompress $1 ;;
*) echo "'$1' cannot be extracted" ;;
extract() {
for file in "$@"
if [ -f $file ]; then
ex $file
echo "'$file' is not a valid file"
compress() {
tar cvzf $1.tar.gz $1
export EDITOR='nvim'
export VISUAL='nvim'
# update if using nix, use `which most`
export PAGER='/usr/bin/most -s'
export PATH="$HOME/.local/bin:$PATH"
# tj n
export N_PREFIX="$HOME/n"; [[ :$PATH: == *":$N_PREFIX/bin:"* ]] || PATH+=":$N_PREFIX/bin"
# deno
export DENO_INSTALL="$HOME/.deno"
# rust
source "$HOME/.cargo/env"
# custom prompt
eval "$(starship init bash)"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment