2
votes
1answer
70 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 ...
0
votes
1answer
89 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 ...
0
votes
1answer
376 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
votes
1answer
97 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.
2
votes
1answer
97 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 ...
2
votes
1answer
131 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
144 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
123 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 ...
0
votes
1answer
292 views

Command line in OSX breaks when I edit bash_profile

Please help me, I am learning how to add sublime to command line from this link and when I created .bash_profile file, in the first line I typed export PATH= and saved it. My command line is broken. ...
0
votes
1answer
93 views

OS X - Adopt “command not found” behavior from Ubuntu

There is a question about overriding the default command not found behavior on Ubuntu. It is Here. I tried adding the following to ~/.bash_profile, /etc/bashrc and /etc/profile, but no luck: function ...
-1
votes
1answer
33 views

If environment settings are to be made persistent, where should I store them? [closed]

I want to make environment settings persistent. Where should I store them? I'm confused.
7
votes
2answers
8k 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 ...
1
vote
4answers
538 views

Unable to make bash default shell in freebsd

I wanted to change my default shell to bash in freebsd. I tried the following: 1.chsh -s /bin/bash (or /usr/local/bin/bash) <my_username> I get this error after entering the password: chsh: ...
4
votes
2answers
372 views

why error code 1 returned by loading .bash_profile in Mac

Whenever I open a bash terminal, the error code 1 is returned: Last login: Tue Jan 15 16:19:53 on ttys000 spam@moss:~ $ echo $? 1 I found this is caused by last line of code in my .bash_profile: ...
0
votes
2answers
589 views

Change bash_profile path order

To use the right PHP version on my command line I want to change the $PATH of my command line profile. For now, the command line uses the standard system php file located in /usr/bin/. I want to use ...
5
votes
3answers
12k 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 ...
1
vote
1answer
1k 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 ...
2
votes
0answers
281 views

Why does this line appear every time I launch iTerm on my MacBook?

So I use iTerm on my MacBook Air and also my MacBook Pro. I've been playing around with .bashrc and .bash_profile and trying to come up with clever ways to configure things. At one point I decided I ...
3
votes
1answer
558 views

How to make alias/function in .bash_profile for `curl` that takes an argument?

I found this tip super helpful, for using curl to resume an interrupted file copy. The full syntax is: curl -C - -O file:///Volumes/path/to/file I would like to add an alias or function called ...
1
vote
1answer
82 views

Custom prompt doesn't work on Mac's terminal

I like to use a custom prompt (current path in blue) on my unix machine: export PS1='\[\e[0;34m\]\w \$\[\e[m\] ' But when I try to use it on Mac's terminal it doesn't work: it fails to detect the ...
3
votes
1answer
56 views

Why am I not able to add directory in linux $PATH

I am trying to add ~/.bin into my path and for that I edited the .bash_profile and added the below line PATH=$PATH:$HOME/.bin/ and than I logged out/in. Now when I do echo $PATH I get ...
0
votes
1answer
499 views

Error in .bash_profile

I am using CentOS 6.2. This is my ~/.bash_profile content: # .bash_profile # Get the aliases and functions if [ -f ~/.bashrc ]; then . ~/.bashrc fi # User specific environment and startup ...
-2
votes
3answers
719 views

How to change $PATH?

I am not able to find 'ifconfig' command, So I need to modify $PATH variable. Can you provide the best way to modify $PATH varible, whenever I logged-in. [aaa@cyclrtp10 ~]$ ifconfig ifconfig: Command ...
0
votes
1answer
749 views

need help cleaning out my Path Variable in Mac

when I typed $PATH i noticed a jungle -bash: ...
0
votes
1answer
256 views

Bash Prompt Not Showing Colours (git)

I have the following in my .bash_profile, to give me git branch info in my bash prompt: # Configure colors, if available. if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then ...
1
vote
2answers
825 views

bash alias doesn't carry over with sudo

I'm curious if there's a way to get my .bash_profile to work when I sudo a program. For example, I have it set to alias emerge='emerge -av' so that I can install software, and it will always ask me ...
1
vote
1answer
690 views

