Questions tagged [bashrc]

.bashrc is the Bash shell configuration file for a user's terminal login session.

Filter by
Sorted by
Tagged with
1 vote
1 answer
78 views

How to modify the path bash: /home/joydev/home/joydev/root/root-6.28.04-install/bin/thisroot.sh: No such file or directory

could you please clarify how to solve the following problem? Whenever I am opening the terminal I am getting following message: bash: /home/joydev/home/joydev/root/root-6.28.04-install/bin/thisroot.sh:...
-1 votes
2 answers
357 views

Accidentally changed PATH variable and I cant change it back, or use vim etc..help

I know there are many questions like this, but I unfortunately dont know enough about Ubuntu to be able to apply it to my situation. I have all my stuff saved for work on a remote machine, that i ...
70 votes
1 answer
107k views

Why is /etc/profile not invoked for non-login shells?

Login and non-login shell defined as: su - $USER # will give you a login shell bash # will give you a non-login shell /etc/profile is not invoked for non-login shells, such as when you start konsole ...
0 votes
1 answer
274 views

Dot gitconfig file not reflecting when switch user on ubuntu 22.04 lts

Today I have installed Ubuntu22.04LTS. In that, i had a user bob and his git config is like user.name=Bob B [email protected] alias.unadd=reset HEAD I Had another user named quealy . when i ...
0 votes
0 answers
2k views

export path to $PATH via shell script

Is there some best practice of adding a path to $PATH via a shell script permanently via a shell script and have it accessible? I believe I have only seen temporary solutions, via export PATH=$PATH:&...
0 votes
0 answers
68 views

~/.bashrc displays entries depending on how it is called

I am trying to export a new directory "foo" to $PATH using a shell script. For now I used a shell script install.sh that exports the path like this: <install.sh> #! /bin/sh echo ...
20 votes
4 answers
6k views

How to get shared Bash history among different tabs

I used the answer in https://unix.stackexchange.com/a/1292/41729 to enable real-time shared history among separate Bash terminals. As explained in the answer above, this is achieved by adding the ...
1 vote
2 answers
1k views

What is the difference between using "echo" command and editing using "vi" when making changes to .bashrc file?

I finished installing a program and some websites tell me to use the echo command to export an environment variable to the .bashrc file while others say to use vi .bashrc to edit the file directly. I ...
0 votes
0 answers
150 views

torsocks in .bashrc breaks Tor Browser

I activate torsocks in my .bashrc, so that every command I run by default gets routed through tor: # ~/.bashrc: executed by bash(1) for non-login shells. # ... . torsocks on This works fine, except ...
0 votes
1 answer
51 views

Error found when loading /home/juliet/.profile

The image above is the error I get when I boot my system. Please does anyone know what this means? And how can I solve it? The laptop is HP omen 15
5 votes
3 answers
7k views

How to fix ~/.profile and ~/.bashrc syntax errors

Ubuntu 18.04.4 (automatic upgrade from 18.04.3 just a few weeks ago) /bin/bash After I log in from the Gnome shell, this message appears while the screen is just plain purple and before the desktop ...
3 votes
1 answer
1k views

"sudo command" not working, but after sudo su when I enter command is working [duplicate]

My Ubuntu version is Ubuntu 22.04.2 LTS. I have one user (ahmet) and it is member of sudo. I download intellij idea and I want to use its mvn lib for everyone. I edited /etc/bash.bashrc as in this ...
61 votes
3 answers
152k views

Add environment variable to .bashrc through script

I need to add the following lines to the end of .bashrc file in Ubuntu. How can I add these lines automatically using a script. If I run the script, then it automatically inserts the lines at the end ...
1 vote
2 answers
3k views

Update info - how to currently set Java_home?

I'am trying to get Maven running. I have installed JDK and Maven. Thus I have been trying to set the Java_home variable for three days now, I cannot get it working. I have followed the instructions of ...
1 vote
0 answers
34 views

Ubuntu/opt directory permission denied issue [duplicate]

Ubuntu Newbie here! I am currently trying to install OpenFoam 10 in my machine, and need to edit the bashrc file located in Ubuntu/opt/openfoam/etc. Anytime I try to manually open the file and edit it ...
2 votes
1 answer
173 views

bash: `set +m` option does not work when placed in the .bashrc file

If I enter the command: set +m at the end of the .bashrc file, when I run the command: echo $- the option m is missing as it should be, but... If I enter the command: { sync & } 2> /dev/null ...
0 votes
2 answers
197 views

