Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [bashrc]

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

1
vote
1answer
81 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
3k 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
1k 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 gid=users,file_mode=0664,dir_mode=0775,auto,...
3
votes
3answers
17k 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: 18:...
19
votes
6answers
19k 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 ...
7
votes
1answer
2k 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
2k 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
133 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
1k 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
3k 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
319 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 ...
7
votes
2answers
14k 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
319 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
905 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
9k 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
407 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
1k 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
678 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
4k 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
2k 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
1k 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
955 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 ...
4
votes
3answers
4k 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
540 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 /etc/bash....
1
vote
2answers
184 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
935 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 ...
25
votes
10answers
11k 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
88 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 ...
1
vote
1answer
225 views

sudo as a user that has sudo rights?

Alice has sudo rights. Bob does not (this is not changeable), but does know the password to Alice's account. If Bob wants to perform administrative commands he must: su alice fill in Alice's ...
8
votes
6answers
5k views

Prune duplicate entries from PATH variable

I modify my .bashrc frequently and then source it. However, when I have things like export PATH="~/bin:~/perl5/bin:$PATH" in my file, then the PATH environment variable grows every time I source the ...
1
vote
1answer
362 views

Where can $PATH be defined for non-login shell on Red Hat

I need to add a directory to the path for non-login shells on a Red Hat Server. ssh user@server echo \$PATH returns /usr/local/bin:/bin:/usr/bin How can I add a directory to this path. I tried ...
4
votes
2answers
2k views

linux: how to permanently and globally change environment variables

I want to do the following for every user that logs into my linux box: export PATH=$PATH:~/.path And I don't know how to do that besides manually adding that line in every ~/.bashrc file. Also, a ...
1
vote
2answers
193 views

change root's .bashrc on a list of hosts

I need a way to log into a list of hostname/IPs as a user, su to root and then create/append root's .bashrc root doesn't have permission to ssh directly into the server
1
vote
3answers
107 views

Where do I put the Alias?

alias py='python' Do I put that in my .bashrc?
3
votes
1answer
377 views

What creates ~/.bashrc

I am setting up a ubuntu web server. Id like to customize everyones bash prompt a bit. (As in $PS1) Editing /etc/bash.bashrc doesn't seem to work, I assume cause ~/.bashrc over writes it. The question ...
0
votes
1answer
83 views

Is there a “pattern” or a group that defines *rc files in *nix environments?

I'm starting to use command line a little more, and I see there are a lot of ways to configure some config files in my $HOME. This is good, since you can customize it the way you really like. ...
7
votes
6answers
9k views

crontab environment

I have written various scripts to launch Java server applications, which are typically run for 24 hours before being shut down (by invoking the same script with a different parameter). The script ...
0
votes
5answers
2k views

bashrc problem on redhat linux

I am trying to add JAVA_HOME and an updated PATH to my .bashrc file on Redhat Enterprise Linux. My .bashrc file has only these two lines, but I get the error " : command not found " #user specific ...
5
votes
4answers
5k views

Prompt customization: how to detect when there is no tty

I have a customized prompt with colors (using tput) and every time I start a non-interactive session in the server I get a bunch of errors. For instance if I start a non-interactive session like this: ...
70
votes
17answers
81k views

Login without running bash_profile or bashrc

So let's say one typoed something in their .bashrc that prevents him (or her) from logging in via ssh (i.e. the ssh login exits because of the error in the file). Is there any way that person could ...
4
votes
8answers
21k views

How to specify root's environment variable?

I do rails development. In this app, I need to specify the environment variable LD_LIBRARY_PATH = /usr/local/oracle/lib, but when I run the app with sudo script/server, it doesn't run because that ...
8
votes
3answers
4k views

.bashrc or .bash_profile for ssh-agent?

Which profile, .bashrc or .bash_profile, is the appropriate spot for ssh-agent? I'm looking for an answer that explains the different between an interactive shell and a login shell.
7
votes
4answers
4k views

How can one set a terminal's title with the 'tput' command?

I discovered through this answer that I've been setting terminal colours in my prompt in a naive way for years. I've now modified my .bashrc to use 'tput' commands to colourise various elements of my ...
10
votes
4answers
10k views

Why is my .bashrc not read under cygwin?

My .bashrc looks like this: alias name@server="ssh server sname" echo "bashrc read" The echo statement is just for checking if it is read. But the echo does nothing. I want to set an alias for a ...
47
votes
1answer
14k views

What is the difference between a 'Login' and an 'Interactive' bash shell

What is the difference between a ‘Login’ and an ‘Interactive’ bash shell? I have quoted Wikipedia below but can anybody give a better answer? EDIT: This is a community wiki so maybe rather than ...
1
vote
3answers
4k views

Changes to /etc/bashrc?

Are there any changes you make to the default bash reconfiguration script that would be helpful for others to know? Note that /etc/bashrc affects all users, where a .bashrc in a user's home directory ...
141
votes
39answers
118k views

What useful things can one add to one's .bashrc? [closed]

Is there anything that you can't live without and will make my life SO much easier? Here are some that I use ('diskspace' & 'folders' are particularly handy). # some more ls aliases alias ll='ls -...
2
votes
3answers
3k views

GNU Screen and .bashrc

I am trying to launch GNU Screen using my .bashrc. I'm almost there: if [ -z "$STY" ]; then exec screen -dR else exec gnome-terminal fi This is wrong though! The first case works, screen ...