For Bash (non-root user):

$ PS1=”\n\H:\W$ “

For Bash (root user):

$ PS1=”\n\H:\W# “

For Windows PowerShell:

1. Create a text file with the path to it described by this command in PowerShell console.

> $profile

2. Put the code below into the file created above

function prompt {
  $c = $($env:computername).tolower()
  $p = Split-Path -leaf -path (Get-Location)
  "`n$c`:$p> "
}

3. Close all PowerShell windows and reopen

For Windows Cmd:

Unknown how!

 

Advertisements