How can I make an alias along the lines of:

command-line bash bashrc prompt ps1

alias=PS1="\d \h $ "

which, obviously, won't work. Is there some trick to making assignments from the .bash_aliases file?

I also tried:

alias ps='PS1 $(\d \h $)'


alias ps="PS1='\d \h \$ '"
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.