-G Flag is Messing Up Output for ls

Discussion in 'macOS' started by Volkner, Jan 28, 2010.

  1. Volkner macrumors newbie

    Joined:
    Jan 28, 2010
    #1
    I like having the colored output for ls by using the -G flag (I even put an alias in my .bash_profile to make it default), but whenever I use the -G flag, it also messes up the spacing on the output. How can I make it so it has the same spacing as without the -G flag? And why is it changing it? I Googled and read the man page but couldn't find anything to fix it.
    Code:
    cameron-laptop:~ cameron$ ls
    Desktop		Downloads	Movies		Pictures	Sites
    Documents	Library		Music		Public
    cameron-laptop:~ cameron$ ls -G
    [COLOR="Blue"]Desktop   Downloads Movies    Pictures  Sites
    Documents Library   Music     Public[/COLOR]
    
     
  2. LPZ macrumors 65816

    Joined:
    Jul 11, 2006
    #2
    Well, maybe you can write your own script and pipe the output of ls to it ...

    It's probably easier to just get used to the more compact output. After a bit of time you won't even notice it.
     
  3. sidewinder macrumors 68020

    sidewinder

    Joined:
    Dec 10, 2008
    Location:
    Northern California
    #3
    Put these two lines in your .bash_profile file:

    export CLICOLOR=cons25
    export TERM=xterm-color

    Get rid of the "ls -G" alias.

    Then type:

    source .bash_profile

    S-
     
  4. Volkner thread starter macrumors newbie

    Joined:
    Jan 28, 2010
    #4
    All of that does the same thing as "ls -G" just by default. The spacing is still more compact.

    Code:
    cameron-laptop:~ cameron$ pic .bash_profile
    PATH="/Library/Frameworks/Python.framework/Versions/2.6/bin:${PATH}"
    export PATH
    alias tm=mate
    export CLICOLOR=cons25
    export TERM=xterm-color
    cameron-laptop:~ cameron$ ls
    [COLOR="Blue"]Desktop   Downloads Movies    Pictures  Sites
    Documents Library   Music     Public[/COLOR]
     

Share This Page