A string of characters displayed by interactive shells to signal the shell is waiting a user input.

learn more… | top users | synonyms

6
votes
2answers
4k views

Showing GNU screen session name and window title in shell prompt

Is there a way to present the GNU Screen session name and window title in the prompt of the shell (let us say, the Bash prompt defined by PS1)?
1
vote
1answer
13 views

Conditional prompt for mercurial

I'm trying to have a prompt that looks like this: $ some-folder (patch-name): I was able to get that to work when I did the following: hg_ps1() { hg prompt " ({patch})" 2> /dev/null } ...
1
vote
0answers
33 views

Is there any history to the shell prompt? [duplicate]

Traditionally, users get the $ prompt and root gets the # prompt but is there any history why this is so?
6
votes
1answer
95 views

Highlight current bash prompt line

I want the terminal to highlight the current bash prompt line. The effect I'm trying to acheive is the same as in text editors where the current line with the cursor is highlighted. Something like ...
5
votes
1answer
230 views

Newline (“\n”) before output in bash

I want to modify my output in bash for better view of output. Simply put \n before this. How can I change it in .bashrc? For example: It's default: root@comp:$ abc bash: abc: command not found I ...
3
votes
1answer
20 views

How can I escape an exclamation point in the PS1 environment variable?

It is substituted with the history number even if I try to escape it with a backslash.
1
vote
2answers
37 views

How to fix shell prompt ( ps1 ) after remote login

I am observing the below strange prompt after login to my remote machine from ubuntu 14.04. This only happens while I'm using the ubuntu gui terminal and not via putty. Any suggestion to fix it?
0
votes
1answer
28 views

Custom Linux log in prompt and system health check

I am looking for an existing tool or direction on creating a custom login terminal and system health-check scripts when booting/logging into my linux machine. Upon opening or closing the laptop much ...
0
votes
1answer
19 views

PROMPT_DIRTRIM not working

I have the following in my .bash_profile: PROMPT_DIRTRIM=3 export PS1='$ \u in \w: ' However, when I navigate deep within a directory, the path doesn't shorten. This is what the prompt shows: $ ...
2
votes
2answers
87 views

Why is $ the default symbol for a user shell and # the default symbol for a root shell?

Operating a standard bash shell on a server, the PS1 prompt defaults to ending in a $ for non-root users, and # for root. IE: ubuntu@server:~$ sudo su root@server:/home/ubuntu# Why is this?
4
votes
2answers
550 views

How change prompt of subshell

I'm trying to create a simple script that, among other things, will create a subshell: #!/bin/sh # setup "${@:-$SHELL}" # teardown The question is: I need to change the default prompt, so for ...
1
vote
1answer
906 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. ...
2
votes
2answers
227 views

Bell and escape character in prompt string

My prompt string is printed using this statement, printf '\033]0;%s@%s:%s\007' user host /home/user Why does it need an escape character (\033) and a bell character (007)? When i ran the same ...
1
vote
1answer
2k views

Changing title without changing prompt on Cygwin

I have the following shell script function from this site that allows me to change the title in both Putty and Cygwin. In Putty connected to a Linux host it changes the title and leaves the prompt as ...
34
votes
3answers
15k views

Terminal prompt not wrapping correctly

I have an issue where if I type in very long commands in bash the terminal will not render what I'm typing correctly. I'd expect that if I had a command like the following: username@someserver ~/...
0
votes
0answers
19 views

Define root prompt and non root prompt in one rc file

I'm writing a restore script for my dotfiles and I find it really irritating that I have to have two .tcshrc for both root and user where they only differ by one line. Is there a way of defining the ...
0
votes
1answer
63 views

Weird user in shell

I use iTerm on OS X 10.10 When I start iTerm I get the weird user unknownA988274AC:~ myUserName$: That was not there before. Before there was myUserName$: Any ideas where that comes from?!
10
votes
3answers
10k views

Colored Prompt in KornShell

