For Bash (non-root user):

$ PS1=”\n\W$ “

For Bash (root user):

$ PS1=”\n\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 {
  $p = Split-Path -leaf -path (Get-Location)
  "`n$p> "

3. Close all PowerShell windows and reopen

For Windows Cmd:

Unknown how!