在 Linux 終端機上查看電池狀態

在 /sys/class/power_supply/BAT0/ 資料夾裡,有一系列的檔案存放著電池的資訊 1 2 3 4 5 6 7 8 9 10 $ ls /sys/class/power_supply/BAT0/ alarm charge_stop_threshold serial_number capacity current_now status capacity_level cycle_count subsystem charge_control_end_threshold device technology charge_control_start_threshold hwmon1 type charge_full manufacturer uevent charge_full_design model_name voltage_min_design charge_now power voltage_now charge_start_threshold present 只要是檔案類型的,都可以直接 cat 查看資料 ...

22 March 2022 · 1 min · nyo

Exa: 更棒的 ls 指令

exa 是 ls 指令的另一個選擇,使用 rust 開發的 github: https://github.com/ogham/exa exa 的特色 幫檔案跟一些屬性都上色,甚至加上 icons,更容易閱覽 可以用樹狀圖顯示,tree 的另一個選擇 可以支援 git status 以及一些額外的檔案資訊 執行效能跟 ls 差不多 安裝方式 1 $ sudo apt install exa 1 $ brew install exa 設定 alias 取代 ls 1 2 3 4 5 6 7 alias ls='exa' alias la='exa -a' alias ll='exa -lh' alias ls='exa' alias ll='exa -lh' alias la='exa -lah' alias lr='exa -lR' 實際使用截圖 ...

27 March 2021 · 1 min · nyo