The prompt is what asks a user for their interactive input

learn more… | top users | synonyms

34
votes
4answers
8k views

What is the origin of the UNIX $ (dollar) prompt?

The UNIX prompt uses a $ symbol to indicate that your input is expected. I was wondering why this symbol was chosen -- if there is a reason. Dollar just seems a little unexpected. A > would have been ...
20
votes
2answers
5k views

Tmux and ZSH custom prompt : bug with window name

I have customized my ZSH prompt with oh-my-zsh to make it more readable and add information about git if I'm in a repository. Example : bob@inf [~/docs] % bob@inf [~/src/nicest] master % (in a git ...
19
votes
3answers
9k views

OpenSSL without prompt

I am using following code to generate keys: apt-get -qq -y install openssl; mkdir -p /etc/apache2/ssl; openssl genrsa -des3 -out server.key 1024; openssl req -new -key server.key -out server.csr; cp ...
13
votes
3answers
2k views

mysql command line color prompt

mysql command line color prompt: I want to add colors to my MySQL prompt: I have so far in a script (database.sh): mysql -uroot -hlocalhost -A --prompt="\u@\h:\d> " I would like root to be ...
12
votes
5answers
2k views

Which directory does path `//` represent in Linux?

When I want to go back to upper level directory in Linux by typing cd .., I typo-ed cd //. To my great surprise, no errors are reported. What's more the prompt becomes username@hostname://$. ls ...
12
votes
5answers
2k views

How to show the current Vi mode when using Vi keybindings in the shell?

I use the vi keybindings in my tcsh shell. Now, I don't know which vi mode I'm in (insert mode or command mode), which leads to a lot of frustration. Does anyone know of a way to show the current ...
11
votes
3answers
2k views

Making Linux shell prompt show last return value

I'm currently on a Linux machine and the shell prompt is showing me the last return value and number of executed commands (picture included, with these numbers shown in purple). My own computer ...
10
votes
4answers
6k views

How do I fix my prompt in emacs shell-mode?

I'm doing some programming on a colleague's machine. He has a version of emacs (23.1.1) I haven't used before. My problem is that when I go to shell-mode, my bash prompt looks like this: ...
8
votes
2answers
1k views

Escape non-printing characters in a function for a Bash prompt

In a Bash Prompt (PS1 variable), I'm calling a function to potentially add text to the prompt: export PS1="\u@\h \$(my_function) \$ " However, the function in the prompt contains ANSI color codes ...
8
votes
2answers
2k views

zsh right-justify in ps1

I'd like a multi-line zsh prompt with a right alined part, that will look something like this: 2.nate@host:/current/dir 16:00 -> I know about ...
7
votes
3answers
17k views

How to Run an app as Administrator without the prompt?

When I start SQL Server Management Studio 2008, I an error that's been around forever and is documented here. One of the suggestions to fix it that actually worked was to start SSMS with Run as ...
7
votes
8answers
3k views

Pushing my PS1 prompt over ssh

I use a specific PS1 prompt that I like. I share a few logins with other other people on a few different servers. I was wondering if there was a way to specify in my local bash profile a remote prompt ...
7
votes
3answers
4k views

Lightning bolt for prompt (PS1)

I've seen on a few screencasts a while back where someone had a lightning bolt instead of $ on the bash prompt. Does anyone know how to do this?
7
votes
1answer
3k views

How can I put a newline in my zsh prompt without causing terminal redraw issues?

I'm trying to fix a minor (but annoying) issue with my zsh prompt. The problem I'm seeing is that when I'm using a terminal in a GUI OS environment (for example, Terminal.app or iTerm 2 on OS X ...
6
votes
3answers
1k views

Why doesn't “cd D:” change the command context to D:? [duplicate]

Possible Duplicate: Using cd Command in Windows Command Line, Can't Navigate to D:\ Every time I want to change directory context to another drive (D, E, F, or whatever..) on a Windows ...
6
votes
1answer
251 views

Custom prompt botched during history and control-a in OS X's Terminal.app using Bash

I customized my prompt in .bash_profile to look like this: export PS1="\w \e[0;32m\$(vcprompt -f '[%n:%b]')\e[m\$ " Now, when I press up arrow to go back through history, find the one I want, then ...
6
votes
5answers
18k views

How can I display the absolute path in bash prompt?

