Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Changing the UNIX command prompt Post 20189 by WERUreo on Monday 22nd of April 2002 10:39:10 PM
Old 04-22-2002
Changing the UNIX command prompt

I am having a hard time figuring out how to change the command prompt in my UNIX shell.

I am using the bash shell, and I would like to set the prompt to show me the full path of the current working directory along with my username, I suppose... The main thing I want is the full path of the current working directory.

This is for a web hosting shell account... I have three files in my root directory: local.cshrc, local.profile, and local.login. I know I need to put something in one of these files, but I'm not sure. Any help would be appreciated...

Keli'i Martin
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Changing Unix Prompt

Me again, What is the difficulty to display the full directory Path before my prompt command ? (like DOS) I'm using Solaris 8 + Bash Thanks again Fabien (4 Replies)
Discussion started by: unclefab
4 Replies

2. UNIX for Dummies Questions & Answers

Changing the prompt

Phew simple question, I want to display the my directory path in prompt. Did the following in .profile PS1=`pwd` export PS! Worked, but it always points to HOME directory. When i do a cd, it doesn't change. What am i missing. Thanks (7 Replies)
Discussion started by: vibhor_agarwali
7 Replies

3. UNIX for Dummies Questions & Answers

Changing Prompt in sh

I know no one has ever asked this before {not :D } but I am trying to set the prompt in the .profile under sh. I have tried everything I have seen on the web in regards to this, with no success. The OS is SCO Unixware 7.1.1, {not by my choice}. All the examples I see seem to be for ksh, which is... (1 Reply)
Discussion started by: jcc5169
1 Replies

4. Shell Programming and Scripting

Changing text in the command prompt

Hi, I want to change my command prompt to contain the current username and the current directory in it, instead of just the '$' symbol. I tried the command:- export PS1="$(echo \\n$) " But whenever I switch the user or change the directory, the changes are not reflected in the command... (10 Replies)
Discussion started by: unipepper
10 Replies

5. UNIX for Dummies Questions & Answers

Unable to get the db2 command prompt in unix

Hi, When i try to connect to the db2 database from unix solaris 5.8 version by typing "db2" from the .../sqllib/bin/ folder, i am not getting the db2 command prompt. Could anyone help me resolve this? Here the db2 is executable only. But still iam not getting the db2 prompt. The error i get is... (4 Replies)
Discussion started by: ragavhere
4 Replies

6. Solaris

Changing prompt

I currently have this as my prompt when I log in (shell is sh): PS1="`hostname ` # " My question is how do I add the current directory to that prompt? Is there a way? Thanks. (5 Replies)
Discussion started by: kjbaumann
5 Replies

7. UNIX for Advanced & Expert Users

Entire Input command not visible in Unix prompt

Hi, While typing the Unix command, entire command is not visible.When the input command is long, it is not visible. I want the entire command to be displayed when i type it. Please help to resolve this issue. Thanks Sampath (7 Replies)
Discussion started by: sampath.giri
7 Replies

8. Shell Programming and Scripting

Use Unix shell script to open Windows command prompt (cmd)

Hello, I work on Windows and I use Putty to access a remote UNIX server. I am trying to build a shell script that will have as main task to open the Windows command prompt (cmd) and run some Windows commands thereafter. The commands are actually file transfer commands that will download a file... (14 Replies)
Discussion started by: rookie2785
14 Replies

9. UNIX Desktop Questions & Answers

Can Unix access Windows' File through Command Prompt in Unix

Hi all, I wish to know whether Unix can access window's file in Unix's terminal? Apart from that, how to copy files or share files between Window and Unix? I get to know of secure copy, however, my company's Unix does not support the feature of secure copy? Any other method for me to share/... (5 Replies)
Discussion started by: jessy83
5 Replies

10. UNIX for Dummies Questions & Answers

[Solved] Help needed to have changing value to the command prompt string variable PS1

Hi, I am using git bash terminal window to do git operations. I have set the prompt string variable PS1 in the ~/.bashrc file as follows: export PS1=" " This is intended to show me the current git branch's name which is active as part of the prompt string. But, the problem is when I do a git... (2 Replies)
Discussion started by: royalibrahim
2 Replies
GIT-SH(1)																 GIT-SH(1)

NAME
git-sh -- a git shell SYNOPSIS
git-sh DESCRIPTION
git-sh starts an interactive bash(1) session modified for git-heavy workflows. Typical usage is to change into the directory of a git work tree or bare repository and run the git-sh command to start an interactive shell session. Top-level command aliases are created for all core git(1) subcommands, git-sh builtin aliases (see BUILTIN ALIASES), and git command aliases defined in ~/.gitconfig. BUILTIN ALIASES
git-sh loads a set of standard aliases in addition to all core git commands. The builtin aliases are overridden by aliases defined in the user or system gitconfig files. a git add b git branch c git checkout d git diff f git fetch --prune k git cherry-pick l git log --pretty=oneline --abbrev-commit n git commit --verbose --amend r git remote s git commit --dry-run --short t git diff --cached The Staging Area a git add aa git add --update (mnemonic: "add all") stage git add ap git add --patch p git diff --cached (mnemonic: "patch") ps git diff --cached --stat (mnemonic: "patch stat") unstage git reset HEAD Commits and Commit History ci git commit --verbose ca git commit --verbose --all amend git commit --verbose --amend n git commit --verbose --amend k git cherry-pick re git rebase --interactive pop git reset --soft HEAD^ peek git log -p --max-count=1 Fetching and Pulling f git fetch pm git pull (mnemonic: "pull merge") pr git pull --rebase (mnemonic: "pull rebase") Miscellaneous Commands d git diff ds git diff --stat (mnemonic: "diff stat") hard git reset --hard soft git reset --soft scrap git checkout HEAD CUSTOM ALIASES
Anything defined in the [alias] section of the repository, user, or system git config files are also available as top-level shell commands. Assuming a ~/.gitconfig that looked like this: [alias] ci = commit --verbose ca = commit -a d = diff s = status thanks = !git-thanks ... you might then have the following shell session: master!something> echo "stuff" >somefile master!something*> s M somefile master!something*> d diff --git a/somefile b/somefile -- a/somefile ++ b/somefile @@ -0,0 +1 @@ + stuff master!something*> ca -m "add stuff" master!something> thanks HEAD PROMPT The default prompt shows the current branch, a bang (!), and then the relative path to the current working directory from the root of the work tree. If the work tree includes modified files that have not yet been staged, a dirty status indicator (*) is also displayed. The git-sh prompt includes ANSI colors when the git color.ui option is set and enabled. To enable git-sh's prompt colors explicitly, set the color.sh config value to auto: $ git config --global color.sh auto Customize prompt colors by setting the color.sh.branch, color.sh.workdir, and color.sh.dirty git config values: $ git config --global color.sh.branch 'yellow reverse' $ git config --global color.sh.workdir 'blue bold' $ git config --global color.sh.dirty 'red' See colors in git for information. COMPLETION
Bash completion support is automatically enabled for all git built-in commands and also for aliases defined in the user ~/.gitconfig file. The auto-completion logic is smart enough to know an alias d that expands to git-diff should use the same completion configuration as the git-diff command. The completion code is a slightly modified version of the git bash completion script shipped with the core git distribution. The script is built into thegit-sh executable at compile time and need not be obtained or installed separately. CUSTOMIZING
Most git-sh behavior can be configured by editing the user or system gitconfig files (~/.gitconfig and /etc/gitconfig) either by hand or using git-config(1). The [alias] section is used to create basic command aliases. The /etc/gitshrc and ~/.gitshrc files are sourced (in that order) immediately before the shell becomes interactive. The ~/.bashrc file is sourced before either /etc/gitshrc or ~/.gitshrc. Any bash customizations defined there and not explicitly overrid- den by git-sh are also available. ENVIRONMENT
PS1 Set to the dynamic git-sh prompt. This can be customized in the ~/.gitshrc or /etc/gitshrc files. GIT_DIR Explicitly set the path to the git repository instead of assuming the nearest .git path. GIT_WORK_TREE Explicitly set the path to the root of the work tree instead of assuming the nearest parent directory with a .git repository. SEE ALSO
bash(1), git(1), git-config(1),http://github.com/rtomayko/git-sh Ryan Tomayko March 2010 GIT-SH(1)
All times are GMT -4. The time now is 08:58 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy