Questions tagged [.bash-profile]

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

Filter by
Sorted by
Tagged with
565 votes
6 answers
208k views

Difference between .bashrc and .bash_profile

What's the difference between .bashrc and .bash_profile and which one should I use?
cfischer's user avatar
  • 9,063
27 votes
3 answers
17k 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 ...
Alan W. Smith's user avatar
1 vote
2 answers
6k views

Can't export variable in .bash_profile ubuntu 18.04

I tried to export some variable. I create file .bash_profile and put inside export SPRING_PROFILES_ACTIVE=local After it I reboot my ubuntu, login, but nothing happens. My system is fresh ubuntu 18....
Vova Yatsyk's user avatar
39 votes
8 answers
62k 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 in ...
Charles R's user avatar
  • 521
22 votes
2 answers
73k views

Execute a command every time Terminal is open

I'm on Ubuntu 13.04 and I'd like to configure my terminal, so that every time a new tab/window is open, it executes the following command automatically and right away. /bin/bash --login How could I ...
if __name__ is None's user avatar
10 votes
4 answers
8k views

Open hidden configuration files without using Terminal

I made some changes to my .profile which corrupted the Terminal app. I can launch terminal but I no longer get a prompt. I can't show hidden files in order to delete the .profile or .bashrc files. ...
upbeat.linux's user avatar
-2 votes
2 answers
2k views

Calling a bash function isn't working as it should to change to recent directory?

So I expect my function to change to a recently modified directory. This is it: function cdrc { echo 'cd "$(ls -t | HEAD -1)"'; } When I want to change to a recent dir: $~ cd Desktop/Folder $~ ...
snapchatdotcom's user avatar
56 votes
6 answers
203k 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 ...
Jason Shultz's user avatar
48 votes
3 answers
74k views

Environment variables in bash_profile or bashrc?

I have found this question [blog]: Difference between .bashrc and .bash_profile very useful but after seeing the most voted answer (very good by the way) I have further questions. Towards the end of ...
Viriato's user avatar
  • 603
29 votes
2 answers
74k views

Bash not loading '.profile' in new session on Linux

I'm setting up a new Linux machine I got from our IT dept, and noticed .profile is not loaded when I start a new terminal session. The current shell is Bash, though I changed it from the default sh it ...
sa125's user avatar
  • 1,006
19 votes
6 answers
147k 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 ...
Strangeone's user avatar
14 votes
2 answers
4k 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 ....
well actually's user avatar
14 votes
4 answers
20k views

What does `>>` mean in terminal command?

I came across a command just now given below - $ echo 'eval "$(jenv init -)"' >> ~/.bash_profile From what i can guess, it is probably used for committing the changes in .bash_profile but ...
monster's user avatar
  • 315
12 votes
3 answers
23k views

Explain why .bash_logout won't run commands?

So I've been wondering how to run these two lines of code everytime I close an open instance of Terminal: history -c cat /dev/null > ~/.bash_history I export HISTFILE=5 on startup, but still want ...
yurisich's user avatar
  • 293
8 votes
1 answer
4k views

bash how to remove "__bp_precmd_invoke_cmd" error?

I get after each command the error bash: __bp_precmd_invoke_cmd: command not found even after the command is successfully executed. e.g. if I run the ls command I get the proper listing of the ...
mntk123's user avatar
  • 213
5 votes
3 answers
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 alias ...
Michael Prescott's user avatar
2 votes
1 answer
7k views

Where can I find bash_profile / bashrc themes?

I've been searching for bash_profile / bashrc themes on google for awhile but I'm not finding any kind of aggregation for themes. Most of them I find are small snippets like: export TERM="xterm-...
bob_cobb's user avatar
  • 249
1 vote
1 answer
1k views

Chaining terminal commands in .bash_profile [duplicate]

Possible Duplicate: On a Mac, how can I group together commands I want run into a alias? I have been using aliases for a while now but can't seem to figure out how to 'chain' commands properly. ...
Tom Wahlin's user avatar
0 votes
1 answer
241 views

How can I alias a binary dependent on the machine I am on

I work on different machines, some as centos7, some are centos6, I build a binary tmux with a different version on each 'type' as the same version cannot runn both. How can I tell my .bashrc to ...
statquant's user avatar
  • 245