.bashrc is one of the scripts the Bash shell reads and executes when started as an interactive (but not login) shell.
2
votes
1answer
44 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
46 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
22 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
43 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 ...
2
votes
2answers
113 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
38 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
27 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
37 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
104 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
76 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
48 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
1answer
48 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
84 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
88 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, ...
1
vote
0answers
58 views
Bash colorless on Plesk machine (debian)
Somehow from one day to the other, on my plesk server, the bash/terminal was colorless. A friend of mine managed to get it coming back to life (color, that is) by making some changes to the bash ...
0
votes
1answer
1k views
How do I boot a Raspberry Pi directly into browser?
I have put the following line in my /etc/bash.bashrc file:
chromium--kiosk www.bbc.co.uk
However I then get an error at start up:
(chromium:2100): Gtk-WARNING **: cannot open display:
If I set ...
0
votes
2answers
55 views
can't cd into directory with spaces
I have tried all the ways of getting into a directory with spaces, and they all do not work.
mkdir "test folder"
Attempt #1
cd "test folder"
**bash: cd: test: No such file or directory**
...
2
votes
1answer
115 views
How to enable the bash history only caching commands that are acutally in path?
Having a bash history enabled is a security risk, because when you accientally enter your password into the bash the password gets stored in the bash history. To prevent this a good solution would be ...
2
votes
1answer
138 views
How do I change the default python version in Red Hat 6?
I've recently installed Enthought Python Distribution, after which it gave me the message:
As the last step, you should edit your .bashrc or prepend the EPD install path:
...
1
vote
1answer
634 views
editing .bashrc file
I finished installing Enthought's python EPD free, I got this note:
As the last step, you should edit your .bashrc or prepend
the EPD_free install path:
/home/zed/epdfree/bin
Thank you for ...
1
vote
2answers
205 views
dmenu doesn't set environment variable as per my .bash_profile when running Emacs
I have following ~/.bash_profile
[[ -f ~/.bashrc ]] && . ~/.bashrc
and ~/.bashrc
### Check for shell interactivity.
if [[ $- != *i* ]] ; then
return
fi
### Nyan-cat prompt.
...
0
votes
1answer
219 views
In linux, how can we change bash environment variables using initialize script?
We know that we can change bash's environment variables, for example PATH, using initialize script, for example .bashrc. Just writing PATH=<VALUE> and you will get what you want.
But, consider ...
5
votes
1answer
177 views
What's the meaning of “rc” in filenames such as .vimrc and .bashrc?
There are many file with a name containing "rc", but what's the meaning of "rc"?
0
votes
1answer
35 views
unset LC_* previous to ssh
In my ~/.bashrc I have environment variables definition similar to
export LC_CTYPE="es_ES.UTF-8"
when I use a ssh connection some of this variables have problems in the remote computer
man: can't ...
1
vote
1answer
470 views
Where can I find bash_profile / bashrc themes?
I've been searching for bash_profile / bashrc themes on google for awhile but I'm not finding any kind of aggregation for themes. Most of them I find are small snippets like:
export ...
0
votes
1answer
117 views
How can I show only the current directory after the prompt in Ubuntu 10.04
I have tried the suggestions here:
How to shorten the no of characters display for the current directory in the prompt
But adding these lines to the .bashrc file had no effect.
Uname -a :
...
2
votes
0answers
123 views
Why does this line appear every time I launch iTerm on my MacBook?
So I use iTerm on my MacBook Air and also my MacBook Pro. I've been playing around with .bashrc and .bash_profile and trying to come up with clever ways to configure things. At one point I decided I ...
1
vote
1answer
137 views
overriding user defined functions with the same name as system commands
This function exists in one of my users' ~/.bashrc:
function rm()
{
ls $*
echo "rm?"
read ans
if [ "$ans" == 'y' ]; then
/bin/rm $*
fi
}
In ...
3
votes
1answer
196 views
BASH function not escaping control characters
Hey guys I have a function that I'm using to find stuff, but unfortunately anytime I pass it a control character ($intVal or testing : etc) it chokes. I was wondering what the fix was?
I can ...
4
votes
2answers
116 views
How to create a directory symbol like ~ for HOME?
I've got a directory path for which I want to create a shortcut, like ~ for a users home directory.
I've tried the ENV variables, and I could match $<something> for a path, but I dont want ...
0
votes
1answer
56 views
alias: extract options from command
Apologies for the bad title. I couldn't come up with a better one.
I want to alias a command to another command, and extract options from the text of the command itself. I realize this is unclear, ...
1
vote
1answer
531 views
Sudo can not find binary
I have a problem.
Lately I've installed nodejs (if you don't know what it is, it does not really matter, could be anything else) from sources to /opt/node:
$ ls -la /opt
...
lrwxrwxrwx 1 root root ...
0
votes
2answers
164 views
sftp packet length error with loaded .bashrc
I regularly use WinSCP to tranfer a few files to my personal server. However I recently experienced the infamous "bad packet length" error due to one of my echo statements residing inside the .bashrc ...
0
votes
1answer
65 views
Prompt Customization Query - PS1='[\u@\h]\!:echo $? $ '
If in .bashrc the following reports the 'history number of the current command' (and the exit code of the last command), how can I configure it to report the 'history number of the previous command'?
...
3
votes
3answers
172 views
Find out where $PATH is defined
I recently installed an Arch-Linux System. If I type
echo $PATH
it points (among others) to a directory inside my /home/user/dir I can remember I set up somewhere. I have it as root user also, so ...
0
votes
3answers
298 views
why alias names defined in .bashrc file are not working?
I have give alias names in .bashrc file like below. But the alias names are not working. why?
alias c='clear'
alias l='ls -lt'
alias h='history'
alias d='ls -lt |grep "^d"'
export ...
0
votes
1answer
202 views
Where is ORACLE_HOME set in AIX?
In Linux I can set ORACLE_HOME in .cshrc. Where do I set this variable in AIX?
0
votes
1answer
189 views
launchctl - use rvm instead of system Ruby in executed scripts?
I have a launchctl job I define as such:
<key>ProgramArguments</key>
<array>
<string>/bin/sh</string>
<string>-c</string>
...
0
votes
1answer
115 views
How can I create session logs of individual SSH sessions?
Here is what I am looking for:
A way to log individual SSH sessions on SunOS. I would like to have the files kept separate based upon the hostname of the device I am SSHing into. I am only using ...
1
vote
1answer
373 views
Bash LS Options ~ Group Directories First
Locally I'm running Debian stable ~ bash -version 4.1.5 ...
Remotely my server is running Centos 5-8.el5 bash -version 3.2.25 ...
I have a .bash_alias file on both distros containing an alias 'll' ...
7
votes
2answers
7k views
Environment variables in bash_profile or bashrc?
I have found this question [blog]: Difference between .bashrc and .bash_profile very useful but after seeing the most voted answer (very good by the way) I have further questions. Towards the end of ...
1
vote
4answers
355 views
How can I clean up my bashrc/zshrc file?
Over time, I've added bunches of stuff to my PATH and it's lookin' pretty awful. How can I clean this up or what's the proper way to "reformat" all of this?
export PATH="$PATH:~/scripts"
export ...
7
votes
2answers
3k views
MinGW Bash profile
I use MinGW on windows 7. I have a .bashrc with some aliases in it. The file is in my home folder which is where MinGW starts me in, so it also believes that the folder is my home folder. It does not ...
0
votes
1answer
73 views
Where are variables sourced from in bash/redhat?
I am getitng something weird in my environment. I have a .bash_profile that only checks for .bashrc and then sources it. I have a JAVA_HOME in that file that is correctly setting the variable and ...
0
votes
2answers
49 views
Cygwin: Can I automatically change wa-foo-go to smart_wa_foo_go by only typing wa-foo-go?
When I type:
$ ./somescript.sh <file-script-test> wa-foo-go`
I want it to change that automatically so that it thinks I typed:
$ ./somescript.sh <file-script-test> smart_wa_foo_go
...
1
vote
2answers
2k views
Cygwin .bashrc not being source because cygwin starting in Windows home
NOTE: Please see my second edit below for an update on the problem.
Cygwin was working fine for me until last week. Now .bashrc isn't getting sourced. I must have installed something or changed ...
3
votes
1answer
416 views
~/.bashrc not sourced in a new lxterminal window
I added some lines to my ~/.bashrc like
export JAVA_HOME=/opt/jdk1.6.0_22
I sourced it:
$ source ~/.bashrc
$ env | grep 'JAVA'
JAVA_HOME=/opt/jdk1.6.0_22
Then I created a basic bash script under ...
0
votes
1answer
47 views
How can I check whether Vim has the -p (tabs) option or not?
I would like to figure out in my .bashrc (or one of the files it sources) whether Vim has the -p option available and if so create an alias.
Now, that same .bashrc is used on numerous systems ...
0
votes
2answers
493 views
What is the correct way to alias applications in OS X through bash?
In my ~/.bashrc, I have several aliases like:
alias emacs='/Applications/Aquamacs.app/Contents/MacOS/Aquamacs'
alias octave='/Applications/Octave.app/Contents/Resources/bin/octave'
alias ...
2
votes
1answer
269 views
Multiple .bashrc.save in my ~/home/user/
I noticed that in my home folder I have multiple .bashrc.save files. Why the system save them? It is normal or I have to disable something?
Specifically I have
.bashrc
.bashrc.save
...