Featured Posts

Adding HTML Signature to your iPhone 4 without Jailbreaking itAdding HTML Signature to your iPhone 4 without Jailbreaking... One of the features missing on the iPhone is HTML signature for Mail, and if you are using two different email addresses like me you probably want to have two different...

Readmore

Play Tetris Using Mac Leopard TerminalPlay Tetris Using Mac Leopard Terminal Terminal Tetris is actually part of the Gnu Emacs and is something you should able to do on any unix system that has Emacs on it. I attached text and video instructions. To...

Readmore

Automate a Remote Login Using SSH - LinuxAutomate a Remote Login Using SSH - Linux To do just that you need to create SSH Key Pair 1. we need to use ssh-agent to create an SSH key pair. To do that run this command: ssh-keygen -t rsa When prompted...

Readmore

Free Google Wave InvitesFree Google Wave Invites Do you really want a Google Wave Invite but don't want to pay $$$ on eBay??? I got one for you.... The deal is: I give you an Invitation and once you get it...

Readmore

Start Google Chrome in Incognito ModeStart Google Chrome in Incognito Mode I'm Using Mozilla FireFox as my default web browser But I like using Chrome for Private Browsing. Google Chrome doesn't provide an option to load Incognito by default so...

Readmore

Cool Geex Rss

Make Your Mac Terminal More Personal

Posted on : 01-08-2010 | By : Cool Geex | In : Mac Leopard, Snow Leopard, Terminal

0

Terminal windows are usually pretty boring, but you can make them more personal by adding a welcome message and  changing some colors.

To do so, open your terminal under Applications –> Utilities.

Then type : open -e ~/.profile (The file will open in the graphic text editor)

Go to the end of the file and add the red text:

echo -n “Current Time: “ (To Show The Current Time)
date


echo “Disk Usage:”
(To Show the Disk Usage)
df -h

echo “Hello $USER “ (To Get an hello message of the Login user)

alias ls=’ls -G’ (To make ls run in Graphic mode – list with colors)

If you also want to change your prompt you can set the variable PS1 by adding export PS1=”your setting ” to .profile.

here is mine:

export PS1="e[0m#.e[0;31m@te[0;36m[u@h e[35mwe[0;36m] e[0m$ "

and it looks like that:  1.@11:50:26[User@User-MacBook /Users] $

I know that is looks scary, but it's pretty simple:

all the e[x;xm are for colors (range is: 40-47;30-37) you should play with this one

u will count the prompt lines for you

t is for time (you can also use @ For am/pm OR T for 12H format)

u is for current user

h is for host (you can also use H for full host name)

w is for full working directory (W will give you only the current directory)

This is just a simple example, you can do much more.

****For most linux systems the file would be .bashrc instead of .profile

Related posts:

  1. Viewing file differences in Terminal using colors
  2. Play Tetris Using Mac Leopard Terminal
  3. Add Spaces to Dock in Mac OS X
  4. Move downloaded DMG files automatically
  5. Dell Mini – How To Enable Sound After Ubuntu 9.10 Upgrade

How To Link To This Page?

To link to this page, simply Copy and Paste the following code to your web page.

Write a comment