{"id":715,"date":"2008-07-28T10:36:00","date_gmt":"2008-07-28T09:36:00","guid":{"rendered":"http:\/\/www.zarrelli.org\/blog\/?p=715"},"modified":"2008-07-29T08:31:30","modified_gmt":"2008-07-29T07:31:30","slug":"fancy-and-useful-bash-prompt","status":"publish","type":"post","link":"https:\/\/www.zarrelli.org\/blog\/fancy-and-useful-bash-prompt\/","title":{"rendered":"Fancy and useful bash prompt"},"content":{"rendered":"<p>Is your old bash prompt a bit &#8220;outdated&#8221;? Ok, let&#8217;s give it some spice.<\/p>\n<p>Open your<\/p>\n<p><code><br \/>\n\/etc\/profile<br \/>\n<\/code><\/p>\n<p>and throw the following line in (no linebreak):<\/p>\n<p><code><br \/>\nexport PS1=\"\\[\\033[1;32m\\][\\$(date +%H:%M)]\\[\\033[0;36m\\][\\u@\\[\\033[0;31m\\]\\h:\\[\\033[1;34m\\]\\w]\\[\\033[0m\\]\"<br \/>\n<\/code><\/p>\n<p>Save, close the file and issue the following command:<\/p>\n<p><code><br \/>\nsource \/etc\/profile<br \/>\n<\/code><\/p>\n<p>What do you get? Well&#8230;something like this:<\/p>\n<p><code><br \/>\n<span style=\"color: #00ff00;\">[18:05]<\/span><span style=\"color: #00ffff;\">[root@<\/span><span style=\"color: #ff0000;\">moveaway:<\/span><span style=\"color: #0000ff;\">\/home]<\/span><\/code><\/p>\n<p>It&#8217;s:<\/p>\n<p><code><br \/>\n[HH:MM][user@hostname:\/current_dir]<br \/>\n<\/code><\/p>\n<p>Have a nice and colorful day!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Is your old bash prompt a bit &#8220;outdated&#8221;? Ok, let&#8217;s give it some spice. Open your \/etc\/profile and throw the following line in (no linebreak): export PS1=&#8221;\\[\\033[1;32m\\][\\$(date +%H:%M)]\\[\\033[0;36m\\][\\u@\\[\\033[0;31m\\]\\h:\\[\\033[1;34m\\]\\w]\\[\\033[0m\\]&#8221; Save, close the file and issue the following command: source \/etc\/profile What do you get? Well&#8230;something like this: [18:05][root@moveaway:\/home] It&#8217;s: [HH:MM][user@hostname:\/current_dir] Have a nice and colorful day!<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[13,31,62],"tags":[173,475,163,164,266],"class_list":["post-715","post","type-post","status-publish","format-standard","hentry","category-computer","category-gnulinux","category-sysadmin","tag-bash","tag-gnulinux","tag-guide","tag-howto","tag-prompt","without-featured-image"],"_links":{"self":[{"href":"https:\/\/www.zarrelli.org\/blog\/wp-json\/wp\/v2\/posts\/715","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.zarrelli.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.zarrelli.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.zarrelli.org\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.zarrelli.org\/blog\/wp-json\/wp\/v2\/comments?post=715"}],"version-history":[{"count":0,"href":"https:\/\/www.zarrelli.org\/blog\/wp-json\/wp\/v2\/posts\/715\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.zarrelli.org\/blog\/wp-json\/wp\/v2\/media?parent=715"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.zarrelli.org\/blog\/wp-json\/wp\/v2\/categories?post=715"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.zarrelli.org\/blog\/wp-json\/wp\/v2\/tags?post=715"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}