.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
5answers
30 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
21 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 ...
1
vote
1answer
32 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
26 views

Broken sudo commands

How to repair sudo to use standard commands? I cannot use any command with sudo.
0
votes
1answer
32 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
25 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
29 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
30 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
2answers
47 views

Function that interpretes trailing 'n' characters of a word as argument

Is there a way to pass the trailing n characters of a command to a function, so that it executes it as two commands? For example I define my function as abcx and whenever I enter abcxfoo to the ...
0
votes
1answer
83 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
23 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
629 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
810 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
49 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
50 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
52 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
119 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 ...
3
votes
3answers
604 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 ...
0
votes
1answer
72 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
162 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 ...
0
votes
1answer
973 views

Linux Mint something wrong with my .bashrc

The path of my .basrc file is /home/vamsi/.bashrc It is weird that my file has nothing but the path I set. I think I am using a file at the wrong location or that I have lost my .bashrc file as ...
0
votes
0answers
65 views

Lack of /etc/debian_chroot

While logged as root I create new user on my machine with adduser ziel. After su ziel I can see: $ su ziel cat: /etc/debian_chroot: No such file or directory ($(cat ...
1
vote
2answers
341 views

xterm not wrapping text properly

I'm configuring both my gnome-terminal and xterm columns (i still haven't picked which of these I will be using) and I have a couple of issues I would like to fix: the typing area seems to be ...
1
vote
1answer
118 views

After updating bashrc in cygwin the cursor starts at column 0 instead of after the prompt

The issue is that, if I update PS1 in bashrc, I see that by default the cursor gets placed at column 0 instead of after the prompt, and if I type anything it starts overwriting the prompt. I tested ...
2
votes
1answer
371 views

Bash, how to globally fix ^H and ^? backspace problems

I'd like to fix this frequent problem where the shell on a remote server thinks my terminal's backspace key is ^? and sometimes it thinks it is ^H, and happens to be incorrect and outputs the wrong ...
3
votes
2answers
125 views

Source my bash profile when I su on OS X

I'd like to source my .bash_profile (or maybe some other file) whenever I switch to superuser. (.bash_profile is the login rc on Mac OS X, .bashrc is the non-login script, and .profile is a login rc ...
0
votes
2answers
78 views

Open list of files in the directory from which to choose the file to edit in vim

In the video at Watch how i work rails he first obtains the output of find . -type f and uses this list as a regular vim file to search. Ones he finds this file in the list, he can open it in vim. ...
0
votes
2answers
96 views

Use the result of 'whoami' as part of an alias

I am setting up my default .bashrc on my Ubuntu machine that I will soon be adding more and more users to. One command that users will have access to is mysql, logging them into the SQL system on the ...
3
votes
2answers
116 views

Append dir to PATH

I'm trying to localy add a dir to the global $PATH variable. I added the following to my .bashrc. export PATH=$PATH:$VRS/bin But PATH seems to get concatenated to itself over & over every time ...
0
votes
1answer
268 views

Why I have a .bashrc.dpkg-dist file?

I just install Linux Mint Debian Edition, and in my home there is a .bashrc.dpkg-dist file instead of Ye old .bashrc Why? Can I move it to .bashrc?, Should I edit a new .bashrc file or the ...
1
vote
2answers
1k views

Spaces in Linux environmental variables?

Given directory: /media/foo/can haz/bar, I have tried editing bash.rc with: export Foo=/media/foo/can haz/bar export Foo=/media/foo/can\ haz/bar export Foo='/media/foo/can haz/bar' export ...
1
vote
1answer
2k views

.profile and .bash_profile ignored when starting tmux from .bashrc?

I've been having an issue with getting my .profile to be sourced when SSHing into an Ubuntu 12.04 server instance. My .bashrc does the following towards the end: if [[ "$TERM" != "screen-256color" ]] ...
2
votes
1answer
95 views

Creating a .bashrc function with encapsulated commands

I'm trying to create a function in .bashrc to shortcut my MAMP commands. I want to do something like this: mamp config Opens up MAMP's httpd.conf file for editing. mamp restart Restarts the ...
3
votes
1answer
184 views

How to benchmark bashrc / zshrc and prompt rendering time?

As im currently experimenting with new stuff in my prompt i need a way to tell what the performance impact is. How can i monitor how long it takes to render my prompt and the time it takes to source ...
11
votes
2answers
9k views

How do I modify my git bash profile in Windows?

I'm using Git Bash on Windows 7 and would like to set up bash profile aliases such as alias gs='git status' to make my life easier. How can I do this?
2
votes
3answers
72 views

How can I make my configuration available regardless on which machine I am working on?

I have created a custom .vimrc and .bashrc in my local machine. Also I have a couple of vim plugins that I find useful. Now I ssh remote servers to work very frequently. But each time in order to work ...
2
votes
1answer
137 views

Sort out where to put my bash commands, alias, and configurations

It seems to me that every Linux distro that I SSH into or use locally (Mostly RHEL/CentOS and Debian/Ubuntu machines) have a different idea about which of .bashrc and .bash_profile to run when I log ...
2
votes
3answers
1k views

Where are aliases set in CentOS?

There is a typo which causes an error message upon logon (someone typed lias instead of alias). I have checked /etc/bashrc as well as ~/.bashrc and /etc/profile as well as ~/.bash_profile for ...
1
vote
1answer
311 views

Running source ~/.bashrc doesn't load the right version of node when using nvm

I have placed this at the bottom of my ~/.bashrc: # NVM . ~/nvm/nvm.sh nvm ls nvm use 0.8 nvm ls This is the output when I load a terminal: Last login: Mon Apr 29 16:28:17 on ttys010 v0.4.7 ...
0
votes
1answer
537 views

gVim does not source .bashrc, .bash_profile, or .profile from non-interactive non-login shell

I have the following on my .vimrc set shell=C:/cygwin/bin/bash set shellcmdflag=-c set shellxquote=\" So the shell I am using is non-interactive and non-login. I thought that non-login shells ...
4
votes
2answers
1k views

How to persist bash history?

I don't know if this is expected, but my history is not saved across sessions. This is to say, if I close the window, then when I open it again, the history is empty. How can I persist it across ...
0
votes
1answer
71 views

emacs gui from the terminal

I have in my ~/.bashrc an alias setup so emacs will open in the terminal. How can I open the gui without commenting out the alias, closing down the terminal, re-opening the terminal, and then doing ...
2
votes
1answer
105 views

how to clear the effect of system wide bashrc

At my company there are system-wide bashrc files like /etc/bashrc and so on. Inside, they source more and more files. It's very confusing (I noticed my "ls" is aliased with a bunch of flags to ls ...
0
votes
2answers
52 views

can you make your terminal so that it times all the commands except common ones?

Is it possible to configure your shell(bash) so that it times all the commands except the common ones(like ls or cd)? so when I type some command like command arg1 arg2 I would want my terminal to ...
2
votes
3answers
890 views

Source new .bashrc in all open terminals

I find myself having many terminals open at once all the time. When I update my .bashrc, I have to go to each terminal and execute . .bashrc to source the terminal with the new .bashrc. This is ...
1
vote
2answers
514 views

Function defined in my user's .bashrc causes an error when I sudo su

I have a function defined in my user's .bashrc file that displays my current git branch name at my command prompt: parse_git_branch() { git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* ...
0
votes
1answer
93 views

linux - Play sound on login?

I've installed Gentoo without a GUI and have appended aplay /usr/shar/sounds/startup3.wav &> /dev/null & to my /etc/bash/bashrc file. This works just fine in playing the sound file, but ...
1
vote
2answers
176 views

Is it possible to set color for the user input in bashrc?

Note that I only want user's input to have specific color (words that user has typed with keyboard), not the actual command's output. I tried: export PS1="$ \033[38;5;154m" I know that it should ...
0
votes
1answer
435 views

csh -> bash, autostart .bashrc PCBSD (FREEBSD)

Hey Im stucked with this problem... Im using PCBSD (freebsd) which has default csh shell, now I wanted to use bash as a default so I made > chsh -s /bin/bash milo now i have in passwd > ...
1
vote
1answer
257 views

Alias defined in .bashrc not working after pipe

I'm stuck with the following problem. I've defined an alias in .bashrc (and .bash_profile): alias echo2="echo" This works well: $ echo2 "test" test However, if I try to use it after a redirect, ...