.bash_profile is one of the scripts the Bash shell reads and executes when started as an interactive login shell.

learn more… | top users | synonyms

1
vote
2answers
32 views

Is there a way to make my .bash_profile load the contents of my .profile file?

I was using a .profile quite happily for two years on my Mac now running Yosemite. A recent brew install created a .bash_profile and whilst my .profile still exists, it is now no longer loaded. I ...
0
votes
0answers
23 views

Running 'su - user sh -c “~/.profile”' returns “No such file” error

I have a shell script running as root with the following command: ssh remotehost 'su - user sh -c "source /home/user/.profile; <command>"' I get the following output: bash: su - user sh -c ...
0
votes
1answer
20 views

Is there a standard place to put my Aliases? bashhrc vs. bash_aliases

Is there a standard place to put custom aliases? If not, what are the benefits and disadvantages of .bash_aliases, .bashhrc, and .bash_profile?
1
vote
2answers
26 views

Create PATH for OS X Python virtualenv install

I'm a Terminal and Python newbie, but I'm using virtualenv a lot right now for a Python project. Changing directories manually to source the virtualenv in my filesystem is quite tedious, so I'm ...
12
votes
5answers
40k views

How to automatically execute a shell script when logging into Ubuntu

How do I get a script to execute automatically when I log in? Not when the machine starts up, and not for all users, but only when I (or any specific user with the script) login via the GNOME UI. ...
2
votes
1answer
39 views

Removed lines in .bash_history are still listed in history command. How to load the changes?

I removed command lines in my .bash_history. The problem is that when I execute the history command the deleted commands are still listed. How do I load the changes ? I tried source .bashrc and ...
60
votes
5answers
121k views

Where to find the .bashrc file on Mac OS X Snow Leopard and Lion?

