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

learn more… | top users | synonyms

0
votes
0answers
7 views

Count of table as file-trailer [migrated]

I'm spooling out a table in EDW to a text file and I need the count of table as the file-trailer. Below is the spool code I'm using Set pagesize 0 Set linesize 2098 Set trimspool on Set heading ...
1
vote
1answer
30 views

How to update prompt on directory change

For example with following: prompt_git() { local PL_BRANCH_CHAR () { PL_BRANCH_CHAR='!' } local ref mode repo_path repo_path=$(git rev-parse --git-dir 2>/dev/null) if $(git rev-...
1
vote
2answers
41 views

Condition Inside String in Bashscript

I want to print exit code of previous command in shell if it failed. So I changed PS1 variable in /etc/bash.bashrc like this: PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w [$?] \$ ' #...
-1
votes
2answers
24 views

How to highlight command prompt in Guake / ArchLinux? [duplicate]

I am starting to use Arch Linux / Mate, and Guake with it (last versions). I would like Guake can highlight the command prompt, like in this image. You can see the prompt is light green, and the other ...
0
votes
1answer
34 views

HH:MM:SS (with AM/PM) 12 Hour Timestamp for Bash Prompt

I'm trying to add a timestamp to the beginning of my bash prompt in the format of a 12 hour HH:MM:SS AM/AM clock, and as of now, I've had no luck. Here's a couple things I've tried. I've tried date +%...
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 ...
1
vote
0answers
17 views

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

I want to monitor LSF job count through command prompt. %j will not give me the LSF job count. Can anyone tell how to configure command prompt to show the LSF job count?
2
votes
1answer
32 views

Terminal prompt is being written over top of [duplicate]

I should preface this by saying this terminal session is via ssh from Windows PuTTY to Linux OpenSSH. I'm not sure if this matters, but I figured I should say it anyways. Currently, when I write more ...
3
votes
1answer
35 views

Spurious @ symbol at start of bash prompt in Debian Jessie

As of late, and without my deliberately doing anything to make it happen, my Bash prompt has an at sign (i.e. @) prepended to it. This did not previously happen. Nor can I see anything in my ~/.bashrc ...
3
votes
4answers
3k views

How to show the host name in Linux commandline prompt

I have several VMs and right now my command-line prompt looks like -bash-3.2$; identical on every VM, because it doesn't contain the host name. I need to always see which VM I'm on using hostname ...
1
vote
1answer
129 views

“-bash: warning: setlocale: LC_ALL: cannot change locale (en_US.UTF-8)”

Running a brand new Ubuntu 16.04 and a Debian 8 server. Trying to connect via ssh and getting the following strange terminal output. I refer to the rectangles with the numbers in it. The problem ...
3
votes
3answers
2k views

Show only current and parent directory in bash prompt

I'm new to bash and would like my prompt to show something that in tcsh was trivial, yet after a good google search I still cannot do. I would like my prompt to include only the current and parent ...
3
votes
2answers
36 views

Execute command within current shell before every prompt

I'd like to have the current jobs status displayed in the title of my terminal. In Bash, I can use PROMPT_COMMAND for that. Korn Shell (ksh93) doesn't have that. Other answers suggest using command ...
0
votes
2answers
35 views

Terminal doesn't wrap properly

I'm using Gnome Terminal to connect via SSH to my server. My account on the remote server (which is Ubuntu) uses bash. My bashrc contains a line that sets the shell prompt to include my current git ...
2
votes
2answers
66 views

bash prompt not wrapping as expected

Here it is: Captures git branch for prompt: parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/ (\1)/' } export PS1="\W\[\033[0;31m\]\$(parse_git_branch)⚡️\[\033[...
6
votes
2answers
5k 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
21 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
34 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?
7
votes
1answer
112 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
245 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
49 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
32 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
27 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
97 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
567 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
910 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
257 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 ...
34
votes
3answers
16k 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
65 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
11k 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
58 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
35 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
50 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 ...
39
votes
4answers
32k 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 ~ ...
2
votes
2answers
48 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
25 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
54 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
52 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
57 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
29 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
92 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
17k 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
503 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 ...