Page 1 of 2 12 LastLast
Results 1 to 10 of 17

Thread: change color of text in shell

  1. #1
    Member
    Join Date
    Jul 2007
    Posts
    145

    Default change color of text in shell

    Is there a way to change the color of the font to neon green?

  2. #2
    Developer balding_parrot's Avatar
    Join Date
    May 2007
    Posts
    3,399

    Default

    Quote Originally Posted by unlazyfree View Post
    Is there a way to change the color of the font to neon green?
    For someone who is unlazyfree you sure didn't do much searching, did you ?

    have a looksee here

  3. #3
    Member
    Join Date
    Jul 2007
    Posts
    145

    Default

    Quote Originally Posted by balding_parrot View Post
    For someone who is unlazyfree you sure didn't do much searching, did you ?

    have a looksee here
    from what I read in there, it only would change the color of the bt ~#, not the entire text. I wanna keep the color of the bt ~# and change the output text color

  4. #4
    Developer balding_parrot's Avatar
    Join Date
    May 2007
    Posts
    3,399

    Default

    The colourful pic at the top of the page and the script at the bottom seem to indicate otherwise.
    Text Properties

    As previously mentioned, the '0' after the first escape sequence is the default color setting for the text of the shell prompt. For the text properties the following values make sense: 0, 1, 22, 4, 24, 5, 25, 7, 27 with the following meaning: default, bold, not bold, underlined, not underlined, blinking and not blinking, invers, not invers.

    With the help of the following short script we can have a look at the color combinations.
    Code:
    #!/bin/sh
    ############################################################
    # Nico Golde <nico(at)ngolde.de> Homepage: http://www.ngolde.de
    # Last change: Mon Feb 16 16:24:41 CET 2004
    ############################################################
    
    for attr in 0 1 4 5 7 ; do
        echo "----------------------------------------------------------------"
        printf "ESC[%s;Foreground;Background - \n" $attr
        for fore in 30 31 32 33 34 35 36 37; do
            for back in 40 41 42 43 44 45 46 47; do
                printf '\033[%s;%s;%sm %02s;%02s  ' $attr $fore $back $fore $back
            done
        printf '\n'
        done
        printf '\033[0m'
    done

  5. #5
    Junior Member
    Join Date
    Jul 2007
    Posts
    40

    Default

    I hadn't even cared much about this but thanks to you parrot I played with it for a good 20 minutes. :P Seems to work as described.
    --
    "Linux is user-friendly. It's just very selective about who its friends are."

    "Linux users swear by their OS, and Windows users swear at their OS."

  6. #6
    Developer balding_parrot's Avatar
    Join Date
    May 2007
    Posts
    3,399

    Default

    Quote Originally Posted by operatorone View Post
    I hadn't even cared much about this but thanks to you parrot I played with it for a good 20 minutes. :P Seems to work as described.
    Don't blame me my input to this was 15 seconds to find the page to answer the original posters question and another 20 seconds creating the post.

  7. #7
    Senior Member
    Join Date
    Apr 2007
    Posts
    3,385

    Talking

    Way to go balding_parrot!. Now I've gone and jacked with my .bashrc and screwed it all up!! I fixed most of it, but i'm still a Linux Novice..and something told me not to **** with this..but did I listen?? NNOooooo! I need just a little help with this stuff. I did this command in an empty shell window...

    export PS1="\[\e[36;1m\]\[\e[34;1m\]\H \[\e[0m\]"

    and it made my "prompt" go from

    {-=Xploitz=-} ~ #

    to
    ......

    {-=Xploitz=-}

    Which is what I want. But where do I put it my .bashrc when I do ..

    nano /root/.bashrc

    This is what it looks like after i tried to edit it with the above export PS1..etc..

    Code:
    # /etc/profile: This file contains system-wide defaults used by
    # all Bourne (and related) shells.
    
    # Set the values for some environment variables:
    export MINICOM="-c on"
    export MANPATH=/usr/local/man:/usr/man:/usr/X11R6/man
    export HOSTNAME="`cat /etc/HOSTNAME`"
    export LESSOPEN="|lesspipe.sh %s"
    export LESS="-M"
    
    # If the user doesn't have a .inputrc, use the one in /etc.
    if [ ! -r "$HOME/.inputrc" ]; then
      export INPUTRC=/etc/inputrc
    fi
    
    # Set the default system $PATH:
    PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/local/apache/bin:/usr/local/pgsql/bin:/opt/mono/bin:/usr/local/pgsql/bin:."
    
    # For root users, ensure that /usr/local/sbin, /usr/sbin, and /sbin are in
    # the $PATH.  Some means of connection don't add these by default (sshd comes
    # to mind).
    if [ "`id -u`" = "0" ]; then
      echo $PATH | grep /usr/local/sbin 1> /dev/null 2> /dev/null
      if [ ! $? = 0 ]; then
        PATH=/usr/local/sbin:/usr/sbin:/sbin:$PATH
      fi
    fi
    
    # I had problems using 'eval tset' instead of 'TERM=', but you might want to 
    # try it anyway. I think with the right /etc/termcap it would work great.
    # eval `tset -sQ "$TERM"`
    if [ "$TERM" = "" -o "$TERM" = "unknown" ]; then
     TERM=linux
    fi
    
    # Set ksh93 visual editing mode:
    if [ "$SHELL" = "/bin/ksh" ]; then
      VISUAL=emacs
    #  VISUAL=gmacs
    #  VISUAL=vi
    fi
    
    # Set a default shell prompt:
    #PS1='`hostname`:`pwd`# '
    if [ "$SHELL" = "/bin/pdksh" ]; then
     PS1='! $ '
    elif [ "$SHELL" = "/bin/ksh" ]; then
     PS1='! ${PWD/#$HOME/~}$ '
    elif [ "$SHELL" = "/bin/zsh" ]; then
     PS1='%n@%m:%~%# '
    elif [ "$SHELL" = "/bin/ash" ]; then
     PS1='$ '
    else
    #My colour additions (muts)
    
    #PS1="\u@\h:\w\$ "
    #PS1="\[\033[1;34m\]\u@\h:\w\$ \033[0m "
    #PS1='\[\e[34;1m\]\u@\h:\w\$ \[\e[0m\]'
    export PS1="\[\e[36;1m\]\[\e[34;1m\]\H \[\e[0m\]"
    fi
    PS2='> '
    export PS1="\[\e[36;1m\]\[\e[34;1m\]\H \[\e[0m\]"
    
    # Default umask.  A umask of 022 prevents new files from being created group
    # and world writable.
    umask 022
    
    # Set up the LS_COLORS and LS_OPTIONS environment variables for color ls:
    if [ "$SHELL" = "/bin/zsh" ]; then
     eval `dircolors -z`
    elif [ "$SHELL" = "/bin/ash" ]; then
     eval `dircolors -s`
    else
     eval `dircolors -b`
    fi
    
    # Notify user of incoming mail.  This can be overridden in the user's
    # local startup file (~/.bash.login or whatever, depending on the shell)
    if [ -x /usr/bin/biff ]; then
     biff y
    fi
    
    # Append any additional sh scripts found in /etc/profile.d/:
    for profile_script in /etc/profile.d/*.sh ; do
      if [ -x $profile_script ]; then
        . $profile_script
      fi
    done
    unset profile_script
    
    # For non-root users, add the current directory to the search path:
    if [ ! "`id -u`" = "0" ]; then
     PATH="$PATH:."
    fi

    I know I don't have that in the right spot...so where do i put it?? I want it to be permanent. So upon boot up I don't have to type in
    export PS1="\[\e[36;1m\]\[\e[34;1m\]\H \[\e[0m\]" all the time. What I bolded is what I changed...lol..and now i fear I need to copy and paste someones "virgin" .bashrc over mine cause I ****ed with it 2 much. So could someone please post theirs up for me?? Thanks!


    And finally.....@
    unlazyfree


    [CENTER][FONT=Book Antiqua][SIZE=5][B][COLOR=blue][FONT=Courier New][COLOR=red]--=[/COLOR][/FONT]Xploitz[FONT=Courier New][COLOR=red]=--[/COLOR][/FONT][/COLOR][/B][/SIZE][/FONT][FONT=Courier New][COLOR=Black][SIZE=6][B] ®[/B][/SIZE][/COLOR][/FONT][/CENTER]
    [CENTER][SIZE=4][B]Remote-Exploit.orgs Master Tutorialist.[/B][/SIZE][SIZE=6][B]™
    [/B][/SIZE]
    [URL="http://forums.remote-exploit.org/showthread.php?t=9063"][B]VIDEO: Volume #1 "E-Z No Client WEP Cracking Tutorial"[/B]
    [/URL]
    [URL="http://forums.remote-exploit.org/showthread.php?t=7872"][B]VIDEO: Volume #2 "E-Z No Client Korek Chopchop Attack Tutorial"[/B]
    [/URL]
    [URL="http://forums.remote-exploit.org/showthread.php?t=8230"][B]VIDEO: Volume #3 "E-Z WPA/WPA2 Cracking Tutorial"[/B][/URL]

    [URL="http://forums.remote-exploit.org/showthread.php?t=8041"][B]VIDEO: Volume #4 "E-Z Cracking WPA/WPA2 With Airolib-ng Databases"[/B][/URL]
    [/CENTER]

  8. #8
    Developer balding_parrot's Avatar
    Join Date
    May 2007
    Posts
    3,399

    Default

    That's it blame me for your ineptitude.

    Why did you not make a backup first, like you should do.

    Give me a couple of minutes and I will get you a copy.

  9. #9
    Senior Member PrairieFire's Avatar
    Join Date
    Apr 2007
    Posts
    705

    Default

    Quote Originally Posted by balding_parrot View Post
    That's it blame me for your ineptitude.

    Why did you not make a backup first, like you should do.

    Give me a couple of minutes and I will get you a copy.
    At least this is more interesting than watching this slowly work.
    Μολὼν λαβέ - Great spirits encounter heavy opposition from mediocre minds.

  10. #10
    Developer balding_parrot's Avatar
    Join Date
    May 2007
    Posts
    3,399

    Default

    Here you go Xploitz

    Code:
    # /etc/profile: This file contains system-wide defaults used by
    # all Bourne (and related) shells.
    
    # Set the values for some environment variables:
    export MINICOM="-c on"
    export MANPATH=/usr/local/man:/usr/man:/usr/X11R6/man
    export HOSTNAME="`cat /etc/HOSTNAME`"
    export LESSOPEN="|lesspipe.sh %s"
    export LESS="-M"
    
    # If the user doesn't have a .inputrc, use the one in /etc.
    if [ ! -r "$HOME/.inputrc" ]; then
      export INPUTRC=/etc/inputrc
    fi
    
    # Set the default system $PATH:
    PATH="/usr/local/bin:/usr/bin:/bin:/usr/X11R6/bin:/usr/local/apache/bin:/usr/local/pgsql/bin:/opt/mono/bin:/usr/local/pgsql/bin:."
    
    # For root users, ensure that /usr/local/sbin, /usr/sbin, and /sbin are in
    # the $PATH.  Some means of connection don't add these by default (sshd comes
    # to mind).
    if [ "`id -u`" = "0" ]; then
      echo $PATH | grep /usr/local/sbin 1> /dev/null 2> /dev/null
      if [ ! $? = 0 ]; then
        PATH=/usr/local/sbin:/usr/sbin:/sbin:$PATH
      fi
    fi
    
    # I had problems using 'eval tset' instead of 'TERM=', but you might want to 
    # try it anyway. I think with the right /etc/termcap it would work great.
    # eval `tset -sQ "$TERM"`
    if [ "$TERM" = "" -o "$TERM" = "unknown" ]; then
     TERM=linux
    fi
    
    # Set ksh93 visual editing mode:
    if [ "$SHELL" = "/bin/ksh" ]; then
      VISUAL=emacs
    #  VISUAL=gmacs
    #  VISUAL=vi
    fi
    
    # Set a default shell prompt:
    #PS1='`hostname`:`pwd`# '
    if [ "$SHELL" = "/bin/pdksh" ]; then
     PS1='! $ '
    elif [ "$SHELL" = "/bin/ksh" ]; then
     PS1='! ${PWD/#$HOME/~}$ '
    elif [ "$SHELL" = "/bin/zsh" ]; then
     PS1='%n@%m:%~%# '
    elif [ "$SHELL" = "/bin/ash" ]; then
     PS1='$ '
    else
    #My colour additions (muts)
    
    #PS1="\u@\h:\w\$ "
    #PS1="\[\033[1;34m\]\u@\h:\w\$ \033[0m "
    #PS1='\[\e[34;1m\]\u@\h:\w\$ \[\e[0m\]'
    PS1='\[\033[01;31m\]\h \[\033[01;34m\]\W \$ \[\033[00m\]'
    fi
    PS2='> '
    export PATH DISPLAY LESS TERM PS1 PS2
    
    # Default umask.  A umask of 022 prevents new files from being created group
    # and world writable.
    umask 022
    
    # Set up the LS_COLORS and LS_OPTIONS environment variables for color ls:
    if [ "$SHELL" = "/bin/zsh" ]; then
     eval `dircolors -z`
    elif [ "$SHELL" = "/bin/ash" ]; then
     eval `dircolors -s`
    else
     eval `dircolors -b`
    fi
    
    # Notify user of incoming mail.  This can be overridden in the user's
    # local startup file (~/.bash.login or whatever, depending on the shell)
    if [ -x /usr/bin/biff ]; then
     biff y
    fi
    
    # Append any additional sh scripts found in /etc/profile.d/:
    for profile_script in /etc/profile.d/*.sh ; do
      if [ -x $profile_script ]; then
        . $profile_script
      fi
    done
    unset profile_script
    
    # For non-root users, add the current directory to the search path:
    if [ ! "`id -u`" = "0" ]; then
     PATH="$PATH:."
    fi

Page 1 of 2 12 LastLast

Posting Permissions

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