Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [.bash-profile]

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

0
votes
1answer
40 views

Programmatically update bash_profile exports

I have a program which generates some temporary security tokens in a file. I then have to manually copy the tokens from this file and paste it in my bash profile to proceed further.Tokens expire every ...
0
votes
0answers
15 views

No value for $TERM and no -T specified Ubuntu LTS 18.04

I edited my .bashrc and .bash_profile files in the home directory for both the user and root. Everything works perfectly. About a week later, upon reboot I get this error, but everything still works ...
0
votes
0answers
27 views

Why does symlink to VLC break but but .bash_profile alias works?

problem I can execute VLC from the command line using a .bash_profile alias but not using a sym link. 📝 VLC is located at /Applications/VLC.app/Contents/MacOS/VLC on my machine sym link I tried ...
1
vote
2answers
732 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....
11
votes
4answers
6k 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 ...
0
votes
1answer
251 views

How to revert my .bash_profile changes?

I added the below given simple two commands in my .bash_profile - export PS1="___________________ | \w @ \h (\u) \n| => " export PS2="| => " Then commiting them through the source ....
0
votes
0answers
34 views

Execute `ls` whenever user does a `cd` on terminal [duplicate]

I know bashrc is executed on terminal startup. But my use case is something like this, To execute a specific command, say ls, whenever user executes another specific command, say cd, on the ...
0
votes
1answer
285 views

Run command in bash_profile only when in MINGW64

I am using git bash, and in my .bash_profile I have cd Which works when I start MINGW64, but when I open vscode, the console also runs that command. Is there any way for me to only run the cd ...
1
vote
0answers
99 views

Is there a way to enable fuzzy Bash auto-completion like Intellij has?

I use Intellij a lot, and one of the features I love is the auto-completion. Notice how you can skip letters in your input and it guesses what you want based on those letters: Is there a way to ...
0
votes
1answer
124 views

iTerm2: weird error message when I try to source a configuration file

iTerm2 3.0.15 OS X 10.11.6 I tried recently to configure my terminal, after a clean install. My problem is that when I do it, I get a weird error message. I go in my .bash directory; In it, I have ...
0
votes
1answer
154 views

Adding export utf8 to /etc/profile not working

Trying to set the locale in debian:stretch to utf8. I build a docker image which I then use. Apart of my Dockerfile: # Set locale RUN sed --in-place '/en_US.UTF-8/s/^# //' /etc/locale.gen && \...
-2
votes
1answer
53 views

This prompt makes terminals wrap mid screen why? [duplicate]

I've the following PS1 prompt: export PS1="\e[1m\e[38;5;198m\u\e[0m @ \e[1m\e[38;5;208m\h\e[0m : \e[1m\w\e[0m\e[38;5;226m\$(parse_git_branch)\e[0m \e[1m>>>\e[0m " what happens is that when ...
1
vote
1answer
6k views

What is the right way to set $PATH variable in zshrc

When I first install zsh(oh-my-zsh), the ~/.zshrc file has the following lines by default - # If you come from bash you might have to change your $PATH. # export PATH=$HOME/bin:/usr/local/bin:$PATH ...
0
votes
1answer
156 views

How to use a bash profile function to connect remotely and access the remote terminal

