Skip to content

Instantly share code, notes, and snippets.

@nityanandmathur
Last active June 3, 2024 05:53
Show Gist options
  • Save nityanandmathur/5fa9ad41da7540a5c447a22f92b2db1c to your computer and use it in GitHub Desktop.
Save nityanandmathur/5fa9ad41da7540a5c447a22f92b2db1c to your computer and use it in GitHub Desktop.
Custom aliases for .bashrc file for smooth operation

List files aliases

alias ll='ls -alF'
alias la='ls -A'
alias l='ls -CF'
list() {
    total=0
    printf "%-50s %s\n" "Directory" "Count"
    for d in ./*; do
        if [ -d "$d" ]; then
            count=$(find "$d" -type f | wc -l)
            printf "%-50s %s\n" "$d" "$count"
            total=$((total + count))
        fi
    done
    printf "%-50s\n" "------------------------------------"
    printf "%-50s %s\n" "Total" "$total"
}

GPUstat aliases

alias gs='gpustat'
alias wgs='watch -d gpustat'

TMUX aliases

alias tls='tmux ls'
ta() {
    tmux attach -t "$1"
}

DU Alias

alias dus='du -sh * | sort -hr'

Folder Alias

alias <name>='<path to folder>'

Activating Conda Envs

alias ca<letter>='conda activate <env>'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment