Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

No pathname on command line

  1. Jul 27, 2007 #1

    J77

    User Avatar

    How do I set my system so that the entire pathname doesn't appear on the command line -- just the directory I'm in?

    eg. at the moment:

    me@me:/~$dir1/dir2/dir3

    What I want is:

    :dir3/

    (I know I'm me :biggrin:)
     
  2. jcsd
  3. Jul 27, 2007 #2

    CompuChip

    User Avatar
    Science Advisor
    Homework Helper

    On what system?
    In Ubuntu I know you would edit the $1 variable in the bash config file (~/bashrc or ~/.bashrc or something like that). It determines what shows up on the command line. I'm on a Windows system now thought, so I can't test it.
     
  4. Jul 27, 2007 #3

    J77

    User Avatar

    Sorry -- yes, ubuntu

    .bashrc worked, thanks :)
     
    Last edited: Jul 27, 2007
  5. Jul 27, 2007 #4
    The prompt appearance is set by PS1 environment variable. You can play with it in the current terminal window to get it to behave as you would like, and then write it for good into ~/.bashrc. The explanation of all elements and a few examples are given at http://tldp.org/HOWTO/Bash-Prompt-HOWTO/bash-prompt-escape-sequences.html

    However...

    ...this is a bold claim :)

    Experience in Unix shell usage is decades long, and the default settings reflect that. They are best left untouched unless one really knows what he is doing. Several years ago, I had the exact same "hey, it's too long" urge to change the shell prompt, and guess what, these days I am using the default prompt (note that in the final example on the link above, the user set yet even longer prompt).

    --
    Chusslove Illich (Часлав Илић)
     
  6. Jul 27, 2007 #5

    J77

    User Avatar

    Thanks Chusslove.

    Indeed, I played with the PS1 = ... and got it as I wanted: just a $ on the command line with the full path in the xterm title :smile:
     
  7. Jul 27, 2007 #6

    CompuChip

    User Avatar
    Science Advisor
    Homework Helper

    Err, that's what I meant :blushing:
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: No pathname on command line
  1. Command line argument (Replies: 16)

  2. Asterisk in pathname (Replies: 2)

Loading...