Cambiar el promp de la terminal en linux

Editaremos el fichero .bashrc del home del usurio y pondremos:

show_temp(){
sensors | grep -oP ‘Package.*?+\K[0-9.]+’
}

PS1=»\u@\h $(show_temp) # «

Quedará:

sensors
acpitz-acpi-0
Adapter: ACPI interface
temp1: +27.8°C
temp2: +29.8°C

coretemp-isa-0000
Adapter: ISA adapter
Package id 0: +58.0°C (high = +84.0°C, crit = +100.0°C)
Core 0: +47.0°C (high = +84.0°C, crit = +100.0°C)
Core 1: +48.0°C (high = +84.0°C, crit = +100.0°C)

root@pve 58.0 #

Deja una respuesta