How to: Add time/date stamp in Linux – Linux Tutorial

Sometimes you need to add a handy time-stamp to your bash output. For back-up purposes, archiving-purposes or just for experimenting. Doing so is simple, you just need to add the $date command to your output.

First, some basics (All the variables are case-sensitive):

  • date – Display the current date
  • %y – Add current year
  • %m – Add current month
  • %d – Add current day
  • %H – Add current hour
  • %M – Add current minute
  • %S – Add current second

Now, some examples:

  • echo $(date +%H:%M:%S) > Current\ Time.txt – Echo current time to a txt file
  • cp -r $USER/minecraft_server/world $USER/minecraft_server/world-backup-$(date +%y-%m-%d) – Make a backup of a folder with the current date
  • date ‘+DATE: %m/%d/%y%nTIME:%H:%M:%S’ – Print the current date and time to the terminal

Remaining Teachable

Theater Of PainThe strive to master a new talent, can easily end up in heartless emulation. Skimming through the pages of an instruction manual, without perception of context, will certainly end your career as the Romantic Hero. Reflection and Consideration from the words of the Wise One, does not involve Obedience outside personal Independence. But to keep growing and Remaining Teachable. Continue reading Remaining Teachable

Broken Down

Wood Gas StoveMany solid structures rarely sprung into existence without enough time and effort from biology. They use the raw materials available to them in their proximity, and turn them into simple hydrocarbons. From sugar to starch. From starch to cellulose. From cellulose to hemicellulose. And finally, hemicellulose to lignin. All are Broken Down through time or intentionally, for our own profit. Continue reading Broken Down

Endless Struggle

HierarchyThe Endless Struggle of mankind. The relic urge for power over everything. Your vision of the world is perfect, you know what you need and where everyone has their place. Greed is not a part of your vocabulary, They need to listen up and obey your rules. Cooperation is not possible, only you understand your vision. Continue reading Endless Struggle

Slow but Moving

OctaoxygenI am Slow but Moving. My physical structure is solid, and at no threat to my environment. But my mind is on a constant move, it never stops, never sleeps. The Stubborn and Rebellious outlook on life, brings confusion to the masses. The relic mindset of violence only accounts for what you can touch, not what the mind can create. Continue reading Slow but Moving