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:
- Viewing file differences in Terminal using colors
- Play Tetris Using Mac Leopard Terminal
- Add Spaces to Dock in Mac OS X
- Move downloaded DMG files automatically
- Dell Mini – How To Enable Sound After Ubuntu 9.10 Upgrade









