Prerequisites
Before attempting this tutorial you'll need to have coreutils installed.
This tutorial was done with the following versions:
- Mavericks (10.9)
- GNU coreutils 8.21
Installation
1. Enter the following in a terminal
echo alias ls="'ls --color'" >> ~/.bash_profileNote the double quotation marks. These are needed otherwise they're ignored by the echo command.
![]() |
| An easy 1-liner |
The alias command tells the shell to run an alternative command in place of a string, in this case, it's running "ls --color" everything the string "ls" is entered. The echo command redirecting into the .bash_profile file just confirms that the shell runs this command every time it's started.
2. Restart the terminal
3. Perform the command to ensure it has worked.
ls
![]() |
| Glorious Color |
End Notes
Check out some other tutorials about diving into the terminal side of things in OS X.
- Click here on how to update your version of bash
- Click here on how to add color to your bash prompt (coming soon)


No comments:
Post a Comment