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:
Useful if localhost is a small machine running BusyBox, which uses a slightly unusual format to set the date. Remotehost can be pretty much any Linux machine, including one running BusyBox. Uses UTC for portability.
http://www.joachim-breitner.de/projects#screen-message now also supports reading stdin continuously to update what it shows, different ?slides? separated by a form feed character. Here, we feed the current time into it each second to create a large clock.
pauses exactly long enough to wake at the top of the hour
Turn your terminal into digital clock.
Configures screen to always display the clock in the last line (has to be configured only once).
After that you not only have got the possibility to detach sessions and run them in background, but also have got a nice clock permanently on your screen.
This is a different version from my original command: Console clock -- Beautiful (http://www.commandlinefu.com/commands/view/7902/console-clock-beautiful )
This one uses Boxes and Figlet.
To install the dependencies on Ubuntu, type in:
sudo apt-get install boxes figlet
To install the dependencies on Debian, type in:
aptitude install boxes figlet
This will show a console clock with Figlet.
This is with the Star Wars font.
Change the -f option to anything else.
Notice: You need Figlet installed for this to work.
To install Figlet on Ubuntu, type in:
sudo apt-get install figlet
To install Figlet on Debian, type in:
aptitude install figlet
Shows a simple clock in the console
-t param removes the watch header
Ctrl-c to exit
This command will automatically clear the old clock time, and show the new clock time.
It will also slightly format it.
Binary clock with separate H:M:S.
Create a binary clock.
Do not run this command if you already have ntpd running!
This needs to run as root, for example with sudo:
sudo ntpdate pool.ntp.org && sudo hwclock --systohc && sudo hwclock --adjust
This command will fetch accurate time from NTP servers and synchronize your system clock, then it will use the system clock to synchronize your hardware clock, and will calculate the time drift.