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

learn more… | top users | synonyms (1)

0
votes
1answer
41 views

Bash autocomplete behaviour in Debian 8

On a new install of Debian 8 (Jessie) I have found that the autocompletion in bash, using the tab key, has changed. The test I did was: Open a terminal (in my case Konsole). Above the prompt it ...
0
votes
0answers
25 views

source ~/.bashrc No command 'some' found, did you mean:

I just recently installed ubuntu 14.0.4 and I'm not sure why I can't source my ~/.bashrc. Whenever I issue source ~/.bashrc I get: No command 'some' found, did you mean: Command 'tome' from ...
1
vote
1answer
82 views

How does one define aliases for use within MobaXTerm *local* bash shell?

I have been using MobaXterm for the last couple of weeks in Windows and I love it. However, I haven't quite figured out how to define my own aliases for use within the local bash shell. The obvious ...
1
vote
1answer
19 views

Automatically kill tmux session on session end?

I have the following snippet in my .bashrc which starts tmux whenever I'm at the command line: # Start inside tmux if [[ $(command -v tmux) ]] && [[ -z $TMUX ]] && [[ $TERM != ...
5
votes
1answer
51 views

Execute same command for each non-interactive bash session

I need to implement some config - I need to execute some code, if someone on my system calls for bash command in any form (interactive, non-interactive and bash -c form). For example this is command I ...
1
vote
0answers
36 views

.vimrc sourcing another leads to plugin errors

Since vim or vim-pymode does not seem to work with both python 2 and 3 at the same time I thought I make an alias for my newly compiled vim version specially for developing python 3. So I added this ...
0
votes
2answers
50 views

.bashrc/.bash_profile not loading export

I'm trying to compile code and in order to get it to work I need to run the following line before compilation: export PKG_CONFIG_PATH=/usr/local/lib/pkgconfig After this the code compiles normally, ...
1
vote
1answer
633 views

Why does mac iterm and iterm2 not source .bashrc or .bash_profile?

I have ready many posts related to login/non-login and interactive/non-interactive. It would be my understanding that .bashrc should be sourced from iterm - which is interactive logon shell. It is ...
2
votes
1answer
80 views

Auto source a script after sudo su

I am working on a machine that has some user accounts that are dynamically generated, and therefore I can not user customize the .bashrc or .profile. I frequently need to use these accounts to change ...
0
votes
0answers
14 views

Switch to user2 and load user1's bashrc automatically?

I want to switch to user2 from user1 and then instantly load user1's bashrc. For example: sudo su user2 And then as user2 run this cmd: source /home/user1/.bashrc I'm aware that maybe I shouldn't ...
0
votes
1answer
116 views

running remote command with arguments and shell using ssh

I'm trying to execute a remote command using ssh. I need the shell that executes the command to load .bashrc, so so far i've learned that i can use bash -lc for that. the problem is that it allows me ...
0
votes
1answer
207 views

How to access Solarized color values within bash script

I'm trying to make my bash PS1 prompt colors according to the Solarized theme. I have solarized installed and working for iTerm2, but so far have been unsuccessful in creating a custom PS1 prompt that ...
0
votes
1answer
42 views

Is there a standard place to put my Aliases? bashhrc vs. bash_aliases

Is there a standard place to put custom aliases? If not, what are the benefits and disadvantages of .bash_aliases, .bashhrc, and .bash_profile?
2
votes
1answer
41 views

Removed lines in .bash_history are still listed in history command. How to load the changes?

I removed command lines in my .bash_history. The problem is that when I execute the history command the deleted commands are still listed. How do I load the changes ? I tried source .bashrc and ...
0
votes
2answers
57 views

Creating a bash routine

Everytime I log in into my work machine, I have to open a terminal and type the same routine: $ cd /Documents/some_folder/some_another_folder $ vagrant up $ vagrant ssh I'd like these commands to ...
0
votes
1answer
64 views

How convert decimal to Hexadecimal in Ubuntu?

I am using a bash file in Ubuntu and i wrote an executable code in this file that must use some Hexadecimal number. But I just have decimal numbers so I want to convert decimal numbers to Hexadecimal ...
0
votes
1answer
105 views

