How to change name in console?
Results 1 to 8 of 8

Thread: How to change name in console?

  1. #1
    Member
    Join Date
    Apr 2005
    Posts
    53

    How to change name in console?

    Hi everyone, I want to ask, how can i change the name that appear in the console. This is what appear:

    daniel@dC9F96C8D:~>

    I want to change the dC9F96C8D...how i do this?

    Thanks in advance

  2. #2
    Master-Jedi-Pimps0r & Moderator thehorse13's Avatar
    Join Date
    Dec 2002
    Location
    Washington D.C. area
    Posts
    2,884
    See the hostname man page for your distro.
    Our scars have the power to remind us that our past was real. -- Hannibal Lecter.
    Talent is God given. Be humble. Fame is man-given. Be grateful. Conceit is self-given. Be careful. -- John Wooden

  3. #3
    Member
    Join Date
    Apr 2005
    Posts
    53
    Thanks, I found how to do it. But the hostname before was "linux", after I connect the machine to the internet it get "dC9F96C8D". If I change the hostname, Will I have problems with the internet connection?

  4. #4
    Senior Member gore's Avatar
    Join Date
    Oct 2002
    Location
    Michigan
    Posts
    7,177
    Probably not.

  5. #5
    Senior Member
    Join Date
    Jun 2003
    Posts
    723
    You can make the prompt to what ever you want, Depending on what shell you are using you will need to change your .shrc (sh)or .cshrc (for c/tcsh shell) or .bash (IIRC as i don't have/use bash) in your home directory. The man page for the shell will tell you more. Here are some fine and fun examples http://www.dotfiles.com/index.php3?cat_id=6
    Do unto others as you would have them do unto you.
    The international ban against torturing prisoners of war does not necessarily apply to suspects detained in America\'s war on terror, Attorney General John Ashcroft told a Senate oversight committee
    -- true colors revealed, a brown shirt and jackboots

  6. #6
    Leftie Linux Lover the_JinX's Avatar
    Join Date
    Nov 2001
    Location
    Beverwijk Netherlands
    Posts
    2,534
    I'm guessing you mean changing the bash prompt..

    Load of info on that:
    http://networking.ringofsaturn.com/U...sh-prompts.php
    http://www.pantz.org/scripting/shell/colorterm.shtml
    http://intmainvoid.nl/?cool+tweaks
    http://www.tldp.org/LDP/abs/html/internalvariables.html

    In short: export PS1="your code here"

    Code:
    Sequence  	Description
    \a 	The ASCII bell character (you can also type \007)
    \d 	Date in "Wed Sep 06" format
    \e 	ASCII escape character (you can also type \033)
    \h 	First part of hostname (such as "mybox")
    \H 	Full hostname (such as "mybox.mydomain.com")
    \l 	The name of the shell's terminal device (such as "ttyp4")
    \j 	The number of processes you've suspended in this shell by hitting ^Z
    \n 	Newline
    \r 	Carriage return
    \s 	The name of the shell executable (such as "bash")
    \t 	Time in 24-hour format (such as "23:01:01")
    \T 	Time in 12-hour format (such as "11:01:01")
    \@ 	Time in 12-hour format with am/pm
    \u 	Your username
    \v 	Version of bash (such as 2.04)
    \V 	Bash version, including patchlevel
    \w 	Current working directory (such as "/home/drobbins")
    \W 	The "basename" of the current working directory (such as "drobbins")
    \! 	Current command's position in the history buffer
    \# 	Command number (this will count up at each prompt, as long as you type something)
    \$ 	If you are not root, inserts a "$"; if you are root, you get a "#"
    \xxx 	Inserts an ASCII character based on three-digit number xxx (replace unused digits with zeros, such as "\007")
    \\ 	A backslash
    \[ 	This sequence should appear before a sequence of characters that don't move the cursor (like color escape sequences). This allows bash to calculate word wrapping correctly.
    \] 	This sequence should appear after a sequence of non-printing characters.
    ASCII stupid question, get a stupid ANSI.
    When in Russia, pet a PETSCII.

    Get your ass over to SLAYRadio the best station for C64 Remixes !

  7. #7
    Member
    Join Date
    Apr 2005
    Posts
    53
    Hey thanks everyone. Here is the (really) last question: I have enetered int he page dotfiles.com, but how do I edit the bash for having prompt with color (for example)...if you have a link I can use, it will be helpfull

  8. #8
    Leftie Linux Lover the_JinX's Avatar
    Join Date
    Nov 2001
    Location
    Beverwijk Netherlands
    Posts
    2,534
    For that the LSCOLORS enviroment variable is invented..

    once again a lot of info on this:
    http://www.linux-sxs.org/housekeeping/lscolors.html
    http://lantech.geekvenue.net/chuckti...257/index_html
    http://www.ss64.com/bash/lsenv.html

    in short: export LSCOLORS="your code here"

    the code should be type=colour or even type=effect;colour;bgcolour etc..
    also a ; between colour and the next type

    types
    Code:
    di = directory
    fi = file
    ln = symbolic link
    pi = fifo file
    so = socket file
    bd = block (buffered) special file
    cd = character (unbuffered) special file
    or = symbolic link pointing to a non-existent file (orphan)
    mi = non-existent file pointed to by a symbolic link (visible when you type ls -l)
    ex = file which is executable (ie. has 'x' set in permissions).
    colours
    Code:
    0   = default colour
    1   = bold
    4   = underlined
    5   = flashing text
    7   = reverse field
    31  = red
    32  = green
    33  = orange
    34  = blue
    35  = purple
    36  = cyan
    37  = grey
    40  = black background
    41  = red background
    42  = green background
    43  = orange background
    44  = blue background
    45  = purple background
    46  = cyan background
    47  = grey background
    90  = dark grey
    91  = light red
    92  = light green
    93  = yellow
    94  = light blue
    95  = light purple
    96  = turquoise
    100 = dark grey background
    101 = light red background
    102 = light green background
    103 = yellow background
    104 = light blue background
    105 = light purple background
    106 = turquoise background
    ASCII stupid question, get a stupid ANSI.
    When in Russia, pet a PETSCII.

    Get your ass over to SLAYRadio the best station for C64 Remixes !

Posting Permissions

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