Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I get a load of stuff when I type the word


in mac osx 10.8 terminal.

I only recognise a tiny bit of it is in my .profile and .bashrc files. I have looked also in /etc/paths

I cannot find where the output comes from. I have been searching about for a good while now and nothing extra has come up. Where is this command pulling the information output on the terminal from exactly?

e.g. this function update_terminal_cwd ()

share|improve this question

closed as off topic by Wesley, Dennis Kaarsemaker, Jenny D, mdpc, Khaled Mar 31 '13 at 7:15

Questions on Server Fault are expected to relate to server, networking, or related infrastructure administration within the scope defined by the community. Consider editing the question or leaving comments for improvement if you believe the question can be reworded to fit within the scope. Read more about reopening questions here.If this question can be reworded to fit the rules in the help center, please edit the question.

Different things come from different places. We don't know what "stuff" you're asking about. – David Schwartz Mar 30 '13 at 3:45
@DavidSchwartz added example. – Magpie Mar 30 '13 at 3:52
Check /etc/bashrc. – David Schwartz Mar 30 '13 at 4:03
I had done that firstly @DavidSchwartz – Magpie Apr 8 '13 at 0:44
up vote 2 down vote accepted

set is showing you all environmental variables and builtin functions that exist on your machine and in your shell among other information gathered.

If you want to know the full story, check the source code for the builtin.

To address your example, update_terminal_cwd is in the default systemwide .bashrc file:

# System-wide .bashrc file for interactive bash(1) shells.
if [ -z "$PS1" ]; then

PS1='\h:\W \u\$ '
# Make bash check its window size after a process completes
shopt -s checkwinsize
# Tell the terminal about the working directory at each prompt.
if [ "$TERM_PROGRAM" == "Apple_Terminal" ] && [ -z "$INSIDE_EMACS" ]; then
    update_terminal_cwd() {
        # Identify the directory using a "file:" scheme URL,
        # including the host name to disambiguate local vs.
        # remote connections. Percent-escape spaces.
    local SEARCH=' '
    local REPLACE='%20'
    local PWD_URL="file://$HOSTNAME${PWD//$SEARCH/$REPLACE}"
    printf '\e]7;%s\a' "$PWD_URL"
    PROMPT_COMMAND="update_terminal_cwd; $PROMPT_COMMAND"
share|improve this answer
Thank you. Although there's still work to do I think you answered as completely you could given the situation. Aside from that I have been trying to find the place where my PS1 is set for ages and finally I can get rid of the annoying PS1='\h:\W \u\$ 'and replace it with PS1='> ' thanks to you +1 – Magpie Mar 30 '13 at 4:46

Not the answer you're looking for? Browse other questions tagged or ask your own question.