According to this StackOverflow post, it is possible have a colored prompt in KornShell. I have not been able to figure out how to do this. I am able to use color: echo -e "\033[34mLinux\033[00m" ...
2
votes
1answer
51 views

Fish shell shows dark-grey “⎔ characters in prompt

I'm pretty certain this is some foible of my SSH client (RoyalTS for Windows) but, having just installed and changed to fish shell, my prompt is preceded by two dark-grey ⎠characters. It doesn't ...
0
votes
1answer
32 views

Different hostname / prompt is shown after logging in as root

[mayur@centos ~]$ su Password: [root@centos mayur]# I want it to be "centos" only. How to do it?
3
votes
1answer
41 views

align rprompt with top of prompt

I've recently been getting really excited about zsh, and making myself an extravagant prompt, but I'm stuck trying to align my RPROMPT. I have an output like this: | [14:59:44] git:(master) ...
0
votes
1answer
41 views

Shell prompt displays .f>

I am running SSH through this command: ssh <machine-name> But instead of seeing the machine name in the prompt, I see .f>. Normally the prompt looks something like machinename> Any ...
38
votes
4answers
30k views

What color codes can I use in my PS1 prompt?

I used several colors in my PS1 prompt such as \033]01;31\] # pink \033]00m\] # white \033]01;36\] # bold green \033]02;36\] # green \033]01;34\] # blue \033]01;33\] # bold yellow Where can I ...
0
votes
0answers
19 views

tcsh prompt changes with change of directory

I am trying to change my prompt to be permanent no matter what directory I am in. I put set prompt = "%n@%M %T>" in my .cshrc and upon opening a console it looks as expected. However as soon as I ...
1
vote
0answers
15 views

Show last three directories in the prompt [duplicate]

