Get the most out of your Centmin Mod LEMP stack
Become a Member

Beta Branch customise PS1 command prompt for clearer identification of server

Discussion in 'Centmin Mod Github Commits' started by eva2000, Feb 2, 2017.

Tags:
  1. pamamolf

    pamamolf Well-Known Member

    4,125
    429
    83
    May 31, 2014
    Ratings:
    +841
    Local Time:
    11:30 AM
    Nginx-1.29.x
    MariaDB 10.6.x
    Ok updated and checked again and now i can see only the working directory and not the full path of it..... :)


    In my opinion is not so useful and i don't like it but ok no problem :)

    But the hostname there is very good !
     
  2. eva2000

    eva2000 Administrator Staff Member

    58,907
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    6:30 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    yeah hope it prevents froms from running commands on the wrong server like this gitlab employee did on production server instead of staging GitLab employee ran rm -rf on production !
     
  3. pamamolf

    pamamolf Well-Known Member

    4,125
    429
    83
    May 31, 2014
    Ratings:
    +841
    Local Time:
    11:30 AM
    Nginx-1.29.x
    MariaDB 10.6.x
    How can i adjust the command if i want to not have there the working directory?
     
  4. eva2000

    eva2000 Administrator Staff Member

    58,907
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    6:30 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    post #19 already mentions it the default is having working directory basename now not full name

    i wouldn't recommend totally removing basename of work directory
     
  5. Sunka

    Sunka Well-Known Member

    1,150
    325
    83
    Oct 31, 2015
    Pula, Croatia
    Ratings:
    +525
    Local Time:
    10:30 AM
    Nginx 1.17.9
    MariaDB 10.3.22
    Found solution.
    In above code somewhere is enclosed bracket, but can not found where so bash thinks that line is not how log it should be... blah blah.. on longer commands there is no line wrap but command try to write on same line on beginning...

    This is the correct code for above uncorrect code:
    Code (Text):
    export PS1="\[$(tput setaf 7)\]\[$(tput setaf 2)\][\u@\h \W]\\$ \[$(tput sgr0)\]"
     
  6. RB1

    RB1 Active Member

    292
    75
    28
    Nov 11, 2016
    California
    Ratings:
    +122
    Local Time:
    1:30 AM
    Nginx 1.21.x
    MariaDB 10.1.x
    Hmm...this would be good if they made computer monitors in 8640x200 pixels :D:LOL::ROFLMAO:
     
  7. eva2000

    eva2000 Administrator Staff Member

    58,907
    12,490
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +19,122
    Local Time:
    6:30 PM
    Nginx 1.31.x
    MariaDB 10.x/11.4+/12.3+
    nice work (y)

    heh .. that was on my 1920x1200 monitor :)