Files
Main/99 Work/0 OneSec/OneSecNotes/30 Engineering Skills/Coding/Shell.md
2024-12-02 15:11:30 +01:00

671 B
Raw Blame History

Dotfiles

Functions

Arguments

Some more info can be found here.

  • $X, where X is any number is the xth argument
  • $@, is a list of all arguments
  • ${@:2}, is the a list of all arguments, starting from the second one
    • :2 basically means an offset

Cheat Sheet

Watch

Can be used to repeatedly execute commands like retrieving the CPU temperature:

 sensors
k10temp-pci-00c3
Adapter: PCI adapter
Tctl:         +77.9°C  
Tccd1:        +77.5°C

So with the watch command this will be updated at a certain interval (e.g. 1s and also update the difference -d): watch -d -n 1 'sensors'