Find the answer to your Linux question:
Results 1 to 4 of 4
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    colour my programs

    help buddy... i have a problem.. i know how to program in linux in c and c++ and have made several commands like "ls","cat" etc.. now see when we do ls it displays file names of the present directory... i want to do such that when my prog of ls displays the file name it do so in some different color say red or orange etc which will b defined in my prog.... can any one help....

    if possible pls pm me

  2. #2
    Linux Engineer
    Join Date
    Mar 2005
    Please turn of the colors, thei're hurting my eyes!

    I know thei're called "ANSI colors", that's all I know, google it... Or wait for someone else to answer.

  3. #3
    Linux Engineer
    Join Date
    Nov 2004
    Colors is quite easy really. Just print the ansi code and let the terminal figure it out. Example:

    printf("\033[0;32;40mhello there\n");

    will print "hello there" in green.
    Here is a link which will be helpful:

  4. $spacer_open
  5. #4
    In your currently blocked cross post I suggested to check the following:


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts