A string of characters displayed by interactive shells to signal the shell is waiting a user input. The prompt can be used to display variables and data about the enviornment.

learn more… | top users | synonyms

3
votes
1answer
114 views

Bootup prompt for ecryptfs password

Is it possible to setup ecryptfs mounts to prompt for password upon bootup? Say for example /home and /var are ecryptfs folders that need to be mounted; how do I force a prompt upon bootup to ask for ...
12
votes
2answers
1k views

Can I configure bash to execute “clear” before every command typed in the console?

I would like to configure bash to execute clear command every time I type some command in the terminal (before executing my command). How can I do that? I'm using Debian Linux.
6
votes
5answers
3k views

Bash: Display exit status in prompt:

GREEN="\e[1;32m" RED="\e[1;31m" NONE="\e[m" get_exit_status(){ es=$? if [ $es -eq 0 ] then echo -e "${GREEN}${es}${NONE}" else echo -e "${RED}${es}${NONE}" fi } ...
-4
votes
3answers
113 views

Linux prompt missing brackets

I'm using centos in my VPS server and guest system. There're two logins for a guest system. One is root and one is regular. After I mounted the guest system and chroot to the mounting directory, I ...
-2
votes
1answer
97 views

bash script user promt for prefered directory

hey all i am attempting my first bash script. so i would like to prompt the user to find out where they would like a cloned repo to be saved currently i am assigning it like this ...
5
votes
2answers
291 views

Wrap command in the prompt

Is it possible to insert a separator after the command in a prompt? This is an example: ~/Desktop: ls -al ------------------------------------- total 80 drwx------+ 6 eddie staff 204B Apr 29 ...
0
votes
1answer
61 views

can someone fix my PS1 for bash

I seem to have too many colour escapes so it only works in some prompts - can someone please correct for me ? PS1='\[\e[0:35m[\u@\e[0:33m\h\e[m \e[0:35m\w]\e[m \e[0:33m`git branch 2> /dev/null | ...
4
votes
3answers
197 views

What process is running before I even get a prompt?

When I log in to a specific server I see the following: Note that I get get Last login: ... information but no prompt. I hit Ctrl+C and only then do I get my prompt, thus proving that my username ...
3
votes
1answer
252 views

Prompt for confirmation for every command

I'm writing a pretty ad-hoc install script for some thing. No much control constructs, basically just a list of commands. I'd like the user to confirm each command before it gets executed. Is there a ...
1
vote
1answer
143 views

bash prompt - long command circle back to same line after adding color

Note: I am using Putty and my TERM is set to XTERM. I have added the color to my bash prompt as PS1="\[\033[0;32m\]\d \t \u\e[1;33m@\H /\W $ \[\033[1;37m\]" just to simplify PS1 in English - ...
1
vote
1answer
68 views

Displaying ~ for $HOME in zsh prompt

I have my prompt set to the following: PROMPT=%F{reset}[%F{blue}%2/%F{reset}] which displays two parent directories as [foo/bar] However, when I'm in $HOME or one directory deep in $HOME, I'd ...
4
votes
2answers
131 views

Bash Command (History) Number In PS1

I am a noob in bash to be honest. I have Googled around and cannot find an answer to this: history lists previous commands and their number e.g. $ history 286 clear I want to be able to see the ...
3
votes
2answers
882 views

How to script /etc/issue?

I would like to pipe my tty number through figlet (ASCII generator) for the /etc/issue (message shown before login). Obviously this means I can't just update it from /etc/rc.local. On my system ...
2
votes
2answers
758 views

Prompt “-bash-3.2$” vs. “bash-3.2$” in SunOS 5.10

