Command prompt on linux settings

Aim:

# You don't want this
you_name@host:current_path$ ls -hal

# You want this
your_name@host:current_path$
$ ls -hal

Method:

You can update the variable PS1.

$ cat ~/.bashrc

new_line() {
    printf "\n$ "
}
PS1=${PS1%?}$(new_line)

Reference:

[1]: Displaying a new line on the prompt. (n.d.). Ask Ubuntu. https://askubuntu.com/a/1197614/254137

Comments