Add a Separator & Time Stamp Between Terminal Commands to Increase Readability
If you want to customize the Terminals appearance a bit beyond the prompt and a custom background, you can make the Terminal much more readable by using this nice trick to add a separator and timestamp between each executed command. This also bolds the current command text and anything that is available from tab completion.
To get this to work, you just need to paste a script into your .bash_profile. Here’s how to do this, including how to make a backup of your existing bash profile in case you mess something up:
- Open the Terminal and type ‘cd’ to make sure you are at the home directory
- Backup your existing .bash_profile by typing:
- Now open .bash_profile with nano (or your preferred text editor):
- Navigate to the end of .bash_profile and copy and paste the code below:
cp .bash_profile .bash_profile-backup
(If you have trouble viewing the embedded code, you can see it all here)
- Now hit Control+O to save the changes, then hit Control+X to exit out of nano
- Open a new Terminal window and start entering commands to see the separator
Remember if you want to revert this you can either delete the code from bash_profile or just go back and replace it with your backed up copy, named .bash_profile-backup and located in your home directory.
This is a pretty nice way to customize the command line a bit and make it easier to read, but it’s not nearly as dramatic as TermKit or some of the other crazier options out there.
As long as you’re using bash you should be able to do the same with other variations of unix too. This is a cool little trick that Lifehacker modified from Emilis Dambauskas, you can get a different variation for Linux at either of those sites if for some reason this one doesn’t work for you. Thanks to Marcus for sending this to us.