The Bashrc file is used by the Bourne Again Shell in Unix/Linux to set environment variables and run commands.

learn more… | top users | synonyms (1)

0
votes
1answer
117 views

Straight forward way to run ssh-agent and ssh-add on login via SSH?

I'm trying to have the following commands be auto-executed when I login to my server via ssh: ssh-agent /bin/bash ssh-add ~/.ssh/id_rsa My ssh key has a passphrase and I'm fine with entering it ...
1
vote
1answer
23 views

Should I be adding aliases to /etc/profile instead of /etc/basrhc?

I've been adding them to /etc/basrhc, and that works most of the time. But I noticed that when I su to another user, I lose all my aliases. It turns out that /etc/bashrc is only loaded when the ...
0
votes
1answer
105 views

Bashrc function called ssh doesn't work

I created a function in my bashrc file so that when i ssh into something it automatically opens a tmux session. function ssht () { /usr/bin/ssh $@ -t 'tmux a || tmux || /bin/bash' } This ...
1
vote
1answer
517 views

Different bash path variables when using ssh script vs interactive ssh [closed]

I'm trying to run some ruby (bundler/rvm) commands via a script using Plink. I noticed that it was complaining about not knowing where some commands were. It seems as though my $PATH variable ...
0
votes
1answer
372 views

Where is this bash shell alias being configured?

While logged in as root onto a CentOS 6.5 system, I run ># alias alias cp='cp -i' alias l.='ls -d .* --color=auto' alias ll='ls -l --color=auto' alias ls='ls --color=auto' alias mv='mv -i' alias ...
0
votes
1answer
171 views

Modify the command line that gets saved to history / .bash_history in Linux

When commands are saved to history in Linux, is there some way to prepend the command line in the history with the remote SSH IP address and process ID so that it's easy to group commands from the ...
4
votes
0answers
439 views

CentOS colors in php-cli applications [closed]

I'm managing a server with CentOS 6.5 x64 installed. In my Ubuntu server, when I run composer or Laravel's artisan php cli command, parameters are colorful. But this doesn't happen when I SSH into ...
1
vote
3answers
2k views

How do I restore the default bashrc?

I have accidentally overwritten .bashrc. I did the following echo 'export EDITOR=/usr/bin/nano' >> /etc/bashrc Bur I accidentally typed > instead of >>. I guess, it was a bad idea. I ...
1
vote
0answers
190 views

EC2 - editing .bashrc causes terminal to hang and checks to fail

I've been testing this for the past few hours with no luck. When launching an Ubuntu 12.04 EC2 micro instance, I SSH to it, create a new user and continue with installing Ruby version manger under ...
-1
votes
1answer
87 views

Changing path to basedir of mysql

When-ever I need to start mysql from command line, I need to cd to the base directory and then use mysql command as shown below: # cd /home/ec2-user/percona-5.5.30-tokudb-7.0.1-fedora-x86_64/ # ...
1
vote
1answer
352 views

Change PS1 value for all Bash users

I am trying to change the prompt value for all users of a system (the $PS1 variable) to the same value. I have the following stored in file /etc/ps1: PS1='` if [ $? -eq 0 ]; then echo -n ...
0
votes
2answers
894 views

ssh SendEnv from windows to linux server using cygwin

I am doing ssh to a Open SUSE linux server from windows cygwin. I am trying to send one of my local environment variable through the ssh command so that I can load some specific .bashrc file right ...
0
votes
1answer
47 views

Red Hat 5.4 - Add time to bashrc

I am trying to add the current time to my bash in Redhat. I'd like it to read: [user@hostname 01:01:01 ~] and obviously be relative to when the bash prompt was placed there. Any ideas if this is ...
7
votes
1answer
2k views

Standard place for user defined bash_completion.d scripts?

I have user access (no root) into a Linux (Suse) machine where I developed some bash scripts and the corresponding bash autocompletion rules. Since the scripts belong only to my user and therefore I ...
0
votes
2answers
2k views

.bashrc not loaded, .bash_profile exists

In a ubuntu terminal my .bashrc isn't available until I run: source ~/.bashrc I have a ~/.bash_profile with contents: [[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # ...
2
votes
3answers
326 views

Added line to bashrc, now bash is not responding

I added the following line to the end of my ~/.bashrc (This is on a Linode box) and logged out of my ssh session. source ~/.profile Now when I log in, the shell is unresponsive. I never get to the ...
2
votes
1answer
347 views

Bash Prompt Colors Ubuntu

I am attempting to use a simple shell script on a base Ubuntu 12.04 server install to set prompt colors for users system wide. I would like to have Puppet place the file color.sh in /etc/profile.d/ ...
9
votes
3answers
3k views

Use .bashrc without breaking sftp

My problem is that I need to set a few variables, and output a few lines every time I login to the ssh shell, and at the same time I have to be able to use sftp to tarnsfer files via Filezilla. Now, ...
0
votes
1answer
64 views

Command works independently, but not as SSH callback

A MySQL cloud server only allows remote access to a certain server (in this example, 11.22.33.44). Running the following commands from the terminal is verified to work: ssh -p 40000 ...
3
votes
2answers
260 views

Using Linux autocompletion with wordlist AND files of the current directory

I have set auto-completion in my .bashrc as follows: complete -W "$(echo `cat ~/.ssh_complete`;)" scp but this ONLY used the words given in the file ~/.ssh_complete. How is it possible to extend ...
4
votes
2answers
5k views

.bash_profile not being read

So I am using CentOS 6.3 a fresh install and I was trying to add things to my path for OpenMPI so I edited my .bash_profile file to read: FOO='test' export FOO # Add support for MPI ...
1
vote
1answer
490 views

Built local glibc, broke system, how do I ssh without parsing the .bashrc?

The cluster I am on had really old build tools and I needed to use CUDA5. I'm a pretty clever dude and I planned on building the necissary tools. So, I built a local copy of gcc, bintools, and ...
1
vote
1answer
67 views

Is there some place to put custom functions which are then sourced at startup? [closed]

I've written a what I think quite useful function and I want to make it public via GitHub. On my PC I have a .bash_functions file which I source into my .bashrc file. I know this is the common ...
5
votes
2answers
2k views

`ssh foo “<command/>”` not loading remote aliases?

summary: Why does this fail $ ssh foo 'R --version | head -n 1' bash: R: command not found but this succeeds $ ssh foo 'grep -nHe 'bashrc' ~/.bash_profile' /home/me/.bash_profile:3:# source the ...
1
vote
3answers
523 views

Automounting SAMBA share using the .bashrc

Is it possible to mount a Samba network share on start-up using the .bashrc file In my fstab I got //192.168.1.104/ant /media/ant cifs ...
3
votes
2answers
6k views

.bashrc: shopt: not found

Just provisioned a new Rackspace instance with Ubuntu 12.04 and pulled down rbenv from their github and installed it. I'm getting the following errors when executing . ./~bashrc $ . ~/.bashrc sh: ...
12
votes
6answers
4k views

How to use a custom .bashrc file on SSH login

I've found that with the new company I'm working with I often have to access linux servers with relatively short lifetimes. On each of these servers I have an account, but whenever a new one is ...
5
votes
1answer
826 views

bash tab completion only works for root

I set up an Ubuntu 12 server (on rackspace cloud using their preconfigured image) and created a non-root user. When I log in as the standard user, pressing [TAB] at the terminal outputs an actual tab ...
2
votes
2answers
661 views

.bashrc and .ssh/ disappearing seemingly at random

I have a server that has been running Fedora 16 ( 3.1.0-7.fc16.x86_64 ) for about a month now. I only log in every few days or weeks, but when I do, sometimes files are missing from my home directory. ...
0
votes
1answer
95 views

Can't get .bashrc to load

I can't get .bashrc to load on this machine... it's SUZE linux 10. I'm a bit frustrated because this seems very basic, create the file and it loads when you open a new shell connection. With the ...
1
vote
1answer
659 views

How can I disable CTRL+Z backgrounding in vim or nano?

I'm using stty susp ^- in a user's .bashrc shell in an attempt at preventing users from using CTRL+Z to background a process. The reason behind this, is that we have a number of users who are used to ...
1
vote
1answer
2k views

Can't change path location of PHP on mac os x snow leopard

I have XAMPP installed on my mac, and I want to make command line PHP use the same executable as XAMPP since I've customized that php's php.ini file. The php binary I want is located at: ...
0
votes
2answers
266 views

Can't succesffully install RVM in Ubuntu 11