Terminal not working: -bash: exit: with: numeric argument required what to do?

I was trying to install F# compiler and interactive on my Mac, and part of the installation process required providing aliases in the bash profile file. I suspect that I messed something up here, ...
1
vote
1answer
1k views

brew doctor giving error on a directory that has been removed

I just installed homebrew and as suggested, I ran the brew doctor command. I am linux newbie and do not know how to fix most of these things. But I would like to ask especially about the following ...
1
vote
1answer
3k views

To set PATH on OS X when export PATH= don't work

I can't do 'export PATH=' When I try that only .swp files is created (.bash_profile.swp and .bashrc.swp). I'm on OS X 10.6. $ echo $PATH ...
1
vote
2answers
17k views

Edit .bash_profile in OS X

How do I edit the bash_profile? I've tried using the command chflags but it shows the error [Error writing. Bash_profile: Operation not permitted] I'm using OS X Snow Leopard 10.6.8.
13
votes
2answers
15k 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 ...
4
votes
2answers
215 views

Why does bash sometimes think my $HOME isn't the correct directory?

Like the title says it seems that bash sometimes misidentifies my $HOME. This cropped up after a seemingly unique series of events that I will now replay in broad strokes. Running OS X 10.6 with ...
2
votes
8answers
694 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 ...
1
vote
2answers
593 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 ...
0
votes
2answers
157 views

command line alias versus .bash_profile alias

when I create this alias from the command line everything works fine alias ejecta='for I in 1 2 3; do /usr/sbin/diskutil unmountDisk disk$I;done' When the same alias is created in .bash_profile. the ...
2
votes
5answers
366 views

Multiple-command alias enters bash shell but fails to navigate to path

I have this alias defined to run bash then navigate to a certain folder but when I run it, it only runs bash and stays in the current path/directory/folder. I've defined them in two different ways in ...
0
votes
5answers
198 views

Bash: Switching from user to root causes issues with prompt

I am on a Mac, running Snow Leopard (if it matters). I am customizing my bash prompt to display things that get pulled from user specific places. For example, I am using Ruby Version Manager to manage ...
2
votes
2answers
625 views

Set ls to return colored results by default

In my .bashrc I have the following lines to turn on colors for grep and ls alias ls='ls --color=auto' export GREP_OPTIONS='--color=auto' I've tried changing the alias to export ...
0
votes
3answers
321 views

Issue with ./configure not being found

I recently upgraded to OSX Lion, and I have been clearing a lot of thing out in my dev environment that is not being used anymore. My ./configure has seem to have disappeared, and I have made sure ...
1
vote
1answer
87 views

Problem with bash profile

I modified my .bash_profile on my Mac (now running Tiger) to get a different command prompt. Before I did that, I used to be able to use the up arrow key to cycle through previously issued commands. ...
2
votes
4answers
3k views

Aliases in .bash_profile do not work

I have added some cd blah blah commands as alias in my .bash_login so as to ease changing directories.It was working fine .Suddenly though none of the aliases in there work .It says command not found ...
11
votes
5answers
31k 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. ...
0
votes
2answers
644 views

MacVim behaving strangely with my aliases (even setting shell=/bin/bash\ -l)

I wanted to write some scripts and have MacVim call some bash commands. I have some aliases and wanted vim to be able to call them, so I knew I needed a login shell, just didn't know how to make vim ...
2
votes
1answer
655 views

Overwrite ls in .bash_profile

I'm new to bash and unix. I'm trying to create an alias for ls. In my .bash_profile I have the following: alias ls="ls -lhHG" This doesn't work at all. If I change it to: alias la="ls -lhHG" ...
167
votes
3answers
47k views

Difference between .bashrc and .bash_profile

What's the difference between .bashrc and .bash_profile and which one should I use?
1
vote
3answers
4k views

I've broken my .bash_profile

In the course of trying to install something on my Mac OSX machine, I think I have broken my ~/.bash_profile file. I edited it, and suddenly, now, when I open a terminal, I can't run anything, or even ...
46
votes
5answers
80k 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?