Questions tagged [prompt]

The prompt is a series of characters used by any terminal interface to indicate that the terminal is ready to receive another command. Questions using this tag should be restricted to questions about the prompt, how to customize it, etc.

The command prompt (or just prompt for short) is a feature of any terminal system that lets a user know that the terminal is ready for its next command.

In most systems, the prompt can be customized or altered by editing various variables or configs (for example, Bash allows editing of PS1 to change the prompt).

By default, the Ubuntu prompt (through Bash) will look something like this:

ubuntu@ubuntu:~$
184 questions
253
votes
7 answers

Why does "(base)" appear in front of my terminal prompt?

I'm wondering why I have (base) on the left of my terminal prompt. If I run source ~/.profile in the terminal, it disappears. If I close that terminal and reopen a new terminal, (base) is there again. I'd like to know what it is. Here's the content…
Jimmy
  • 2,633
240
votes
6 answers

How can I shorten my command line (bash) prompt?

Currently it is: michael@Castle2012-Ubuntu-laptop01:~/Dropnot/webs/rails_v3/linker/spec/controllers$ Outside of renaming my machine and directory structure... How could I make it be something more like: michael:controllers$
216
votes
7 answers

How can I make my shell prompt look like a cheeseburger?

I want my shell prompt to look like a cheeseburger! It would be nice if it also displayed: username, hostname, and current directory.
188
votes
5 answers

How can I install and use powerline plugin?

Powerline is a plug-in to display informational and beautiful statusline for vim, tmux and shell prompt for bash, zsh. Vim statusline: How can I install and setup Powerline for different applications and shells in Ubuntu?
156
votes
4 answers

What does "${debian_chroot:+($debian_chroot)}" do in my terminal prompt?

In my terminal prompt definition in my .bashrc file, among other things, I have this snippet of code: ${debian_chroot:+($debian_chroot)} What does this do, and do I need it?
fouric
  • 4,698
142
votes
6 answers

Changing colors for user, host, directory information in terminal command prompt

Is it possible to change the colors in the command prompt for the user@computer, as well as the the current directory and command parts of the prompt display? I've already seen something like this done by OSX users, but I don't know how to do the…
Luiz Rodrigo
  • 1,769
53
votes
3 answers

UTF-8 character not showing properly in tmux

I use ♪ character in my zsh theme's for prompt. But in tmux, my prompt was behaving weirdly, showing extra spaces, like this: ♪ ~ I can type from here ♪ ~ Instead of here like in zsh, and sometimes when I do stuff like cd ♪ ~ cd ~ ♪ ~ cdcd / ♪ ~…
Sourabh
  • 1,911
45
votes
10 answers

trim the terminal command prompt working directory

When using the terminal in a deep folder structure sometimes the prompt can take up most of the line. Is there any way in which I can trim the working directory? I know I can do PS1="\W >" to only print the current directory and not the full…
smauel
  • 553
30
votes
2 answers

Difference between $ and # in Linux environment

What is the difference between $ and # signs in Linux environment? As I started working on Linux and I found that both are different. I mean do they have different set of privileges? [root@localhost ~]# and [tom@localhost ~]$.
27
votes
2 answers

Why is my function not re-evaluated in PS1?

I'm trying to have a part of my prompt set dynamically by a function, so in my .bashrc I have: asdf () { echo -n $(pwd) } PS1="\u@\h:\w $(asdf)\$ " Opening a shell gives me what I expect at first: $ bash darthbith@server:~/test…
darthbith
  • 384
  • 3
  • 13
26
votes
7 answers

How do I stop Ubuntu from asking for my password every time I install something?

Whenever I try to install a program I get a password authentication prompt asking me to punch in my password. I would like to know how to disable this. I tried to google it and most of the stuff I find related to the login password, which isn't an…
21
votes
4 answers

Prepend current git branch in terminal

How can I configure the terminal to display the current git branch? I'd like to see the second line rather than the first: andy@bob:~/my_projects/project_x$ (master)~/my_projects/project_x$ I don't want to have to run git status to see which…
hayd
  • 2,397
20
votes
5 answers

How (and where) can one change 'user@host $:' pattern in gnome-terminal?

When I start terminal in Ubuntu, I see: ilya@HOST:~$ I need to add a timestamp to this, something like: 2011-10-09T09:32:00 ilya@HOST:~$ How can I configure this?
20
votes
4 answers

How do I prompt users with a GUI dialog box to choose file/directory path, via the command-line?

Suppose I have a script like this: (The example depicts an rysnc use case) #!/bin/bash echo -n "Enter Source Directory:" read srcdir echo -n "Enter Destination Directory:" read dstdir rsync -av --delete "$srcdir" "$dstdir" The idea here is to…
Pandya
  • 37,289
20
votes
5 answers

Changing behavior of bash prompt when functioning as root

Before you click away, this isn't the typical "how do I make my bash prompt have color" question. I've already customized my bash prompt to look like this: [user @ host]----[$(pwd)] $ where everything in brackets is light blue, and everything…
zmitchell
  • 303
  • 1
  • 2
  • 5
1
2 3
12 13