1
vote
1answer
97 views

Change PS1 value for all Bash users

I am trying to change the prompt value for all users of a system (the $PS1 variable) to the same value. I have the following stored in file /etc/ps1: PS1='` if [ $? -eq 0 ]; then echo -n ...
0
votes
2answers
58 views

making one computers bash prompt match anothers

The computer who's prompt I'm trying to copy: [root@CompanyName-LAMP-DEV:/current/path]$ We'll call that computer computer A. The prompt my computer - computer B - currently has: [root@ip-x-x-x-x ...
3
votes
3answers
3k views

Bash prompt on Ubuntu - FQDN (\H) same as hostname (\h)

We've got seperate environments at my workplace for development, testing, integration, and staging. Within those envs, we've overloaded the hostnames in DNS - e.g. in the dev environment, the primary ...
5
votes
2answers
654 views

Why does CTRL-r act weirdly (showing only part of a command) on OS X

Ctrl-r is a great little tool for searching your .bash_history for previously run commands. However, when I use it in my OS X Terminal.app I see weird behavior, and I was wondering if anyone else ...
2
votes
3answers
380 views

What's wrong with this bash prompt?

I use the following entry in ~/.bashrc file to colorize the prompt and display current branch of git repository: PS1='\[\e[1;32m\]\[\u@\h\]\[\e[m\] \[\w\]\[\e[1;1m\]\[$(__git_ps1 " (%s)")\] ...
6
votes
3answers
920 views

Bash: how to know if the last command's output ends with a newline or not?

Most of the time the output of a command ends with the newline character. But sometimes it does not, so the next shell prompt is printed in the same line together with the output. Example: ...
5
votes
4answers
3k views

Prompt customization: how to detect when there is no tty

I have a customized prompt with colors (using tput) and every time I start a non-interactive session in the server I get a bunch of errors. For instance if I start a non-interactive session like this: ...
6
votes
1answer
2k views

Bash custom prompt breaking wrapping of long command lines

I have a custom bash prompt that colours my username, hostname and current working directory. The colours display correctly, however when I type a command line that needs to wrap, the terminal does ...
5
votes
3answers
761 views

Getting more helpful tab completion prompts in bash?

Let's say I have a directory with a few files in it like this: $ ls file1 file2 file3 And I want to do some tab completion in bash: $ cat file<tab> file1 file2 file3 I remember ...
2
votes
5answers
993 views

Who decided the default shell prompts in Linux?

There are a couple of defaults in the standard Linux shell, bash, that I think need some history brought out. This question is about the prompt. The default prompt in bash in many Linux distros is ...