AIX

AIX

Connect with fellow AIX users and experts to gain knowledge, share insights, and solve problems.

 View Only
  • 1.  ls colors

    Posted Thu September 20, 2007 11:38 AM

    Originally posted by: d1land


    I would like to set up our environment to print the ls command output in color based upon the file type. We are running AIX 5.3 with KSH as the default shell. Any ideas?


  • 2.  Re: ls colors

    Posted Thu September 20, 2007 12:20 PM

    Originally posted by: SystemAdmin


    > I would like to set up our environment to print the
    > ls command output in color based upon the file type.
    > We are running AIX 5.3 with KSH as the default shell.
    > Any ideas?

    • /etc/profile ----
    ...
    alias ls='ls --color'
    ...
    • /etc/profile ----

    See prior forum entry for further details
    http://www.ibm.com/developerworks/forums/dw_thread.jsp?message=13986129&cat=72&thread=173828&treeDisplayType=threadmode1&forum=747#13986129

    Hopefully helpful,


  • 3.  Re: ls colors

    Posted Thu September 20, 2007 02:20 PM

    Originally posted by: d1land


    I was not able to get any success. Thanks anyway.


  • 4.  Re: ls colors

    Posted Fri September 21, 2007 01:21 PM

    Originally posted by: dukessd


    Check this out:
    http://www.tek-tips.com/faqs.cfm?fid=6627

    I don't think AIX native terminals can do it but if you use a terminal emulator like Putty you stand a chance.

    I've never tried it because I don't have a problem spotting directories, etc. due to the d, etc. at the beginning of the line, which I think is always a dead give away, but please let us know how you get on.


  • 5.  Re: ls colors

    Posted Fri September 21, 2007 04:32 PM

    Originally posted by: SystemAdmin


    The linke you posted worked pretty good for me. Running, 5300-05-00.

    Thank you !!!


  • 6.  Re: ls colors

    Posted Tue September 25, 2007 03:22 AM

    Originally posted by: SystemAdmin


    Hello,

    You can use the GNU "ls" command.

    Download and install the GNU Coreutils from AIX Toolbox for Linux Applications
    http://www-03.ibm.com/systems/p/os/aix/linux/download.html

    This is going to install many commands under the /usr/linux/bin path

    and then you can alias the command for your user as follows

    alias ls='/usr/linux/bin/ls --color'

    And the added value is that you have many linux commands.

    Regards,
    Leo


  • 7.  Re: ls colors

    Posted Tue September 25, 2007 09:23 AM

    Originally posted by: d1land


    Many thanks Leo. That is exactly what I was looking for. I'm trying to make things as easy as possible for my users. I appreciate the assistance.


  • 8.  Re: ls colors

    Posted Wed January 28, 2015 02:23 PM

    Originally posted by: earonesty


    The following code is an aix-colorized ls, without needing to install GNU stuff.

    https://gist.github.com/earonesty/e04e94bbb139f6d645c6