I currently have my bash PS1 set to something like this: PS1="\[\`if [[ \$? = "0" ]]; then echo '\e[32m\h\e[0m'; else echo '\e[31m\h\e[0m' ; fi\`:\w\n\$ " How can I make it show the absolute path ...
6
votes
3answers
255 views

Removing the useless space at the end of the right prompt of zsh ($RPROMPT)

In zsh, there is always a space character at the right of my right prompt. I tried with a very simple .zshrc such as: PROMPT="#" RPROMPT="*" There is a always a space after the * on the right of ...
6
votes
1answer
3k views

What is rootfs# and what can you do with it?

I have been dropped to a [rootfs /]# prompt many times when booting my distro failed. Usually I found I couldn't fix the problem with the limited commands available, so I would use any spare Live CD I ...
5
votes
3answers
3k views

Windows 7 batch file: Why are these IF blocks keeping me from assigning variables to a value?

Here's the broken batch file: @echo off if prod==prod ( if xps==xps ( set i1=prodxpsi1 set i2=prodxpsi2 set e1=prodxpse1 set e2=prodxpse2 ) else ( set ...
5
votes
3answers
162 views

On windows commandline, how do I get a dynamic prompt that tells me where in the filesystem I am?

I am trying to modify my CMD, to show only current dir name dynamically like: Desktop $ When i switched the folder, it must be updated. It is not required to be code in purely batch file, it may ...
5
votes
4answers
4k views

How to prevent password popup everytime for changing network configuration in OS X Mountain Lion?

I have a few network scripts that I used under OS X Lion that automatically created a ssh connection and then changed network configuration on my local machine to run traffic through the ssh tunnel. ...
5
votes
1answer
450 views

Right and fast way to test git directory and git branch?

While trying to set up my new fish shell prompt, I ended up testing ways to get the branch name and also testing if I was on a git repository. I have found (1) git rev-parse --abbrev-ref HEAD, (2) git ...
4
votes
2answers
3k views

How do I hide the path in command line prompt on Windows?

I'm working on Windows 7 using the cmd console. How do I hide the path in the prompt?
4
votes
2answers
356 views

Do I need to enclose ANSI escape sequences in \[ and \] in a bash prompt?

I want to customize my bash prompt using ANSI escape codes and have noticed that in some howtos the codes are enclosed in \[ and \] while in others they aren't. For example, these work equally well ...
4
votes
3answers
2k views

Get Function Into PS1 (Zsh)?

This works in Bash (parse_git_branch is a defined function) export PS1="\$(parse_git_branch)" but I cannot figure out the equivalent in zsh. Note: If I do PROMPT="$(parse_git_branch)" it seems ...
4
votes
1answer
6k views

Windows 7 command prompt: rename files located on a network path (UNC path)

In the command prompt, I need a way up rename a file on a remote server. Conceptually, this is what I am looking for: ren \\servername\folder\file.txt \\servername\folder\file2.txt Aside from using ...
4
votes
2answers
350 views

Is it possible to get bash to display the first letter of each directory in my working path?

For example working in: /home/stuart/src/project/com/example/package /usr/lib/python2.6 would appear as: ~/s/p/c/e/package$ /u/l/python2.6$
4
votes
1answer
100 views

Force prompt on specific directories

Is there a way to change the prompt on a different directories on the same machine? For example, I want a simple prompt "[\W] \$" in development directories. Ideas?
4
votes
2answers
1k views

Get current window number for bash prompt

I want to replace status bar with bash prompt displaying window number like ①. How can I get current window number in the shell? There's TMUX_PANE env variable, unfortunately no TMUX_WINDOW. The ...
4
votes
1answer
811 views

Change hostname and prompt in OS X terminal

On a Mac the hostname and prompt is: workstation:~ thomas$ On Ubuntu Linux it would be: thomas@workstation:~$ How can I make the OS X prompt look like the Ubuntu one?
4
votes
1answer
2k views

