commandlinefu.com is the place to record those command-line gems that you return to again and again.
You can sign-in using OpenID credentials, or register a traditional username and password.
Subscribe to the feed for:
Use acpi and notify-send to report current temperature every five minutes.
Works best in a shell script run at startup. acpi is called for temperature and fed to notify-send for a tooltip. After waiting five minutes, it will start over.
works best in a shell script run at startup. It will ping localhost once and output to null, after it does that, acpi is called for temperature in fahrenheit and piped through to another loop that feeds notify-send for a tooltip. After waiting five minutes, it will start over.
"The -b (background) option tells sudo to run the given command in the background." -- after it asks you for the password in the foreground.
Take advantage of sudo keeping you authenticated for ~15 minutes.
The command is a little longer, but it does not require X (it can run on a headless server).
Need package: gksu
Launching gui app in background that needs sudo, won't work great with our old
friendly style of launching:
sudo gedit /etc/passwd &
because this would put sudo in background !
Using gksudo as demonstrated, would popup a gui sudo window.
May be this is a common knowledge, but not knowing this
frustrated me during my newbie year.
I use zenity because it's a rewrite of gdialog and also replaces gmessage and has more useful options.
Using --text-info allows you to select and copy the text to your clipboard.
To see a file in a list dialog: cat /etc/passwd | zenity --width 800 --height 600 --list --column Entries
If you don't have zenity, you'll have to download it via apt-get install zenity, etc.
This command is useful when you want to know what process is responsible for a certain GUI application and what command you need to issue to launch it in terminal.