I want to install rvm on my Snow Leopard machine. It says I need to add a line to my .bashrc file (I'm using bash) but where is my .bashrc file?
0
votes
2answers
36 views

Creating a bash routine

Everytime I log in into my work machine, I have to open a terminal and type the same routine: $ cd /Documents/some_folder/some_another_folder $ vagrant up $ vagrant ssh I'd like these commands to ...
5
votes
4answers
7k views

~/.profile is not loaded when using SSH (Ubuntu)

Edited to reflect the problem I really wanted to solve: I need to set up my ruby environment so I can deploy via Capistrano. export PATH=$HOME/.rbenv/bin:$PATH eval "$(rbenv init -)" I put these ...
1
vote
1answer
90 views

Non-interactive ssh sessions don't have PATH set on some systems

I set my environment in .profile. My .profile is idempotent and .bash_profile, .bashrc, .kshrc and .zshrc all source .profile. That way I always get the same environment regardless on what ...
2
votes
9answers
1k views

Command to search programs in Linux

Do you have any easy idea to define some alias in .bashrc for finding some command that you want to search (when you forgot its name) in your machine, visiting all "bin" directories, maybe using ...
0
votes
1answer
44 views

Mac .bash_profile.save How to make it run by itself / where to actually change paths

trying to change my path for Ruby / SASS. I have always used a file in my home called '.bash_profile.save' In there I have the export paths which work fine but only when I run: source ...
0
votes
1answer
42 views

Bash file error

When I type "./" followed by a file name, how do I find out which program is executing it? ie. I have some scripts like "derp.sh" that will execute if I type "/bin/bash derp.sh" but fail if I write ...
2
votes
1answer
78 views

In bash 4.3.27 “su” ignores user variables when combining “-” with “-c command”?

Since forever we used to launch user scripts from a different user crontab like this: 00 12 * * 1 su - user2 -c "/home/user2/myscript.sh" By doing this, the script is launched after the interactive ...
0
votes
2answers
79 views

Why do I add a path to ~/.bash_profile and source it, but there's no effect?

In my install.sh: # other commands to install java... echo 'export JAVA_HOME="/usr/java/latest"' >> ~/.bash_profile source ~/.bash_profile After this script runs, I type echo $JAVA_HOME, but ...
15
votes
3answers
12k views

MinGW Bash profile

I use MinGW on windows 7. I have a .bashrc with some aliases in it. The file is in my home folder which is where MinGW starts me in, so it also believes that the folder is my home folder. It does not ...
0
votes
1answer
553 views
0
votes
1answer
49 views

Configure bash_profile for one single terminal emulator

I am using a new terminal emulator. Terminology is the E17 default terminal, and it has a great command: tyls which is a "graphical" ls I want to create an alias just for this terminal, because the ...
4
votes
4answers
5k views

.bash_profile not sourced

I have a .bash_profile file that I added some stuff to (aliases and color and some git stuff) and when I open iTerm and source it then everything's fine and I have everything but when I close iTerm ...
0
votes
0answers
96 views

Entered wrong .bash_profile and now my laptop is running hot

I am just learning how to use the command line and was editing the bash prompt setting in .bash_profile. I made an error in the prompt settings in .bash_profile and I lost the prompt and the ability ...
1
vote
3answers
13k views

OS X Lion - Installing Oracle 10g Standard Edition

Im trying to install oracle 10g on to OS X Lion, I have previous achieved this on snow leopard with the following ...
0
votes
0answers
81 views

How to permanently make the Output of python codes to appear in a different color in the terminal?

I found it really annoying when I use terminal that everything is in one color. I am looking for a way to print the output of my python code in a different color on the terminal console, so it will ...
0
votes
1answer
52 views

How to store setings

I have made my .bashrc give me two types of prompts; longp: xanth@X-VboxTux:~➤➤➤ and shortp: ➤ I have done this by writing a 0 or a 1 to a file and then to determine what prompt should be shown ...
9
votes
3answers
4k views

Is it possible to override the command line's built in “cd” command?

Just about every time I 'cd' to a different directory on my machine (in this case, running Mac OS X 10.6.7) via the command line (which is bash), I immediately type 'ls' to get the list of contents in ...
9
votes
2answers
19k views

How can I fix a Broken Pipe error?

I recently reinstalled RVM (following the instructions at http://rvm.io) after a fresh install of Ubuntu 12.10 when I got an SSD Drive. Now, when I type: type rvm | head -1 I receive the following ...
5
votes
2answers
1k views

Mac OSX: Cannot color broken symlinks

On my linux machine, you can tell intact symlinks from broken ones, because broken ones are colored red. I've tried to set this up on my mac by adding some configurations to PSCOLORS in my ...
237
votes
3answers
69k views

Difference between .bashrc and .bash_profile

What's the difference between .bashrc and .bash_profile and which one should I use?
8
votes
3answers
28k views

How to reset Bash on Mac OSX, .bash_profile corrupted and bash no longer works

I am on a MacBook Pro, running the latest version of Mountain Lion. I really need some help, I have managed some how to damage my .bash_profile (I think) so that every time I open up the terminal I ...
3
votes
1answer
532 views

How can you remove duplicates from bash history?

Since I'm saving history from different sessions this is an issue where erasedups can't help because I'm using the following: PROMPT_COMMAND="$PROMPT_COMMAND;history -a" Is there an easy way to ...
3
votes
2answers
3k views

How do I close an OS X application from the command line using a alias defined in my .bash_profile?

I found the following shell script that can be used to tell an OS X application to quit: #!/bin/sh echo | osascript <<EOF tell application "$*" quit end tell EOF I have several simple ...
0
votes
1answer
21 views

BASH Variable substitution(?)

I have the following script: var1="var1value" var2="var2value" var3="var3value" I want to create the following code: option=$1 myvar=`echo var$option` So, when the option is "1" the myvar ...
0
votes
1answer
213 views

osx - change terminal-color based on user

what i want to achieve : everytime i log onto a machine via ssh with a specific user -> "danger" like ssh danger@somehost i want the terminal to change its background to red, so i have a visual ...
1
vote
1answer
395 views

Can .bash_profile automatically run without sourcing it in iTerm2?

I am using iTerm2 in Mavericks OSX and made sure I updated to the latest version. My working directory inside preferences is set to Home Directory. I was watching a tutorial on iTerm customization ...
1
vote
2answers
319 views

Is it possible to set color for the user input in bashrc?

Note that I only want user's input to have specific color (words that user has typed with keyboard), not the actual command's output. I tried: export PS1="$ \033[38;5;154m" I know that it should ...
1
vote
2answers
1k views

-bash: __git_ps1: command not found

I recently uninstalled Homebrew and Cellar (web dev applications), and this error now appears after every Terminal command (although I can't confirm that these are the culprits!): -bash: ...
0
votes
0answers
65 views

Unix commands not working

Recently been trying to install mysql and changed my bash_profile around a few times. My unix commands seem to be unresponsive to any of my commands. Need some help to get it back up and running. ...
0
votes
1answer
623 views

Can't use command line – “command not found” after editing PATH

I'm running OS X Mavericks and was trying to install MAMP PRO 2.2. I was trying to configure the PATH variable to have the PHP binaries of MAMP PRO. I added the following line on my ~/.bash_profile ...
2
votes
1answer
124 views

Script acting strange in bash_profile (but just under X)

I have made a simple .sh script which checks every minute whether a particular file is empty or not, and if it is not empty, makes a led on my laptop blink at 0.5Hz. I call this script from my ...
0
votes
1answer
809 views

Recover lost .bashrc

So I did something exceedingly stupid and now my .bashrc file is gone. Is there any way for me to recover it? I still have a terminal window open that uses the old bashrc file. If there's no way for ...
1
vote
2answers
647 views

Why does OS X Lion's terminal treat the PS1 prompt codes differently than Snow Leopard?

I get different behaviors in terminal with the same prompt definition in Snow Leopard and Lion. On my Snow Leopard system, I define my terminal prompt in .profile as follows: export ...
1
vote
1answer
122 views

Alias for viewing logs with todays date

I want to create an alias: alias readFile='ls file1.todaysdate' where todaysdate is in format 130714. How would i do this?
2
votes
1answer
3k views

.profile and .bash_profile ignored when starting tmux from .bashrc?

I've been having an issue with getting my .profile to be sourced when SSHing into an Ubuntu 12.04 server instance. My .bashrc does the following towards the end: if [[ "$TERM" != "screen-256color" ]] ...
-1
votes
1answer
163 views

Can't load a .bash_profile on windows powershell

I'm looking to load a .bash_profile with some aliases and functions on launch but, I haven't been able to find a way to load the .bash_profile. I'm not even sure if it is possible.
4
votes
2answers
7k views

How do I create a terminal shortcut to this path?

So I'm having a problem creating a shortcut to a deep folder. None of the examples I've seen on Superuser have helped :( This is my path: cd / Applications / MAMP / htdocs / whoat / solr / whoat I ...
20
votes
2answers
23k views

How do I modify my git bash profile in Windows?

I'm using Git Bash on Windows 7 and would like to set up bash profile aliases such as alias gs='git status' to make my life easier. How can I do this?
2
votes
1answer
2k views

Error when installing and trying to get version of SASS via Terminal

Not sure what is going on, I was able to install git via the terminal (had to create a bash_profile). Now I installed ruby and did install sass. However when I did sass --version I got a bash error? ...
8
votes
5answers
969 views

Syncing bash profile between computers

I have tons of stuff in my .bash_profile. The problem is, I use ~3 computers very frequently, and I'm tired of having to copy paste my prefs everywhere. Two of them run Ubuntu 10.10, and one runs OSX. ...
2
votes
1answer
182 views

Sort out where to put my bash commands, alias, and configurations

It seems to me that every Linux distro that I SSH into or use locally (Mostly RHEL/CentOS and Debian/Ubuntu machines) have a different idea about which of .bashrc and .bash_profile to run when I log ...
0
votes
2answers
183 views

.bash_profile wont run on login

I am trying to set up my computer so that the escape key performs the caps lock function and caps lock performs the escape key function. I have a small script to swap my escape and caps lock using ...
1
vote
3answers
187 views

bash: repeatedly executed script in .bash_profile blocks login

I have a bash script (let's call it script.sh) which looks like this while true; do if [ $someFile -eq = "1" ] then # make laptop LED blink here fi done So when some file has some value ...