tmux: sharing current window title (#T) from within nested tmux sessions

I have begun using tmux recently to really improve my terminal sessions. One thing I need to be able to do is connect to a remote server, which is also running tmux. However, I have found that the ...
4
votes
2answers
110 views

Customizing command window prompt

I am running a bunch of commands in a command prompt on a Windows server over a period of time and I would like to see when I last ran a command. I used the prompt command to customize the prompt. ...
3
votes
2answers
182 views

How to answer a prompt in a batch file

Per suggestion I added /ad to return only dirs, but continue to get prompted. The prompt suggests it wants to know whether to create a file or directory. How do I automate the answer in a batch ...
3
votes
1answer
2k views

How do I change shell prompt permanently?

I use PS=$ to change the shell prompt to $, but when I restart the shell, I have to do it again. Is there a way to change the shell prompt permanently?
3
votes
1answer
859 views

Bash command prompt overwrites the current line

My bash command prompt is: \e[32;1m[\e[m\h.\u \e[33;1m\W\e[m\e[32;1m]\e[0;36m::\e[m There must be something wrong with it, because on long lines, the current line is overwritten, instead of ...
3
votes
2answers
1k views

How to make bash update its idea of hostname

My bash prompt shows my hostname. If I change my hostname with the hostname command, in /etc/hosts, /etc/hostname and $HOSTNAME, the prompt still uses the old name. Is it possible to update this ...
3
votes
1answer
234 views

Why does this bash prompt sometimes keep part of previous commands when scrolling history?

My bash prompt, which I'll admit to have stolen from a few places and cobbled together, will sometimes add part of previous commands to its length when scrolling the bash history with up/down arrows. ...
3
votes
1answer
174 views

Why is my bash prompt repeating its last line twice, when I ls, or cd or issue misc commands?

My prompt is such: PS1="\[\033[32m\]\u@myserver\n\[\033[33m\w$\033[0m\] " So as output after I ls i see this: jake@myserver ~/public_html$ ~/public_html$ When I should only (I think) see: ...
3
votes
1answer
32 views

bash's command number ( \# ) equivalent in zsh

I'm looking for a character to put in my zsh's $PROMPT that would be equivalent to bash's \# (the command number of this command, according to this site). So far I've found only %h but this is not ...
3
votes
1answer
977 views

Ubuntu 12.10 - How to change login screen to allow login to active directory domain

So, I have an Ubuntu 12.10 machine that has been joined to an active directory domain. However, when the machine turns on and I am presented with a login screen, I cant just type DOMAIN\user. All ...
3
votes
1answer
193 views

Why my Network Connection Properties don't show UAC prompt & settings change everytime I connect?

I can't set my network connection interface properties, UAC prompt doesn't appear anymore for only this adapter interface. I disable Netbios but each time I connect it changes back to default. Earlier ...
2
votes
4answers
7k views

xcopy Not Surpressing File/Directory Query

Hey folks, I'm attempting to use xcopy to copy over a file from one machine to another on our network as part of a Java program. I'm calling xcopy like this: xcopy "C:\Program Files\path\to\my\file" ...
2
votes
3answers
1k views

How to change prompt in jailshell

My ISP has switched to jailshell at some point, and now when I SSH in my prompt is always: -jailshell-3.2$ I'd like it to be: `pwd` $ Where do I configure this? I seem to recall some kind of ...
2
votes
2answers
2k views

Default prompt for Zsh in Ubuntu

How can you get the prompt "/home/user@address:/path" for Zsh? I run the following unsuccessfully in my .zshrc PROMPT='%d%>:%{\e[0m%} ' I get as my prompt /home/masi
2
votes
1answer
299 views

How can I minimise my Bash shell prompt?

Currently the terminal prompt looks like this: [karlis@karlis-desktop current_folder]$ How can I minimize the prompt, so that it only shows $ or # without extra info in square brackets? I checked ...
2
votes
1answer
71 views

how to open cmd from gvim without waiting the cmd window to be closed

In gvim I can open cmd typying :!cmd, but gvim keeps waiting for the cmd window to be closed. Is there a way to tell gvim NOT to wait?
2
votes
1answer
206 views

Prevent zsh from setting the current prompt to the name of the variable that points to this path

This is related to Zsh: Open a new tab in the same directory. I have installed oh-my-zsh recently and it certainly kicks. I have some custom variables, like $WORKSPACE which I use to get around ...
2
votes
1answer
583 views

colorized bash prompt overwrites previous command's output if the output doesn't end with a newline

On my system, when using a colorized prompt, the last line of the previous command's output gets overwritten if the last character of the output isn't a newline. Ex: Using the default, non-colored ...
2
votes
1answer
4k views

modify login prompt or header (/etc/issue) to display ip address of the machine

I work with a lot of virtual machines. For testing and preproduction set up. I would like the login promt or header to display the ip address of the machine. That way when I start it up I can see ...