Home »
Command Line Guides » Add date and time to Linux terminal title (Gnome Terminal, xterm, urxvt, rxvt)
Add date and time to Linux terminal title (Gnome Terminal, xterm, urxvt, rxvt)
Updated by JR on Oct 16, 2010 in Command Line Guides, Linux | 2 comments
Here is easy way add date and time to Linux terminal title. This trick works at least following terminals Gnome Terminal, xterm, urxvt, rxvt.
Simply type the following command line:
while sleep 1 ; do echo -ne '\033]2;'`date`'\007'; done & |
Related posts:
- Add Hostname, Date, Time, Uptime, Load Average to Linux Terminal Title
- PHP: Loop through dates (from date to date) with strtotime() function
- Linux: Create Text File on Linux Shell / Command Line
- Nautilus “Open in Terminal” on Fedora/CentOS/Red Hat (RHEL)
- Google search from Linux and UNIX command line
2 Comments
Leave a Comment Cancel reply
Sponsors
Subscribe
Popular Posts
246
Install SVN (Subversion) Server on Fedora 18/17, CentOS/Red Hat (RHEL) 6.4/5.9
Posted by JR on 10-6-10


this command is really nice but please explain this script.
Hi krish,
This is actually really simple:
1. While loop is simple, try following (prints date output on console every second):
2. Use echo without the trailing newline and enable interpretation of backslash escapes:
3. “\033]2;Title\007″ syntax is used to change title of existing aixterm window, try following:
Finally all together outputs date and time to your terminal title. :)