The problem likely is with one of the three following files all located at the root of your home directory: .bashrc, .profile, or .bash_profile. Try this:
1) While in an sh session, navigate to your home directory if you are not already there (type in cd ~).
2) Run the command ls -al and determine which of those files (.bashrc, .profile, or .bash_profile) are present in your home folder.
3) It is likely the file which is causing the problem is the last one you were editing or is linked to by one of the three previously named files. Either move or change the file name of one of those files in of your home directory. If you are not sure which file you were working with, I would start with .bashrc.
Example command to move .bashrc: mv .bashrc bashrc.bak
4) Once you have moved or changed the file name of one of the previously listed files, try opening a new bash session. If the session launches successfully, then you know which file needs to be edited further. If the bash session does not launch, restore the file back to its original location. If no one file appears to be the cause, try moving or changing the file names of all named files.
5) Make a backup of the file which is causing problems.
To resolve the "process completed" message, you will need to troubleshoot the script looking for return or exit statements which may be written incorrectly. If those are not present, you may have to go the route of commenting lines of the script out to determine where the problem is. To comment a line out, add a # character to the beginning of the line.
During this last step, you will need to move a copy of the offending file back to its original location. To make things easier, I would probably open the file using TextWrangler or from nano or vim in another sh session to make changes.
(Note: TextEdit and XCode will also work. However, to open the file, you will need to issue a command such as "open -a TextEdit.app ~/.bashrc" to open the file because the Open File Window does not allow for opening files whose names start with a period.)
The colors used by ls -G
are based on the file attributes (like directory, symbolic link, executable and so on). See man ls
and go to the section on the LSCOLORS
environment variable for the list of color values and the order of file attributes to define the colors for each file attribute.
You cannot change the colors by file extension by default. But one way to achieve this is by installing other software, like coreutils
, from brew or MacPorts.
Also see this detailed answer on superuser - colouring output of ls according to file extension.
Best Answer
Have a look at http://www.pixelbeat.org/scripts/l which sets up colors among other things in an attempt to give the same output on different platforms