Skip to content

Instantly share code, notes, and snippets.

@zebrajaeger
Last active June 29, 2023 09:19
Show Gist options
  • Save zebrajaeger/03f7576025e7fe4561597435a9b1a108 to your computer and use it in GitHub Desktop.
Save zebrajaeger/03f7576025e7fe4561597435a9b1a108 to your computer and use it in GitHub Desktop.
My personal linux aliases

My Linux Aliases

where to put

~/.bash_aliases

Reload manualy

source ~/.bash_aliases

Files

List files

alias ll='ls -l'
alias la='ls -A'
alias l='ls -CF'

Hash files recursive

sha256all() {
    find -type f \( -not -name "md5sum.txt" \) -print0  | sort -z | xargs -r0 sha256sum | tee sha256.txt
}

Count files recursive

countfiles(){
   find . -type f | wc -l
}

PI specific

Print CPU and GPU temparature

temp(){
   cpu=$(</sys/class/thermal/thermal_zone0/temp)
   echo "$(date) @ $(hostname)"
   echo "-------------------------------------------"
   echo "GPU: $(vcgencmd measure_temp | grep  -o -E '[[:digit:]].*')"
   echo "CPU: $((cpu/1000))'C"
}

Print i2c devices

i2c{
    i2cdetect -y 1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment