.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
20 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
39 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
36 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
48 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
59 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
90 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
66 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
27 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
110 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
21 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 ...
1
vote
1answer
987 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
77 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
51 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
0answers
22 views

establishing an automatic ssh session through bashrc

I would like to make a permanent ssh connection between my computer and the server at work. meaning whenever the computer at work is on the connection to the server should be established. Therefore, ...
0
votes
1answer
43 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
57 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
27 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
183 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
556 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
29 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
100 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
37 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
65 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
54 views

Broken sudo commands

How to repair sudo to use standard commands? I cannot use any command with sudo.
0
votes
1answer
102 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
57 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
53 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
60 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
56 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 ...
1
vote
1answer
230 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
61 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
2k 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
52 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
56 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
96 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
302 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 ...
4
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
396 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
340 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
2k 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 ...
1
vote
2answers
1k 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 ...
2
votes
1answer
182 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 ...
4
votes
1answer
2k 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
208 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
90 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
145 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
125 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
357 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
3k 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 ...