Skip to main content

Questions tagged [bashrc]

bashrc is one of the scripts the Bash shell reads as `.bashrc` and executes when started as an interactive (but not login) shell.

0 votes
1 answer
38 views

exit code segment causes Bash prompt to freak out

My Bash prompt (based on mike kasberg's) generally works fine. But when I get an error code, and then write over to the next line, no newline is generated, so the text goes back over my previous ...
Smiley Tiger's user avatar
0 votes
0 answers
41 views

Store output of command history

Is there some way to record not only the commands that I type in my terminal, but also their ouput? Is there maybe something that I can add to my .bashrc that could act similar to passing all commands ...
TheFibonacciEffect's user avatar
1 vote
1 answer
153 views

Bash prompt with zero width control characters

To prevent the prompt from warping around right-to-left text, I want to insert a zero width LRM into the bash prompt (U200e). Since this is a zero width character, my instinct was to wrap it with \[&...
Shachar Shemesh's user avatar
0 votes
2 answers
178 views

Why is a newly created user account using my personal bashrc?

I set up a home server running Rocky 9 with a minimal install and one user account [mine]. I then created a new user, but when I login as the new user, the bash prompt is using the custom PS1 scheme ...
BlackDiamond's user avatar
0 votes
1 answer
170 views

Activate a conda/mamba environment when cd to a specific directory

Can I automatically activate a specific environment when cd into a directory? Like if I cd into the directory my_nn_library then automatically run mamba activate nn_env. I am using Ubuntu.
Osman Mamun's user avatar
0 votes
1 answer
472 views

docker login fails when done in .bashrc

At the end of my .bashrc file I have the following: docker login -u AWS -p $(aws --region us-east-2 ecr get-login-password) 636602586062.dkr.ecr.us-east-2.amazonaws.com However, whenever I open up a ...
neubert's user avatar
  • 7,232
0 votes
1 answer
142 views

.bashrc PS1: \w for WSL

I'm using Debian on WSL. However I mostly work in the Windows path. Currently my PS1 in .bashrc looks like this: PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u\[\033[00m\]:\[\033[01;34m\]\w\[...
Nikolar's user avatar
1 vote
1 answer
1k 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
228 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,519
0 votes
0 answers
39 views

Is there a way to disable force flag in reboot command

I want to prevent execution of reboot -f, Is there any way we can either disable the force flag itself or simply ignore the force flag and redirect the usual reboot?
supercool276's user avatar
0 votes
1 answer
644 views

vscode remote environment variables don't match `.bashrc`

Let's say the $PATH variable contained /usr/bin before everything. My ~/.bashrc used to have a line like this: export PATH='/home/user/123:$PATH' Then, I changed the line to: export PATH='/home/user/...
ImACoralReef's user avatar
1 vote
0 answers
115 views

Adding color to bash right prompt causes unwanted behaviour

rightprompt() { green=$(tput setaf 156) yellow=$(tput setaf 228) red=$(tput setaf 203) printf "%*s" $COLUMNS "${green}$(date +%a), ${yellow}$(date +%b\ %d), ${red}$(date ...
Lord Royce's user avatar
0 votes
0 answers
797 views

every time i open my parrot OS terminal i get bash: ‘export: command not found

I prefer Linux. I accidentally executed a misspelled command in terminal. sudo echo 'export PATH=/home/grump/miniconda3/bin:$PATH' >> /.bashrc What can I do now that it is constantly executing ...
Girum Senay's user avatar
1 vote
0 answers
1k views

.bashrc is not sourced when open new tab in Terminal.app

When I opened new tab in Terminal.app with cmd + T, .bashrc is not sourced automatically. I had to manually run the source command. Could you please tell me why this is? environment macOS Monterey 12....
taisei's user avatar
  • 11
0 votes
1 answer
377 views

How to get full path in terminal and what PS1 cmd to use in bashrc [duplicate]

Every time I change the directory I get only current directory name but I want full path what cmd should I use in my .bashrc file ? currently, i am trying as follows export PS1="\W >" ...
Gary's user avatar
  • 1

15 30 50 per page
1
2 3 4 5
20