How to add color to your SSH sessions in FreeBSD so files of different types have different colors when using ls? March 2nd, 2010
Hey this was really easy. Really, it is just a matter of aliasing your ls commands. However, it is only really easy if you know how to do it. When you forget, it is annoying. So here is another post to store the info I once knew but forgot and had to learn again.
Using sh, the default shell
- Edit your .shrc file in your home folder:
# ee /usr/home/username/.shrc
- Add/Change the alias commands as follows:
alias ls=’ls -G’
alias ll=’ls -laFoG’
alias l=’ls -lG’The first one I added, the second two I only added the -G parameter to the already existing aliases for
ls. - Save and close the file.
- Logout and login and your shell should have colors when you use
ls.
Using bash
- Edit your .shrc file in your home folder:
# ee /usr/home/username/.shrc
- Add/Change the alias commands as follows:
alias ls=’ls -G’
alias ll=’ls -laFoG’
alias l=’ls -lG’The first one I added, the second two I only added the -G parameter to the already existing aliases for
ls. - Save and close the file.
- Copy the .profile file to .bash_profile.
# cp /usr/home/username/.profile /usr/home/username/.bash_profile
- Edit the .bash_profile and add the following:
# Source the .shrc
source .shrc - Logout and login and your bash shell should have colors when you use
ls.
source here
Tags: add colors to shell. ssh colors. file and directories colors, freebsd
This entry was posted on Tuesday, March 2nd, 2010 at 9:16 am and is filed under feebsd, linux, Networking. You can follow any responses to this entry through the RSS 2.0 feed.You can leave a response, or trackback from your own site.
This entry was posted on Tuesday, March 2nd, 2010 at 9:16 am and is filed under feebsd, linux, Networking. You can follow any responses to this entry through the RSS 2.0 feed.You can leave a response, or trackback from your own site.