I've installed RVM before in Debian and OSX without any problems, but doing it in Ubuntu is driving me crazy. I´ve tried different tutorials, this is the last of them. I think everything goes ...
3
votes
2answers
7k views

How do I reset default .bashrc (debian wheezy)? [closed]

I messed up my .bashrc file. How do I get to the default one that was initially created with my home directory?
2
votes
1answer
171 views

Bash Function to Export .bashrc to a Remote Server

I am trying to write a bash function shown below. I am trying to scp my .bashrc to the target machine. I want to do modify the following function in the below two ways. I want to enter the password ...
4
votes
3answers
286 views

exporting bashrc file over an ssh connection

I have my bashrc file set up to my liking.I usually work on a hardware that is plugged into a remote server.I ssh into that remote server.I would like my .bashrc to be run when I ssh into the remote ...
2
votes
2answers
5k views

Solarized Colour Theme in .bashrc

I am looking to see if there is a way to implement the solarized them through just a .bashrc file. Would it be possible to do so? Has anyone tried this before? I guess I would start by modifying ...
1
vote
1answer
279 views

.bashrc doesn't get sourced after su'ing to root

I've got a CentOS 5.6 VPS and both root and my normal user account have identical copies of a .bashrc file in their home directories. The file contains a few basic aliases, etc. If I login to root, ...
0
votes
2answers
769 views

In Linux, how do I umask differently for files and directories?

I wish to have something in my .bashrc that will mask the file permissions as 022 (resulting in new files having permission rwxr--r--) and the directory permissions as 066 (resulting in new ...
3
votes
2answers
598 views

Why is my .bashrc script executing out of order / not waiting for steps to complete?

I have the need for teachers to fill in electronic registers in remote areas, and they need to be able to do it fast and with the least fuss necessary. To accomplish this I have set up netbooks with a ...
2
votes
2answers
2k views

How do you run “source” when starting a shell?

In order to use rvm (https://rvm.beginrescueend.com/), I need to run source ~/.bash_profile each time when I start a new shell. How do I automatically do this when I start my computer, rather than ...
-1
votes
3answers
1k views

Set alias or environmental variable in Unix

I have a VPS and an associated IP address for it. I'm doing a lot of work with it in my bash shell and I'm wondering if there's some way I can create either an alias or a environmental shortcut for ...
0
votes
2answers
895 views

In Ubuntu, does updating the CLASSPATH require a reboot?

I changed my CLASSPATH and JAVA_HOME variable to something like this JAVA_HOME=/usr/local/jdk1.6.0_24 export CLASSPATH=$CLASSPATH:/usr/local/tomcat/lib export JAVA_HOME And when I try to compile, ...
0
votes
2answers
606 views

Setting multiple paths to JAVA_HOME in Ubuntu

I am trying to set the JAVA_HOME path in Ubuntu from the .bashrc file I currently have something like export JAVA_HOME=/usr/local/jdk1.6.0_24 But I want to also add the servlet libraries in the ...
2
votes
3answers
2k views

How to Add Options to Bash Function

I'm new to linux (using Ubuntu 10.10) and I'd like to add a function to .bashrc that starts/stops a tomcat server. I'm trying to parse two options for the command "tomcat". I've tried the following ...
1
vote
1answer
389 views

Tilde expansion not working when I hit tab on ubuntu 10.10

I try to do this: cd ~git\t where the \t is tab character and I expect it to be expanded by bash_completion to this: cd ~gitolite/ but it doesn't. I've uncommented the following lines in ...
1
vote
2answers
134 views

Alias for Kate editor

How can I create an alias in .bashrc for Kate editor, in order not to write kate file1 file2, but k file1 file2 for opening those files.
1
vote
1answer
620 views

So Close: How to get this SSH login working (.bashrc)

Objective: SSH login ( + eliminate warning message) / run 2 commands / stay logged in: EDIT: Oops, I made a mistake (see below): This code does ~95% of what I wanted to do # .bashrc # Run two ...
15
votes
7answers
4k views

I screwed up, exit in .bashrc

I put "exit" in my .bashrc file. I don't have physical access to the machine so to connect to it I use ssh. I don't have root privileges. Every time I connect to the server, the connection ...
0
votes
2answers
85 views

Copying user account and all settings?

I recently performed a fresh install of Ubuntu 10.04 and tried to create the username that I wanted to create "Sean.Ochoa" (without the quotes), but it wouldn't let me... saying something about the ...