Use .bashrc to activate colors and aliases in terminal
Still using that plain old black and white Terminal? how boring!
Follow these steps if you want your terminal to be more colorful!
In this tutorial you might have to use VIM to edit some files, if you don't know how to use VIM, read the basics tutorial on vim.
- Open Terminal.
- Type:
cd vim .bashrc
- Look for (line 30):
# uncomment for a colored prompt, if the terminal has the capability; turned # off by default to not distract the user: the focus in a terminal window # should be on the output of commands, not on the prompt #force_color_prompt=yes
- Uncomment the last line:
# uncomment for a colored prompt, if the terminal has the capability; turned # off by default to not distract the user: the focus in a terminal window # should be on the output of commands, not on the prompt force_color_prompt=yes
- Look for these lines (line 71):
# enable color support of ls and also add handy aliases if [ "$TERM" != "dumb" ] && [ -x /usr/bin/dircolors ]; then eval "`dircolors -b`" #alias ls='ls --color=auto' #alias dir='ls --color=auto --format=vertical' #alias vdir='ls --color=auto --format=long'
- Uncomment the aliases you want to use (I've only uncommented the first one, for the usual listing command, but you can give a try to the other ones):
# enable color support of ls and also add handy aliases if [ "$TERM" != "dumb" ] && [ -x /usr/bin/dircolors ]; then eval "`dircolors -b`" alias ls='ls --color=auto' #alias dir='ls --color=auto --format=vertical' #alias vdir='ls --color=auto --format=long
- Then to activate some aliases like 'll' or 'la', find those lines (line 83):
# some more ls aliases #alias ll='ls -l' #alias la='ls -A' #alias l='ls -CF'
- Uncomment (and modify as you like) the aliases you want, here's my changes:
# some more ls aliases alias ll='ls -lh' #alias la='ls -A' #alias l='ls -CF'
- Save.
- Open a new Terminal
- Try some of these commands, depending on what you have activated:
ls ll la dir
You can create other aliases and/or change the colors to your own favorite ones, but this will be in another tutorial!
