Alias path not found on Ubuntu

I installed kind from kubeflow kind and save it under my $HOME/kubeflow/kind To run kind from any path, I create an alias in my ~/.bashrc as following: alias kind="./$HOME/kubeflow/kind" ...
0 votes
2 answers
277 views

Opening gnome-terminal and running a command that uses environmental variables from .bashrc

I am making a .sh file that would be run by Right click -> Run as program by non-power-users. It should open a terminal window and run a docker run command, that uses some environmental variables. ...
7 votes
2 answers
6k views

How can I use an alias in a function?

In my dotfiles I have some functions that rely on aliases or functions to exist for them to work. For some reason, I can get them to reference other functions I have created, but not aliases for ...
0 votes
0 answers
48 views

How can I add a directory to my path and add a command to .bashrc? I am working with Supernova-2.1.1 of 10X Genomics

I would like to add a directory to my path, in my IBM server running Ubuntu 22.04. I would like to install the genome assembly software, SuperNova-2.1.1 by 10x genomics. In order to start using their ...
0 votes
1 answer
4k views

Bash no such file or directory every time I open the Ubuntu terminal

I am new to Ubuntu. I was trying to add: echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc Then I reloaded .bashrc with: source ~/.bashrc Now I am stuck with this. Every time I ...
-1 votes
1 answer
3k views

503 Service Unavailable

I am trying to install a library but i am getting this error: $ sudo apt-get install libkim-api-dev Reading package lists... Done Building dependency tree Reading state information... Done The ...
0 votes
1 answer
76 views

History file was rewritten

I had more then 5K records in my history file on Ubuntu 22.04. But for 5 last months I used my computer only by ssh and now I found that .bash_history file was rewritten with only ssh sessions. And I ...
3 votes
1 answer
3k views

How to add /usr/bin to path after I mistakenly removed it (sudo and nano are no longer in path) [duplicate]

Lets get this out of the way, I did something stupid. Yes, stupid. Very stupid. I am well aware of how stupid this is. I am embarrassed and I regret doing it. Please help. I was installing a program, ...
9 votes
2 answers
35k views

PATH not working even after successfully modifying it

For some reason I am successful in adding new directories to my $PATH but when I run the commands in the terminal the $PATH doesn't summon them. I modified the $PATH in the ~/.bashrc file, and added ...
0 votes
1 answer
292 views

when sourcing a bashrc how to get the line number of the error messages

Following this post, I am souring a bashrc file inside the WSL2/Ubuntu by: source /usr/share/openfoam/etc/bashrc but I get lots of error messages: -bash: /usr/share/openfoam/bin/<someFile>: No ...
0 votes
0 answers
102 views

adding permanent custom environment path variable

i am trying to create a permanent path variable following this tutorial: https://youtu.be/JLjF75b-vMI?t=126 everything worked fine and i was able to cd to my newly added variable's directory, however ...
175 votes
11 answers
1.5m views

Where is .bashrc?