I am trying to set prompt of the shell to show atleast last 3 directories. I am using the following to show present working directory, set prompt = " %~>" (Home directory will be replace with ~ ...
0
votes
0answers
14 views

how to make your tcsh command promt show LSF job count?

I want to monitor LSF job count through command promt. %j will not give me LSF job count. Can anyone tell how to configure command prompt to show LSF job count ?
2
votes
2answers
46 views

bash prompt got reset every time I login

I asked this question some time ago about the shell does not displaying the path. Recently I found out that the .bashrc does not get sourced (and this should be a normal practice?). Currently, the ...
1
vote
0answers
15 views

Redirect all output, including input prompts [duplicate]

I know that doing command &> /dev/null suppresses all output file descriptors. But I notice that it does not work for commands that request input from the user, most notably ssh: > ssh ...
4
votes
0answers
23 views

tcsh shell prompt to show unfinished jobs count

How do I make my tcsh shell prompt to show unfinished background jobs? I understand %j will tell me unfinished job number count but prompt goes stale if I keep it idle. Ideally, I would like prompt to ...
17
votes
3answers
3k views

Display command in xterm titlebar

My Bash Prompt is currently setting the xterm titlebar using the following sequence: PS1='\033]0;\u@\h>\w\007' Is there an easy way to display the current command in the titlebar. For example, ...
0
votes
2answers
42 views

tty, console prompt customization?

My Arch based system directly boots to tty and i never use x system or gui. I want to change prompt or whatever which looks like [root@0 ~]#. I want to change it to current time 12 hours format and no ...
3
votes
1answer
41 views

How to always print the prompt on a new line & keep input

We all know this annoying issue: $ printf "abc" > some-file $ cat some-file abc$ which tends to mess up the prompt if it is any more complex than $, throws off the current cursor position and ...
3
votes
3answers
49 views

Conditional PS1

I'm basically trying to make my PS1 look like this when in a git repo: $ ~/Projects/Blah (master): Or if I'm not in a Git repo, I want it to look like this: $ ~/Projects/Blah: This is my current ...
0
votes
1answer
27 views

Setting up command promt in tcsh to show only last 3 working directory instead of complete path?

I have command prompt in tcsh that shows the current working directory. The problem is that the command prompt becomes very big once I am in a deep hierarchy of folders. How do I set the command ...
1
vote
1answer
70 views

Save cursor position and restore it in terminal

I am playing with some terminal capabilities to create async prompt output on bash. I want to get something like this: while outputting string in PROMPT_COMMAND, save terminal cursor position, print ...
6
votes
3answers
16k views

How can I change my bash prompt to show my working directory?

I can print my current working dir like this myPrompt$ pwd /Users/me/myDir I want my shell to look like this /Users/me/myDir$ pwd /Users/me/myDir Is that possible? How can I do it?
4
votes
5answers
472 views

Can I display GIT in prompt when current directory has a .git folder?

Can I display GIT in prompt when current directory has/contains a .git folder? Is there a way to do this? My current prompt is defined like so: export PS1="[\u@\h] \w $ " So, my prompt looks ...
49
votes
2answers
39k views

Awesome symbols and characters in a bash prompt

I just ran across a screenshot of someone's terminal: Is there a list of all of the characters which can be used in a Bash prompt, or can someone get me the character for the star and the right ...
0
votes
0answers
19 views

Utility for managing and defining prompt definitions

Due to escape sequences, prompt definitions often have dyslexia-inducing complexity. For example, here is one person's definition: ORIG=$PS1 PS1="\[${txtund}${green}\]LOCAL\[\[${reset}\]"; PS1+="\$(...
2
votes
2answers
60 views

Prompt: replace custom path with a short word like ~ for home

When I call cd /Users/mu3/apps the prompt simplifies it like this: mu3 [~/apps]: Is this possible to do the same for custom path like cd /Users/mu3/Development/Web/test: mu3 [DEV/test]: I'm ...
14
votes
6answers
3k views

Abbreviated current directory in shell prompt?

vim has a really nice feature which it utilizes in its paths when they're a bit long: It abbreviates the path to the document in the tab at the top. Is there a way to do something similar to this ...
3
votes
4answers
226 views

Shorten path in zsh prompt

Bash has the PROMPT_DIRTRIM option, e.g. when I set PROMPT_DIRTRIM=3, then a long path like: user@computer: /this/is/some/silly/path would show instead as: user@computer: .../some/silly/path ...
3
votes
1answer
55 views

What configuration exists in CentOS but not in Ubuntu, which shows user@hostname for remote terminal sessions?

We have a standard "basic server" install of CentOS 6.7 for our servers, and Ubuntu 14.04 for our desktops. From my Ubuntu desktop, when I ssh into a remote server (ie: ssh into a CentOS instance), ...
140
votes
15answers
230k views

Colorizing your terminal and shell environment?

I spend most of my time working in Unix environments and using terminal emulators. I try to use color on the command line, because color makes the output more useful and intuitive. What options exist ...
3
votes
2answers
595 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 ...
2
votes
1answer
34 views

What does [vmuser@localhost ~]$ mean?

What does the vmuser, localhost, ~, and $ mean in: [vmuser@localhost ~]$
6
votes
3answers
444 views

Display Non-Zero Return Status in PS1

I want to include the return status in my prompt. (Easy add '$? ', right?) However, I only want the status returned (and trailing space) if non-zero. Example: sd ~ $ false 1 sd ~ $ true sd ~ $
2
votes
3answers
367 views

New line after the command prompt

Is there any way I can configure terminal applications to display command text from front of $ to under the user name on terminal window? See image attached. I use terminator.
14
votes
7answers
617 views

Compact bash prompt when using a directory tree / filename

In a system with Ubuntu 14.04 and bash, I have the PS1 variable ending with the following contents: \u@\h:\w\$ so that the prompt appears as user@machinename:/home/mydirectory$ Sometimes, ...
3
votes
2answers
253 views

How to change the part after root@

For example. [root@ip-10-0-7-225 ~]# I edited /etc/hosts but it didn't work.