I want to write a bash function locally (on MacOS), so when I run this function the first command is to get connected to an ubuntu Remote Desktop through ssh. In a nutshell: my_func () { ssh ...
0
votes
1answer
201 views

Adding git commands to bash profile

I am using OSX and wish to add a function in terminal to run a set of git commands. Therefore, I created a .bash_profile in my home directory with the code below: # Setting PATH for Python 2.7 # The ...
5
votes
2answers
107 views

How to load parts of bash alias only when logging in via ssh [duplicate]

As the title states, is it possible to have an alias only load when I access the machine through ssh, or better yet, only from a specific computer through ssh?
10
votes
3answers
3k views

`ssh <host>` is a login shell, but `ssh <host> <command>` is not?

I've noticed that when I run a command directly on an SSH host using the ssh <host> <command> syntax, I see the output of .bashrc but not the output of .bash_profile (or .profile). For ...
-2
votes
2answers
304 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 $~ ...
1
vote
0answers
87 views

Fonts are different in vim under byobu compared to vim under screen and normal terminal

The font shows different in vim under normal bash and vim under byobu. Attached is a screenshot. This is the default byobu setting as soon as I do an apt install byobu. However, the font looks normal ...
0
votes
1answer
1k views

.bashrc not automatically initalising?

When opening a new terminal, I need to do source ~/.bashrc or source ~./bash_profile before my $PATH variable is initalised. I thought .bashrc did this automatically? How do I make it so I don't need ...
1
vote
3answers
1k views

Win10: VS Code integrated bash not loading ~/.bash_profile

As the title suggest, when I start my git bash regularly it loads my ~/.bash_profile but the one integrated in my VS Code is not loading it. Where can I put .bash_profile so that it would also load ...
0
votes
1answer
231 views

How to check where my PATH is modified?

I have in my PATH a folder destination included which does not exist any more. Still I just can't find in which file is it set. I checked for .bashrc, .profile, .bash_profile does not exist. Is there ...
0
votes
0answers
210 views

How to make an alias for openvpn passing sudo password?

I'm trying to create an alias in my .bash_profile, as you can tell I'm new in Linux. This actually runs, but it gets frozen without asking me for my password. alias convpn = 'cd ~/folder; echo <...
1
vote
4answers
1k views

Screwed up PATH in ~/.bash_profile, now cannot edit it

I actually screwed up the $PATH variable in my ~/.bash_profile while installing some software. Instead of using export PATH=$PATH:/some/other/path I idiotically did this export PATH=~/some/other/...
0
votes
1answer
101 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 ...
0
votes
3answers
4k views

bash command on mac terminal not working anymore

I have been trying to install blastn on my mac, but while doing messed up my bash command i guess (not a specialist...) - using the nano command nano ~/.profile - i`ve changed my PATH; export PATH=/...
0
votes
2answers
74 views

Bash profile commands with multiple "'` issues

Good day! I'm currently trying to get the following alias to work. 'git_fetch' and 'git_tree' are custom alias so dont worry about them. alias git_workspace='osascript -e 'tell application "Terminal"...
0
votes
2answers
77 views

Extra Character Display in Terminal Command Prompt

I started to see an extra bracket on my Mac Terminal I thought it is because of my .bash_profile that I might have broke when I modified it. But NO. I comment the whole file out and I still see ...
0
votes
2answers
65 views

Default parameters for command in bash

Setting up a new development VM, and I'm hoping to make it so that the default MySQL user is always a specific user unless otherwise specified. Ideal command: $ mysql # translates to mysql -uMyUser -...
0
votes
1answer
200 views

.bashrc running an alias without my approval: fatal: Not a git repository (or any of the parent directories): .git

I have this in bash_profile, I've narrowed the culprit to: alias initialpush="git push -u origin `git symbolic-ref --short -q HEAD`" I cannot properly source bash_profile: cchilders:~ $ src fatal: ...
1
vote
2answers
574 views

Moving a sudo command from bash_profile

I'm using Mac OS X El Capitan. Because of Eclipse Che, I need these lines on .bash_profile export DOCKER_VM_IP=$(docker run --rm --net host alpine sh -c "ip a show eth0" | grep 'inet ' | cut -d/ -f1 |...
1
vote
2answers
517 views

need to source bash_profile in each new iterm window

I am on macbook pro, el capitan. I have aliases set in .bash_profile, which work in the first instance of iTerm, however they are not recognized if I open a new iTerm instance, I have to do source ~/....
0
votes
2answers
71 views

running chained bash function commands in background

I am attempting to call port() { fuser -k $1/tcp; python manage.py runserver $1 ;} runproject() { cd $HOME/projects/$1 ; workon $1 ; port $2 & ; sleep 3 ; google-chrome 127.0.0.1:$2 ;} (port is ...
0
votes
1answer
49 views

recover the currently loaded scripts in bash

I just typed rm ~/.profile instead of vim ~/.profile. I have several terminal windows open still. Can I recover this easily, based on what was run when a different terminal started?
4
votes
3answers
130 views

Periodically source shell profile

I'm a zsh user, but this should apply to any shell in theory. When I edit my .zshrc to add a new alias, I have to source ~/.zshrc in all of my open terminal tabs/windows to be able to use the new ...
5
votes
1answer
659 views

Execute same command for each non-interactive bash session

I need to implement some config - I need to execute some code, if someone on my system calls for bash command in any form (interactive, non-interactive and bash -c form). For example this is command I ...
2
votes
1answer
902 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 ...
0
votes
1answer
979 views

Where is .bash_profile?

I'm trying to follow the instructions here: http://www.ladysign-apps.com/developer/mac-osx-run-sublime-from-your-terminal/#.Vj0ZfYRqmj4. Where is .bash_profile located? I see a .bash_profile.swp in ...
0
votes
2answers
898 views

.bashrc/.bash_profile not loading export

I'm trying to compile code and in order to get it to work I need to run the following line before compilation: export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig After this the code compiles normally, ...
0
votes
1answer
52 views

Add a command to user terminal profile?

Every time I start a new terminal, I have to type nvm use 4.1.1 to get my node version selected. Is there a way to get this to be 'typed' or added to some environment variable when I open a new ...
2
votes
1answer
6k views

Why does mac iterm and iterm2 not source .bashrc or .bash_profile?

I have ready many posts related to login/non-login and interactive/non-interactive. It would be my understanding that .bashrc should be sourced from iterm - which is interactive logon shell. It is ...
3
votes
2answers
347 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
267 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
156 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
895 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 ...
2
votes
1answer
68 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 ...
0
votes
2answers
141 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 ...
3
votes
1answer
2k 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 bourne-...
0
votes
1answer
347 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
109 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 "./...