When I log into a server running SunOS 5.10, my prompt initially is "-bash-3.2$" Then when I run the following commands, I can see that the prompt is slightly different after typing bash (it no ...
3
votes
1answer
1k views

What are special prompt symbols for busybox's sh support?

I want to setup a time prompt on PS1. But, there is no document about what are symbols the busybox support. Is there any one know? Here are all which I knew. PS1='\u@\h: \w \$'
5
votes
2answers
971 views

Bash $PROMPT_COMMAND messing up scroll history display

I set up a PROMPT_COMMAND to display the current branch while I'm in a git repo. The relevant part of my .bashrc is: export PS1=" \[\033[34m\]\$\[\033[0m\] " export ...
5
votes
3answers
990 views

How to make bash put prompt on a new line after cat command?

What I get: host:~ user$ cat example.txt some texthost:~ stas$ What I want to get: host:~ user$ cat example.txt some text host:~ stas$ Is there a way I can make cat behave like this? I'm using ...
2
votes
2answers
318 views

Is there any way to test out PS1 Bash Prompts before committing them?

I'd like to mess with my Bash prompt, but I'd like to do so in a way that doesn't corrupt my already extant one. I could just comment it out, but is there a way to test it either with an online tool ...
4
votes
2answers
460 views

Bash prompt not recognizing Unicode escapes

I'm trying to customize my Bash prompt with Unicode characters and I'm having a bit of trouble. If I try to include a Unicode character like this: $ echo ☢ | hexdump -C 00000000 e2 98 a2 0a ...
3
votes
1answer
342 views

Coloring shell command and output differrently [duplicate]

Possible Duplicate: Customizing bash shell: Bold/color the command bash $ cat what-i-want "I want the output be in a different color." I'd like my commands stand out among the output, ...
3
votes
1answer
275 views

How to set up `screen` to modify the window title and xterm-window title?

I'd like to have my current $PS1 prompt (\u@\h:\w$(__git_ps1 "(%s)")\$ plus some coloring) to be also used as screen's window title (in the hardline) and as the xterm window title. How can this be ...
3
votes
2answers
121 views

Highlight path separators in PS1

I want to do something like this in Bash: how to format the path in a zsh prompt? But everything I try results in the PWD being fixed to the first directory I start my terminal in. Strangely I've ...
5
votes
3answers
499 views

Bash prompt that won't clobber long commands

I'm trying to set up a bash prompt for - hostname(screen#):directory$ which is coloured green if the last command completed successfully, red if not. This is what I have so far, which actually does ...
5
votes
1answer
365 views

Why does this PS1 value cause unexpected behaviour? [duplicate]

Possible Duplicate: Why is my bash prompt getting bugged when I browse the history? I have set my PS1 variable in .bashrc to be the following: PS1='\e[35m[\W]:\e[0m ' It achieved what it ...
2
votes
1answer
97 views

bash prompt with abbreviated current director including dot files?

I have the following in my .bash_profile (from a similar question here: PROMPT_COMMAND='pwd2=$(sed "s:\([^/]\)[^/]*/:\1/:g" <<<$PWD)' PS1='\u@\h:$pwd2\$ ' However, if the current directory ...
1
vote
1answer
1k views

busybox ash PS1 not expanding

I am trying to setup busybox's ash on an embedded system to support expanding the PS1 prompt statement. I have it currently set as PS1='\u@\h:\w\$ ' However, all that is displayed is literally ...
2
votes
0answers
447 views

Problems changing PS1 to use special character

I'm trying to get my zsh to look something like this: https://bbs.archlinux.org/viewtopic.php?pid=1068202#p1068202. Whenever I print the └───╼ part of the PS1 to my terminal (or in the .zshrc for ...
2
votes
2answers
1k views

Change Korn prompt to show shorter path for working directory

I have changed my .kshrc to show my prompt as follows: 511 /export/home/students/cninja $ where 511 is the command number and ../students/cninja is the current working directory. Is it possible to ...
2
votes
2answers
316 views

Why sudo timestamp is not updated when NOPASSWD is set?

I've set up sudo not to prompt for password by editing the sudoers file: myuser ALL=(ALL:ALL) NOPASSWD: ALL And it works fine, running sudo with no password prompting. But when entering sudo -v I ...
2
votes
1answer
197 views

zsh prompt not escaped properly

This is my current prompt definition: PROMPT='%(?..%F{red}%?%f:)%F{blue}%n%f:%F{green}%{${PWD/#$HOME/~}%} %(!.%F{red}.%f)%# %f' The cursor sometimes starts one character behind the actual prompt, ...
1
vote
2answers
389 views

How to set the command(s) that get run before every single prompt?

I used to know this but I forgot: I want to execute a command or a couple of commands before every single prompt. When I am in our PROD box, I want a big fat reminder above every prompt that says * ...
2
votes
1answer
196 views

Why does newgrp change my PS1 and how to prevent it?

I have a customized PS1 to show several parameters. When I switch to a different group using newgrp, it switched my PS1 to default ($) and that is annoying. The default remains even when I switch ...
7
votes
3answers
1k views

Change the PS1 color based on the background color?

I learned that I can change the format of PS1, especially the color of the string. Then, is it possible to change the color based on the background color of the shell? Or, how can I detect the ...
2
votes
1answer
135 views

How to put “glue” CWD (etc.) to part of the screen instead of putting into PS1?

I suspect there’s some terminology for this question that I’m not aware of. It’s hard to check if a question has already been answered if one doesn’t know the proper vocabulary. So, sorry if this is ...
1
vote
1answer
424 views

Colors not rendered correctly in oh-my-zsh themes

I'm trying to use colors in oh-my-zsh themes. It works fine on my home computer (ubuntu), but in a work computer (Scientific Linux i.e. Enterprise linux) the prompt colors are actually spelled out. ...
3
votes
0answers
217 views

assigning a multiline variable (tcsh prompt) to another

For tcsh, I have a prompt that is multiline: set prompt = "%/\\ %n@%m[%h]% " This shows the cwd on one line and then the user/host on second line. However, with this, I cannot make a copy of that: ...
3
votes
3answers
327 views

New bash prompt causing issues

I changed my bash prompt to this: PS1="\[\033[1;31m[\[\033[1;33m\$(date +%H:%M)\[\033[1;31m] \u:\[\033[1;32m\W\[\033[1;37m\$\[\033[0m\] " Sorry for the long line, it is mostly due to colors. ...
1
vote
1answer
155 views

why does it take long for the bash prompt to return on high system load [closed]

When my server experiences high load and I run a command, there is a long delay after the command has finished before I get the prompt again. Any idea what is causing this?
1
vote
2answers
177 views

Is it possible to know when you're at the first bash prompt of a terminal?

This is sort of a contiunation of my last question: printing saving the last bash input command Now I want to know if it's possible to know when you're at the first bash prompt of a terminal. So I'm ...
3
votes
2answers
119 views

Modify prompt based on value

Suppose I have an environment variable defined in .bash_profile like this: PS1='\[\e[31;1m\][\u@\h \T \w] \[\e[0m\]' This variable makes my Linux prompt show certain information, like thes: ...
12
votes
2answers
334 views

Possible to configure Login TTY over Audio device (Morse code or similar)?

One of the most miserable aspects of my day job is the need to occasionally investigate problems with machines scattered in remote locations all over the world that don't have network access to the ...
1
vote
1answer
516 views

When a command is over half the terminal size it breaks

Whenever I type in a bash command longer than about half the width of the shell window I'm in, the command breaks like it would if I filled the whole screen 3rd command in image - typed a few xs ...
5
votes
1answer
338 views

history list in bash always truncated to 5000 lines at new login

Similar to the 5000 line limitation problem when first thing in .bashrc I have export HISTSIZE=10001 and export HISTFILESIZE=$HISTSIZE My users do not have ~/.inputrc files and the system-wide ...
2
votes
1answer
306 views

Prompting for input in post-install script in dpkg

I am writing a debian package and need to prompt the user for some textual details(default password, etc), as well as some one-of-many choices("Pick one of the following: foo, bar"). Will shell ...
1
vote
3answers
279 views

Reevaluate the prompt expression each time a prompt is displayed in zsh

I'm adjusting my zsh prompt, based upon the dallas theme and the dstufft theme from oh-my-zsh. I love how dallas has various sections of the prompt contained in variables, which makes it much easier ...
3
votes
2answers
3k views

executing if-statement from command prompt

In bash I can do the following: if [ -f /tmp/test.txt ]; then echo "true"; fi However, if I add sudo in front, it doesn't work anymore: sudo if [ -f /tmp/test.txt ]; then echo "true"; fi -bash: ...
4
votes
3answers
651 views

Colored text set up with PS1 and colored output from commands mess each other up

I have PS1 that ends with an opening color sequence (like \[\e[0;32m\]) to have all text in the terminal colored (green in this case). However, when I use a command such as ls (which is aliased to ls ...
1
vote
2answers
528 views

How to get green/red terminals under OpenBSD?

For linux machines I can use: # vi ~/.bashrc # red/green terminal colors regarding exit code export PROMPT_COMMAND='PS1="` if [[ \$? = "0" ]]; then echo "\\[\\033[0;32m\\]"; else echo ...
2
votes
0answers
163 views

What is and how to use PS1 \#

I put this is .bashrc # colors NC="$(tput sgr0)" RED="$(tput setaf 1)" GREEN="$(tput setaf 2)" # etc ... PS1="\[$BROWN\]\u \[$CYAN\]#\# \[$PINK_BLD\]!\!\[$NC\] \[$BLUE\]\W: \[$NC\]" So deepo #50 ...
1
vote
2answers
536 views

Bash prompt when my home directory is a symbolic link

I symlinked my /host/Users/Kevin folder to /home/Kevin. I also edit the /etc/passwd file to /home/Kevin. I logged out and logged back in, however when I open up a terminal it's a bash prompt like so: ...