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
14 views

.bash_profile is not sourced when logging in via a display manager

I read this question, in particular the fact that display managers do not set up a login environment. So, the .bash_profile file is not sourced when I log into my system (via gdm). I do not really ...
0
votes
1answer
44 views

-bash: PATH: command not found

I hope someone can help me solve this problem. I am working on a mac and recently I was trying to use the export path function in .bash_profile to help me run a command from any directory in the ...
0
votes
1answer
21 views

Issues with bash profile

Can anyone see if there are any errors in this bash .profile line? export PS1="\[\033[38;5;206m\]\h:\W \u $ \[\033[0m\]" When I activate it, it shows in like this: $ source .profile \[\033[...
0
votes
0answers
44 views

How to leave dev environment behind when transferring to a new Mac?

I would like to transfer my files and applications from an old mac to a new one, but there's a problem: the dev environment on the old one should be left behind. I don't want any of the .bash files or ...
0
votes
0answers
80 views

why mysql -u root -p does not work for me?

I am trying to instal mysql servers. After a hard time I could edit .bash_profile by adding this line: $ export PATH=${PATH}:/Users/naghmeh/mysql/bin/ the next step is to run the following command: ...
0
votes
1answer
34 views

writhing in .bash_profile on Mac

I wanna install sql. In installation process I did : open -t .bash_profile. But when I wanna write something the error say: You don’t own the file “.bash_profile” and don’t have permission to write to ...
1
vote
1answer
249 views

Windows 10 WSL bash change starting directory

When I launch bash on Windows, it always starts in the directory that it is launched from [/mnt/c/Users/myuser], however I would like it to launch in the WSL $HOME directory [~]. How do I specify the ...
0
votes
0answers
75 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 ....
2
votes
1answer
215 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 ...
2
votes
1answer
364 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
262 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
670 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 #--...
1
vote
1answer
190 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
2k 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
50 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/...
1
vote
1answer
1k 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 $...
4
votes
1answer
30k 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
906 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
1k 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 ...
1
vote
0answers
138 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
5k 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
10k 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
891 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
41 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
574 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
277 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
434 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
452 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
62 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 ...
0
votes
1answer
311 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
411 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
201 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?
13
votes
3answers
6k 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
1k 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
142 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 ...
7
votes
5answers
5k 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 ...
1
vote
1answer
523 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
321 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
4k 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
145 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
9k 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
92 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
178 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 that [ ...
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 -...
2
votes
1answer
412 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
1k 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
4k 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
327 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?