Skip to main content
Share Your Experience: Take the 2024 Developer Survey

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
1 answer
25 views

terminal inserts characters after CTRL+C

in some of my applications (ArchLinux, Gnome 46) some chars are appended to my username when using CTRL+C to abort a script. Sometimes also in the middle of bash scripts, which makes it a bit painful: ...
xtlc's user avatar
  • 101
1 vote
1 answer
90 views

What does it mean to "run something in a shell profile"

I'm installing Homebrew and I get a message that says: Next steps: ⁃ To add Homebrew to your PATH run brew shellenv in your shell profile (e.g. ~/.bash_profile or ~/.zprofile)" What does it ...
dkv's user avatar
  • 193
1 vote
1 answer
640 views

The most proper place to set systemwide shell alias in a Linux system

There are many places to set an alias for all users within a Linux system, e.g. /etc/profile, /etc/profile.d/*, /etc/bash.bashrc... I'm wondering which one is the most proper/correct, in other words, ...
Leon's user avatar
  • 239
0 votes
1 answer
205 views

bash scripts not loading any of ~/.bash*

Context: M1 MacBook macOS Ventura 13.5.2 zsh as default shell GNU coreutils installed by homebrew /opt/homebrew/opt/coreutils/libexec/gnubin added to path in ~/.bashrc, ~/.bash_profile, and ~/....
ShadSterling's user avatar
  • 1,499
5 votes
3 answers
5k views

Git Bash extremely slow start up on Windows

I have read posts similar to this one; it seems my issue is different. I suspect I'm having this issue due to my .bash_profile because when I delete it and open the terminal again it starts up quickly,...
HasanTheSyrian_'s user avatar
1 vote
1 answer
193 views

Where is my PATH?

When I run the following command, I see several paths and all looks well. echo $PATH However, I want to find out where these paths are stored. I have looked for ~/.bash_profile and ~/.zshrc but they ...
bobby123uk's user avatar
4 votes
1 answer
19k views

How to read excel using Powershell

How to extract data from excel such that in first column having the details of machine and in second column having multiple user name and it read excel like it will delete all users from column 2 ...
Catherine's user avatar
0 votes
0 answers
184 views

How to fetch the name of all user on remote server which is present at 'C:\user' folder and write that name into Excel file [duplicate]

I am trying to get the name of all users of multiple server through powershell and than transfer it to excel file but I only got the name of user in txt file and unable to copy it to excel. Foreach($...
Catherine's user avatar
0 votes
1 answer
1k 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 ...
Heidi 's user avatar
0 votes
1 answer
36 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[...
cpd's user avatar
  • 101
0 votes
1 answer
336 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 ...
Nagh's user avatar
  • 103
1 vote
1 answer
751 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 ...
BugSquanch's user avatar
  • 1,774
5 votes
0 answers
4k 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 ...
Krio's user avatar
  • 51
2 votes
1 answer
946 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,...
AnchovyLegend's user avatar
0 votes
1 answer
1k 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 ...
rahuls36's user avatar
0 votes
0 answers
2k 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 #--...
brettwbyron's user avatar
1 vote
1 answer
1k 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-...
AstroBoy27's user avatar
0 votes
2 answers
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 ...
user7314150's user avatar
1 vote
1 answer
70 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/...
user1053292's user avatar
5 votes
4 answers
10k 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 $...
Badr Youbi Idrissi's user avatar
7 votes
1 answer
64k 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 ...
mcclosa's user avatar
  • 141
0 votes
1 answer
2k 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 ...
Himalay's user avatar
  • 163
0 votes
2 answers
2k 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 ...
Dash Conroy's user avatar
1 vote
0 answers
217 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 ...
Zach Valenta'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
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
0 votes
1 answer
2k 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 ....
monster's user avatar
  • 315
0 votes
0 answers
44 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 ...
swayamraina's user avatar
0 votes
1 answer
732 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 ...
Get Off My Lawn's user avatar
3 votes
0 answers
859 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 ...
AggieDev's user avatar
  • 131
0 votes
1 answer
924 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 ...
Vivien Garcia's user avatar
0 votes
1 answer
844 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 && \...
Karl Morrison's user avatar
-2 votes
1 answer
93 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 ...
user19203's user avatar
  • 181
0 votes
1 answer
511 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 ...
thanasissdr's user avatar
0 votes
1 answer
846 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 ...
Seth Shill's user avatar
5 votes
2 answers
433 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?
jrmo14's user avatar
  • 61
13 votes
3 answers
10k 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 ...
Ryan Lue's user avatar
  • 505
-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
1 vote
0 answers
216 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 ...
krish7919's user avatar
  • 111
1 vote
1 answer
5k 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 ...
user avatar
11 votes
7 answers
10k 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 ...
LLL's user avatar
  • 303
1 vote
2 answers
1k 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 ...
MattSom's user avatar
  • 113
0 votes
0 answers
536 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 <...
Mario GS's user avatar
  • 101
1 vote
4 answers
6k 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/...
ShanZhengYang's user avatar
0 votes
1 answer
247 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
1 vote
3 answers
13k 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=/...
Tom Viaene's user avatar
0 votes
2 answers
130 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"...
Flowinho's user avatar
0 votes
2 answers
442 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 [ ...
code-8's user avatar
  • 444
0 votes
2 answers
74 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 -...
cwallenpoole's user avatar
2 votes
1 answer
708 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: ...
codyc4321's user avatar
  • 410