The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Changing SSH format

Discussion in 'General Discussion' started by dan_c, Aug 16, 2005.

  1. dan_c

    dan_c Active Member

    Joined:
    Jul 23, 2005
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    I just bought a secondary dedicated server, however in the SSH it displays the location as something like [root@location] as opposed to how its displayed in my other server as something like [root@/location/to/my/location]. I like this second format because I like to see where I am. I was wondering how to set my new server's SSH to format the cmd line like that. It's very possible this has already been answered on the forums, but i did't really know what to search for.
     
  2. carteluo

    carteluo Member

    Joined:
    Jun 25, 2005
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Porlamar
    cPanel Access Level:
    Root Administrator
    Twitter:
    On command line type:
    Code:
    # PS1="[\u@\h \w]\\$ "
    Here's a list you can use for the prompt:
    Code:
    \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")
    \j	The number of processes you've suspended in this shell by hitting ^Z
    \l	The name of the shell's terminal device (such as "ttyp4")
    \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.
    
    Cheers
     
  3. dan_c

    dan_c Active Member

    Joined:
    Jul 23, 2005
    Messages:
    39
    Likes Received:
    0
    Trophy Points:
    6
    worked great - thanks!
     
Loading...

Share This Page