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
0
votes
0answers
31 views

How to configure WSL sessions.json to source my .bash_profile

I'm a regular WSL on Windows 10, and I open an Ubuntu terminal every day and do some startup processes. I'd like to create some aliases in my .bash_profile, however, when I open the terminal, the ....
1
vote
0answers
21 views

Bash and Zsh profile confusion

I'm on a mac and am about to start developing, did a clean install on my mac just but my question is what is the difference between ~/.bash_profile, ~/.zshrc, ~/.profile, and ~/.bashrc and where can I ...
0
votes
1answer
32 views

$PATH variable is messed up, where is it being sourced from in Mac Catalina

When I echo $PATH in terminal, I see a big string that kind of looks messed and has some old irrelevant paths. I would like to fix this. But first, I'd like to understand when I echo $PATH in terminal,...
0
votes
1answer
91 views

ssh on environment variables on remote machine

how to export environment variables to the remote machine to the specific user. I am using below command to do export but the echo is returning empty. I thought to approach in another way by ...
0
votes
0answers
267 views

source ~/.bashrc or ~/.profile or ~/.bash_profile stalling terminal

Below I am displaying the structure of my files, some of the code in each, and what I do to try and get it all sourced and ready to do. STRUCTURE ~/ .bash_profile .bashrc .profile .bashrc #--...
0
votes
0answers
200 views

-bash: dirname: command not found appears after edit bash profile

I was trying to edit my .bash_profile. I think i had made some mistakes and now when i open my terminal, this appears: -bash: dirname: command not found When I entered source .bash_profilethe same ...
1
vote
1answer
80 views

Trying to get Raspbian LITE to open Start X automatically to boot a Web Browser

So I am very new to linux and Raspberry Pi's. I am trying to get my pi to boot up into a web browser. I have been following these instructions (https://die-antwort.eu/techblog/2017-12-setup-raspberry-...
0
votes
2answers
908 views

how to get bash and zsh setup correctly on macOS mojave

I'm running macOS (Mojave.) I'm wanting to make the switch from default bash to zsh/oh-my-zsh. Everything I install assumes I'm going to be editing my .bash_profile (or .bashrc.) I'm not 100% on how ...
1
vote
1answer
48 views

Anaconda directory in $PATH - origin obscure

Running Ubuntu 16.04, Cuda 8.0, OpenMPI4 I have the anaconda directory showing up in my $PATH although is not supposed to be there. echo $PATH | grep anaconda /opts/relion3/:/opts/pymol/:/opts/...
0
votes
0answers
86 views

MacOS Terminal Error #include nested too deeply

Any type of brew upgrade or developing on the terminal itsays: In file included from /usr/local/include/stdint.h:59 nested too deeply. This is probably because my bash profile isn't correct, even ...
1
vote
1answer
520 views

Visual studio code integrated terminal path different than normal terminal

I am on MacOS Mojave and I can't figure out why visual studio code's integrated terminal has a different path variable than the normal terminal. I have checked that VSCode opens /bin/bash (echo $...
3
votes
1answer
15k views

bash: service: command not found

I was having an issue running a mysql command and saw suggestions on a few issues online that suggested using the service command and it seemed to be that it was something that I should have by ...
0
votes
1answer
591 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
2answers
502 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
102 views

Why does symlink to VLC break 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
4k 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....
14
votes
4answers
8k 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
648 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
37 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
542 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 ...
3
votes
0answers
216 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
325 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
375 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
61 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 ...
9
votes
1answer
35k 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
232 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
368 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
167 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?
12
votes
3answers
4k 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
742 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
130 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 ...
1
vote
1answer
3k 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 ...
4
votes
5answers
4k 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
437 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
286 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
3k 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
133 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 ...
1
vote
3answers
7k 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
88 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
133 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
70 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 -...
1
vote
1answer
337 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
980 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
3answers
2k 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
172 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
52 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?
3
votes
3answers
181 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
860 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 ...
5
votes
1answer
2k 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
5k 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 ...