I feel stupid asking, but I can't seem to find the answer to this anywhere. I'm trying to follow these instructions to edit my bash prompt, but there is no .bashrc in either my user directory (~/....
177 votes
7 answers
255k views

.bashrc not executed when opening new terminal

The code in .bashrc does not execute when I open a new terminal window in Ubuntu 12.04. I noticed this when creating a .bash_aliases file. The aliases did not show up when I opened a new terminal. ...
0 votes
0 answers
107 views

How to give display access to a non-interactive shell using .bashrc

I have a worker that is running in a non-interactive shell. The worker is needing to open up a chrome browser to do scraping, but we are getting a chrome not reachable error due to the worker not ...
0 votes
1 answer
55 views

.bash_profile guidance

I want to know if there is any guidance I should be following somewhere (maybe from a man page or something) regarding creation of a ~/.bash_profile. By default Ubuntu 18.04 doesn't have one, it just ...
0 votes
0 answers
91 views

When im trying to open terminal the terminal is totally blank there is nit even a durectory or $ appearing while opening the terminal?

When im trying to open terminal the terminal is totally blank there is nit even a durectory or $ appearing while opening the terminal? What should i do now? Please guide me step by step
81 votes
4 answers
258k views

Permanent PATH variable

How will I make this /media/De Soft/mongodb/bin PATH variable permanent? Everyone is saying "export PATH=$PATH:media/De\ Soft/mongodb/bin to your ~/.profile, or .bashrc, or .zshenv depending on your ...
7 votes
1 answer
3k views

.bashrc edit messes up terminal command arrow-up history print

I wanted to give my terminal prompt in Ubuntu a more personal look, and wanted to change the text prior to the '$' when writing a command. From what I've found this is done by editing the .bashrc ...
1 vote
0 answers
496 views

eval expression within shell script returns exit code 1

I am using ubuntu 18.04 to run a shell script, and the eval expression returns an exit code 1: #!/bin/bash set -e export DEBIAN_FRONTEND=noninteractive git clone https://github.com/asdf-vm/asdf.git ~...
1 vote
0 answers
41 views

How to write an override to prevent an application from launching?

I am looking for help to write a script or terminal command by which I can prevent an app from launching. Let us call this script .bash_ban for instance. Is it possible to write up a command in ....
1 vote
2 answers
4k views

"Command not found" errors from terminal, even though the software is installed

I know ubuntu comes with a gnome-terminal. A few days ago, I started to face a new issue that I can't describe. I use the vscode code editor in my daily life. Many commands, like npm,pnpm, yarn, rust -...
0 votes
0 answers
31 views

ssh can access master but not the devices connected to the master

Hi im trying to connect to the master computer using ssh (linksys-wify), its not showing any errors when connecting, but when trying to see the list of devices connected in my master computer using ...
10 votes
3 answers
27k views

Want to execute sudo command on shell startup

I've put a command sudo do something in my ~/.bashrc, this works but everytime I open the terminal I have to type in my password. How do I make it so there is no password-typing?
1 vote
1 answer
418 views

Able to connect to server via ssh but not via sftp (bash -> zsh)

OS: Ubuntu 20.04 Hello everyone, I am able to connect to a remote machine via my terminal: ssh remote_name Nonetheless I cannot connect via sftp (thus not able to use Nautilus to access my remote ...
0 votes
1 answer
44 views

$PATH is different for startup programs

I have a .sh file with echo $PATH. When opening a terminal, the PATH is how it is supposed to be, it includes all the additions in .bashrc. I open the startup menu and set this script to run on ...
3 votes
3 answers
12k views

export PATH="/usr/bin:$PATH" needed for every single command

so I was trying to set JAVA_HOME variable and some how I ended up facing this error every time I want to use terminal Command 'poweroff' is available in the following places * /sbin/poweroff * /usr/...
1 vote
2 answers
7k views

Zsh coloring like bash

I want my zsh shell to look exactly like bash shell(in terms of default coloring) but my zsh shell's text is plain white. I identified this part of .bashrc which I think adds the green color to user@...
0 votes
1 answer
249 views

bash: /home/vishal/.bashrc: Errors when opening terminal

Everytime I open my terminal , this message pops up. Please tell how to permanently delete this from the terminal? bash: export: `=': not a valid identifier bash: export: `/home/vishal/LLVM/llvm-...
0 votes
1 answer
138 views

How to delete the commands that pop up after opening the terminal in Ubuntu 20.04?

enter image description hereenter image description hereEvery time I open a new terminal tab, some startup files try to send commands. And I get this: What should I do? It's a bit annoying.
0 votes
0 answers
44 views

Bash script not work as expected

#!/bin/bash gnome-terminal -- ssh -i "my.pem" ubuntu@''''''''''''''''.amazonaws.com && ./remote.sh I want to connect the server to a new terminal and run the remote.sh command at the ...
0 votes
2 answers
352 views

Terminal is not spitting output after messing with ~/.bashrc file

My Terminal Image: I'm using Ubuntu with WSL and can't access GUI. Aforementioned images of my terminal, no output is displaying for anything I type. Terminal is acting like an editor. It happened ...
0 votes
0 answers
92 views

How to give the address of "bashrc" loacted in "./opt/.../etc" in VM?

I am a newbie in Linux. I have a VM on my windows and just installed OpenFOAM10 (https://openfoam.org/download/10-ubuntu/) on my VM. Then, I needed to add "source /opt/openfoam10/etc/bashrc" ...
0 votes
0 answers
231 views

How can I emulate a sudo shell with the respective environment variables set when using "sudo su -c "<command>"?

I would like to run a sudo command in one line, but also have this command be run as a sudo user with all the respective environment variables instantiated (essentially run exec zsh before anything). ...
0 votes
1 answer
660 views

Is the ~/.bashrc file user specific when I am connected to a remote system using Secure Shell (SSH)?

I am doing work on a remote computer using Secure Shell. I would like to add aliases to the ~/.bashrc file, but only if this edit applies to my user only. So the question, as the title states, is ...

1
2
3 4 5
16