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

23 lines
671 B
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Dotfiles
# Functions
## Arguments
Some more info can be found [here](https://unix.stackexchange.com/a/378023/460036).
- `$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:
```bash
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'`