How to run a script on ssh login and run another script after the first terminates?

I'm trying to run a script/shell just after I login via ssh to my host with a "guestUser" the mission of this user is to connect to another remote host via ssh, I've created this user on my host: ...
1
vote
1answer
254 views

Non-interactive ssh sessions don't have PATH set on some systems

I set my environment in .profile. My .profile is idempotent and .bash_profile, .bashrc, .kshrc and .zshrc all source .profile. That way I always get the same environment regardless on what ...
1
vote
1answer
118 views

Can't run /bin/bash… sometimes?

I’m on a Google Compute Engine which is running Debian Wheezy 7.4. I’ve been noticing strange things recently. For example, I can do sudo bash. But then, from root, I can’t do sudo -u anotherUser ...
0
votes
0answers
33 views

How can I automatically run two commands in different screen windows with an argument?

My process is ctrl+a 0 command $1 ctrl+a 1 /join#$1 I'd like to shorten it down to one command.
0
votes
1answer
203 views

Mac alias for npm install && bower install

How can I assign this alias to my new mac with Yosemite? alias in = "npm install && bower install"
0
votes
0answers
27 views

Changing Git Location on Mac OS X

I have a version of Git (1.9.3) already installed on my computer at /usr/bin. This version was installed (if I remember correctly) by XCode. I would like to install 2.2.1 (the download version from ...
6
votes
1answer
4k views

iTerm/zsh not reading .bashrc OR .bash_profile

In ~/.bash_profile I have : if [ -f ~/.bashrc ]; then source ~/.bashrc fi In ~/.bashrc I have some aliases When I load a new iTerm window, my aliases do not work. If I source ~/.bashrc they ...
0
votes
0answers
109 views

SSH .bashrc Alias for `Clear` Command Twice

Sometimes it is helpful to call clear twice to add some padding so that scrolling up or down will allow us to look at the output of previous commands easier, e.g. I can segregate compiler output by ...
1
vote
2answers
59 views

How to let the .bashrc know the current operation system

I have several linux computers sharing one disk and one home folder. That is on the disk, there is the home folder: \home\wuciawe And for computer A, whose os is Centos, it will load ...
0
votes
1answer
63 views

Sourcing ~/.bashrc in ~/.profile?

I'm quite new to developing under OSX and assigned some aliases and other preferences in the ~/.profile initially, however it got quite big and messy after a while because I had a lot of Environment ...
0
votes
0answers
79 views

Close terminal if exit code is not 0 for command after login

For security, I'm trying to set up double authentication for a CentOS server. The way it works is you log into a user with SSH keys then once you log in it executes su to change to the root user, ...
0
votes
1answer
28 views

'hhighlighter' wrapper script saying command not found

I have gotten the wrapper script 'hhighlighter' from https://github.com/paoloantinori/hhighlighter which colors anything you want in stdout. I followed the instructions about installing ack-grep, ...
0
votes
2answers
329 views

Can’t write to .bashrc: permission denied

I have downloaded NDK for my Eclipse Juno. Now I have to add the NDK to path and have to add the following lines to my .bashrc: export ANDROID_NDK=/_path_to/android-ndk-linux/ export ...
2
votes
2answers
895 views

what is `ssh-agent bin/bash` and why I have to `ssh-add` everytime

I have to run the following commands each time I restart: ssh-agent /bin/bash ssh-add ~/.ssh/key_rsa First question is why is /bin/bash necessary and what it is used for? Second, Is it ok I run ...
0
votes
1answer
44 views

KDE bash --norc

I would like to disable ./bashrc with the command bash --norc when opening a session on the KDE Destop enviroment. but I dont really understand where to place it, if on the startkde, Xsession or where ...
0
votes
5answers
127 views

History in bashrc on login vs manual sourcing - clearing and loading

I use a bunch of different aix machines at work and need to share users with co-workers. To make my life easier but not bother others with my customizations, I have created a .bashrc file that I copy ...
0
votes
1answer
43 views

in bash, how to load and execute an external bash script from a server, like github?

I'm thinking maybe I could have my ~/.bashrc (or other such customization bash file) live on my github and load it from whatever remote shell I log into with a command. Is that possible, and if so ...
2
votes
1answer
87 views

PATH preference in bashrc

I was wondering what happens in the following situation. Suppose I have an executable file in a directory that is in PATH in .bashrc. If I copy the file into another directory that is set in PATH ...
0
votes
0answers
61 views

Broken sudo commands

How to repair sudo to use standard commands? I cannot use any command with sudo.
0
votes
1answer
130 views

Bash doesn't source file unless manually started

bash won't source files from an login terminal unless I manually run bash from a terminal, I have bash (and not sh or dash). When I source a file, it returs errors (like "syntax error near unexpected ...
0
votes
1answer
70 views

.bashrc used in gnome not just terminal

I've recently started using the Anaconda Python distribution for software development and I want it to be the default Python distribution when I run something in the terminal. In order to do this, ...
0
votes
2answers
98 views

how to disable `alt-numkey` in bash shell

I can bounce between apps in Chrome OS by pressing alt-N, where N is the position of my app on the status bar. Useful! But when I'm in the bash shell of my Nitrous.io box, pressing alt-N to bounce to ...
1
vote
1answer
67 views

Echoing aliases to .bashrc

I want to echo an alias straight into my .bashrc file. Here is what I am using: echo alias cdear='cd | clear' >> .bashrc However, the new line in .bashrc does not contain the quote marks. I ...
1
vote
1answer
325 views

Color in bash prompt messes up git output

I changed my .bashrc to include export PS1="\033[1;33m\u@\h: \w>\033[0m" so that my shell prompt would be colored, but it seems the \033 messes up git output (log and diff, at least). I see ...
0
votes
1answer
103 views

alias can't find a file that actually exists

On my personnal computer, not a server, in my .bash_profile (I'm on OSX) — sym-linked to .bashrc, I have the following line among some others : alias deploy=sh ~/dir/ectory/deploy.sh The file ...
0
votes
1answer
3k views

How to run a tcl script in NS2 when path in bash file is not found?

i have added the path to where i have saved my tcl script (i.e. where ns2 is installed in home/me/ns-allinone-2.35). i have created a .bashrc and .bash_profile too, since they were not there. In ...
12
votes
3answers
1k views

What does . .bashrc actually do?

When I enter a eg. a new alias into my .bashrc file I can't use it in that terminal window immediately and until recently I thought I had to restart the terminal to reload the .bashrc file. Then I ...
0
votes
1answer
53 views

How to store setings

I have made my .bashrc give me two types of prompts; longp: xanth@X-VboxTux:~➤➤➤ and shortp: ➤ I have done this by writing a 0 or a 1 to a file and then to determine what prompt should be shown ...
0
votes
2answers
64 views

modify ssh_config ip addresses based on current ip

I'd like to be able to modify ssh_config aliases based on my current IP address. I have a laptop which I carry around from network to network, and a camera which I do the same with. I have setup the ...
0
votes
1answer
104 views

Sourcing local .bashrc .vimrc without copy to remote machine

Does anyone have an idea or hack on how to source my local dotfiles (I will probably need more of them so this solution should work with many files) on remote machines without scp them to remote ...
1
vote
2answers
457 views

How to insert bash scripts inside the PS1 variable

I made a custom PS1 variable, which is a tremendously confusing. Here is the one that is closest to being fully working: PS1="\n[\e[1;31m]\u@\H[\e[35m] \@ [\e[32m] PWD: \w [\e[1;34m]This folder ...
5
votes
3answers
2k views

Why do people source bash_profile from bashrc instead of the other way round?

It sounds like most terminal emulators don't run local sessions as login by default, so they'll load bashrc rather than bash_profile. So why do most people put everything in bash_profile and have ...
2
votes
1answer
675 views

Can I tell if I'm in an scp session in my .bashrc?

Inside my .bashrc, I'm doing a bunch of magic that causes problems when I'm trying to do an scp. The solution I've been going with is to manually ssh to the target machine, disable my .bashrc, do the ...
0
votes
2answers
398 views

Run bash_aliases on start

I have a separate file .bash_aliases , in the same directory as .bashrc, that I wish to be ran on start, I've added the lines: if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi to my .bashrc ...