Questions tagged [bashrc]
.bashrc is the Bash shell configuration file for a user's terminal login session.
788 questions
1
vote
1
answer
104
views
How to recover a .bashrc file deleted in WSL from explorer.exe?
I accidentally deleted my .bashrc file while managing files in WSL (Windows Subsystem for Linux) through Windows File Explorer. After the deletion, I took the following recovery steps:
Checked the ...
1
vote
1
answer
58
views
Have to source file after terminal is open for function to work
I am trying to make a terminal prank that plays noise for every output that happens on the terminal:
exec > >(tee >(while true; do
while IFS= read -r line; do
FREQ=$(echo "$line&...
2
votes
1
answer
35
views
Bash 5 - ghost function: removed but still available in Bash cache - exploit? bug?
GNU Bash version 5.1, WSL, Ubuntu 22.04.3 LTS.
$ bash -version
bash -version
GNU bash, version 5.1.16(1)-release (x86_64-pc-linux-gnu)
Copyright (C) 2020 Free Software Foundation, Inc.
License GPLv3+: ...
0
votes
0
answers
65
views
Bashrc not working with new users
As you can see in the picture, any user unless the first one has the prompt destroyed I don't know why.
I changed the ps1 (both with forced color and without it) and did not change.
Is there a change ...
1
vote
1
answer
143
views
update-alternatives of CUDA versions not shown [duplicate]
Summary: I'm trying to include an additional version of CUDA in update-alternatives however it does not show up after adding it to PATH and when querying.
Information
Three versions of CUDA installed ...
0
votes
0
answers
31
views
re: psql running on a ssh server
(ubuntu terminal, and the server is using bash)
i have installed psql in a ssh server inside conda env as I don't have sudo privileges, so I successfully installed the psql have tables inside it ...
0
votes
0
answers
31
views
Output to file from .bashrc does not work
I want to make a greeting on my Linux server for users when they log in. The server has a tsp task spooler for organizing a task queue, and I want the current task queue to be shown when connecting. ...
0
votes
1
answer
513
views
bash: hash: hashing disabled
When opening a terminal window on Ubuntu 24.04, I get this message:
bash: hash: hashing disabled
Its caused by this line:
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
...
0
votes
1
answer
68
views
`export` doesn't appear in `~/bashrc`
I want to install a LAMMPS software simulator, and I'm doing the same steps outlined in this video: https://youtu.be/-cYhA2wFGWs,
but when I try to add the export to ~/.bashrc the rest of the code ...
2
votes
1
answer
222
views
How is ~/.local/bin getting on my PATH
I noticed an anomaly with how my PATH is being configured on a new install of 22.04. Initially ~/.local/bin appeared twice. I reduced it to one time by commenting out the relevant block in ~/....
3
votes
1
answer
262
views
color variable does not work with PS1 assignment in bashrc file
below is my current PS string in .bashrc
PS1='${debian_chroot:+($debian_chroot)}\[\033[00;37m\]\u@\h\[\033[01;32m\]:\[\033[01;34m\]\w\[\033[01;31m\] $(parse_git_branch)\[\033[00m\]\$
which works fine
...
0
votes
1
answer
734
views
How to fix unresponsive Terminal
My Terminal does Not respond. I can Open it but when I try to type something, it gets ignored. I cant See the letters on the Terminal - They are Not hidden.
I tried 2 other Terminals, Same Problem.
I ...
0
votes
0
answers
330
views
removing zsh broke my terminal
I ran this code sudo apt-get --purge remove zsh to delete zsh and now my terminal has this output:
and when accessing through powershell:
<3>WSL (556) ERROR: CreateProccessEntryCommon:502: ...
9
votes
2
answers
2k
views
Should I put functions in .bashrc, .bash_aliases or .profile
I have read this thread about where to put aliases.
Now, let's suppose that my custom command is quite elaborate (takes arguments in input, is composed of several commands run one after the other, I ...
1
vote
0
answers
54
views
Reverse search fails when commands are present in bash_history
Ubuntu 22.04, from terminal I type ctrl+r and mosquitto_sub it finds mosquitto_sub --help and nothing else. But:
# cat .bash_history | grep mosquitto_sub
mosquitto_sub --help
mosquitto_sub -t foo1/# -...
2
votes
1
answer
683
views
How do I avoid having to manually source ~/.profile or ~/.bashrc to get "LD_LIBRARY_PATH" to work?
I realized that I need to manually source ~/.bashrc file or to manually source .profile file to make the settings specified in .bashrc file effective. These are some additions to complete ~/.bashrc ...
0
votes
1
answer
1k
views
command not found: shopt ON WSL Ubuntu 22.04
I inserted couple of env. variables such as:
export WOS_MONGODB_URI='mongodb://localhost:27017/...'
export WOS_AWS_REGION='us-east-2'
export WOS_AWS_ENV='dev23'
export WOS_SEED_MODE='test'
export ...
1
vote
0
answers
4k
views
How to reload .bashrc settings without logging out and back in again?
I created a script that add's the below commands to the .bashrc file. The purpose is I need to store the commands entered by the user into the .bash_history. The below commands are adding to .bashrc ...
1
vote
1
answer
469
views
How to restore /root/.bashrc as sudo su is giving segmentation fault (core dumped)
I've a dedicated remote web server. I messed up /root/.bashrc file by adding source /root/.bash_profile. It core dumps on sudo su.
$ sudo su
Segmentation fault (core dumped)
I can't login to server ...
1
vote
0
answers
608
views
I'm trying to launch rplidar but I'm getting a timeout error
I've set up ROS noetic in my Raspberry Pi 4 B with Ubuntu 20.04. I want to make a map with my LiDAR, so I started by installing rplidar. However, when I run roslaunch rplidar_ros rplidar.launch (after ...
3
votes
1
answer
446
views
Bash alias for removing docker images does not use force flag
Currently I have an alias to force remove images, the command is something like:
docker rmi $(docker images | grep pattern | grep -v other_pattern | tr -s ' ' | cut -d ' ' -f 3) -f
Within my ~/....
1
vote
1
answer
325
views
Which environment variable controls the location of .local directory?
Due to storage space constraints in my home directory, I need to move as much out of there as possible. I have moved caches and configs out by setting the $XDG_CACHE_HOME and $XDG_CONFIG_HOME ...
0
votes
1
answer
210
views
bash: export: `LS_COLORS#': not a valid identifier
I'm getting the following error in my terminal:
bash: export: `LS_COLORS#': not a valid identifier
My ~/.bashrc file looks like this:
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/...
1
vote
1
answer
99
views
How to do partial history search without sticky matching
If I put this in my .bashrc:
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
It mostly works, but if I go up and don't like the match, I can't go back ...
0
votes
1
answer
3k
views
How to "source ~/.bashrc" automatically when connect to remote
I need to create some aliases on remote Ubuntu and enable them on ssh-connection. So I defined aliases in ~/.bashrc file (on that remote Ubuntu).
Now when I do
ssh root@<Remote IP>
source ~/....
0
votes
1
answer
349
views
How to add code to .bashrc without causing errors?
I'm learning how to passthrough my NIC to my KVM.
This guide says to add the following code to the file ~/.bashrc
#!/bin/bash
# change the 999 if needed
shopt -s nullglob
for d in /sys/kernel/...
0
votes
1
answer
76
views
How do I get the terminal to stop outputting additional text from basic bash commands?
I am not sure what exactly is the name of this supplemental text that pops up whenever I am using the terminal, but it shows up when I am running commands. Previously it was not there. I made some ...
0
votes
0
answers
45
views
sudo apt update Received 11 errors. Don’t know what to do [duplicate]
When I wrote sudo apt update I received 11 different errors. I took a screenshot could someone help me fix this. I’m extremely new to Linux bash commands. I just took a 5hour class on the “50 most ...
2
votes
1
answer
1k
views
how to add alias to bashrc and load content with sudo?
I need to run my script with sudo, because it includes commands for installing programs with apt. So I do this:
sudo ./myscript.sh
With content:
#!/bin/bash
# add alias .bashrc (work)
echo "...
1
vote
1
answer
87
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
686
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 ...
0
votes
1
answer
524
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 ...
1
vote
0
answers
4k
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
99
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 ...
0
votes
0
answers
196
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
94
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
3
votes
1
answer
2k
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 ...
1
vote
0
answers
37
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 ...
0
votes
2
answers
677
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.
...
0
votes
0
answers
58
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
2
answers
265
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
1
answer
90
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 ...
0
votes
1
answer
511
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
110
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 ...
0
votes
0
answers
140
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
58
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
117
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
1
vote
1
answer
1k
views
Can't Create a Permanent Alias In Fish Shell
I'm trying to create a permanent alias. I've created one long ago, but I don't remember if I did anything differently than what I'm doing now. Be as it may, it isn't working!
I start by opening the ...
1
vote
0
answers
603
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
71
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 ....