I found a command to check battery health: `upower -i /org/freedesktop/UPower/devices/battery_BAT1`. I'm looking for a way to save or bookmark this command so I can easily run it in the terminal later. Any suggestions?
3 Answers
You could also create a shell script for your command. Save it in a directory that's in your `$PATH`, then you can run it just by typing the script name. For example, name the script something like `check_battery.sh` with the command inside, and it'll make it much quicker to access!
If you want to keep it simple, you can rely on your bash history too. It'll automatically store all the commands you've run, as long as it's set up properly. For easier navigation, check out tools like `fzf` that enhance searching your command history!
A great way to do this is to create an alias in your bash configuration file. Just add something like `alias power='upower -i /org/freedesktop/UPower/devices/battery_BAT1'` to your `~/.bashrc`. Then, whenever you type `power`, it will run that command for you!

Good call! Using `fzf` really brings your history to life. The search feature makes finding past commands super quick!