Customize Terminal in Mac
Mac (UNIX) users use to be working with Terminal a lot. There is a few tips, which can make your life easier. First of all, if you are working on Mac — install iTerm2 and use it instead of standard Terminal. It is just more powerful. There is many features not available in standard Terminal. I find very useful the possibilities to search with CMD+F and copy entire path with double click by mouse (when you double click in standard Terminal it copies only one word). Another cool thing is ‘split terminal’ view. You can have multiple panes in one window.
Second improvement to work faster is creation some aliases for commonly use commands. E.g. ls, clear or la -ls. You might also want to customize command prompt. I don’t like the standard one with Machine and user name (I always know in which Machine I am, and which user I am using — in case of doubts I can use whoami). To do add aliases and change default command prompt you need to modify your ~/.bashrc file. There is my .bashrc:
alias dir='ls -lap'
alias tree="ls -R | grep \":$\" | sed -e 's/:$//' -e 's/[^-][^\/]*\//--/g' -e '\s/^/ /' -e 's/-/|/'" export PS1="[\W]$ "
Here you can find a list of various options to customize your command prompt.
To load this settings automatically each time you run Terminal, you also need to add below command to ~/.profile file:
After above improvements my terminal looks like that:
Hint: when you are playing with your command prompt (or aliases), you can simple run command source ~/.bashrc from terminal to check the result of changes you made.
And of course I use black terminal with green font color.
Originally published at jj09.net.