Skip to main content

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
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 ...
Mohammed Ali's user avatar
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&...
christopolise's user avatar
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+: ...
WesternGun's user avatar
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 ...
Xavier Murcia Márquez's user avatar
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 ...
user16796559's user avatar
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 ...
S Jagadeesh's user avatar
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. ...
Daniil Gusev's user avatar
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" ...
Alexander Zeitler's user avatar
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 ...
HAIDAR ABBAS's user avatar
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 ~/....
Dave's user avatar
  • 392
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 ...
xkeshav's user avatar
  • 759
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 ...
Katharina J's user avatar
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: ...
user19481451's user avatar
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 ...
Tms91's user avatar
  • 515
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/# -...
Mark's user avatar
  • 567
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 ...
Raphael10's user avatar
  • 179
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 ...
Damika's user avatar
  • 101
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 ...
SIVA KUMAR KALLURI's user avatar
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 ...
Raymond's user avatar
  • 154
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 ...
Flamethrower's user avatar
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 ~/....
jkgfinai's user avatar
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 ...
Joff's user avatar
  • 514
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/...
MANIKANDAN S's user avatar
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 ...
Mastiff's user avatar
  • 165
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 ~/....
JaSON's user avatar
  • 123
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/...
user1416486's user avatar
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 ...
Daniel's user avatar
  • 1
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 ...
Handyman-Girl's user avatar
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 "...
acgbox's user avatar
  • 2,268
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:...
Joydev's user avatar
  • 11
-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 ...
Learn4life's user avatar
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 ...
Vikram 's user avatar
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:&...
Herbert Qerbert's user avatar
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 ...
Herbert Qerbert's user avatar
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 ...
MetaColon's user avatar
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
Juliet's user avatar
  • 1
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 ...
Ahmet Hakan YILDIZ's user avatar
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 ...
MigWeld-o's user avatar
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. ...
Rolf's user avatar
  • 103
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 ...
VIJITH KUMAR's user avatar
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" ...
BetterEnglish's user avatar
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 ...
Untitled's user avatar
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 ...
Foad's user avatar
  • 893
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 ...
manodzit's user avatar
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 ...
xslibx's user avatar
  • 101
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 ...
john smith's user avatar
  • 3,081
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
Manohar Reddy's user avatar
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 ...
Rich Hard Fine Man's user avatar
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 ~...
soltex's user avatar
  • 111
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 ....
Tatty Man's user avatar
  • 101

1
2 3 4 5
16