2022 Developer Survey is open! Take 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
37 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 ...
user avatar
0 votes
1 answer
2k 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 ...
user avatar
0 votes
0 answers
93 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($...
user avatar
0 votes
0 answers
61 views

How to create a new bash profile in mac osx high sierra?

I am running High Sierra 10.13.6 off a fresh install. Running ls -a, I can see .bash_history and .bash_sessions, but do not see .bash_profile. Having just installed homebrew, I am following this guide ...
user avatar
0 votes
1 answer
128 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 ...
user avatar
0 votes
1 answer
24 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[...
user avatar
  • 101
0 votes
1 answer
94 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 ...
user avatar
  • 103
1 vote
1 answer
525 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 ...
user avatar
  • 405
2 votes
1 answer
1k 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 ...
user avatar
  • 21
2 votes
1 answer
494 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,...
user avatar
0 votes
1 answer
563 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 ...
user avatar
0 votes
0 answers
985 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 #--...
user avatar
1 vote
1 answer
381 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-...
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 ...
user avatar
1 vote
1 answer
56 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/...
user avatar
3 votes
2 answers
3k 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 $...
user avatar
5 votes
1 answer
42k 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 ...
user avatar
  • 121
0 votes
1 answer
1k 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 ...
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 ...
user avatar
1 vote
0 answers
178 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 ...
user avatar
1 vote
2 answers
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....
user avatar
14 votes
4 answers
14k 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 ...
user avatar
  • 315
0 votes
1 answer
1k 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 ....
user avatar
  • 315
0 votes
0 answers
43 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 ...
user avatar
0 votes
1 answer
604 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 ...
user avatar
3 votes
0 answers
338 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 ...
user avatar
  • 131
0 votes
1 answer
546 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 ...
user avatar
0 votes
1 answer
536 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 && \...
user avatar
-2 votes
1 answer
68 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 ...
user avatar
  • 181
0 votes
1 answer
401 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 ...
user avatar
0 votes
1 answer
521 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 ...
user avatar
5 votes
2 answers
242 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?
user avatar
  • 61
13 votes
3 answers
7k 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 ...
user avatar
  • 455
-2 votes
2 answers
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 $~ ...
user avatar
1 vote
0 answers
157 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 ...
user avatar
  • 111
1 vote
1 answer
4k 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
9 votes
7 answers
7k 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 ...
user avatar
  • 283
1 vote
1 answer
651 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 ...
user avatar
  • 113
0 votes
0 answers
357 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 <...
user avatar
  • 101
1 vote
4 answers
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/...
user avatar
0 votes
1 answer
156 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 ...
user avatar
  • 245
1 vote
3 answers
10k 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=/...
user avatar
0 votes
2 answers
102 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"...
user avatar
0 votes
2 answers
234 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 [ ...
user avatar
  • 396
0 votes
2 answers
72 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 -...
user avatar
2 votes
1 answer
508 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: ...
user avatar
  • 370
1 vote
2 answers
2k 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 |...
user avatar
  • 201
1 vote
3 answers
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 ~/....
user avatar
  • 111
0 votes
2 answers
382 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 ...
user avatar
  • 370
0 votes
1 answer
53 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?
user avatar