Questions tagged [bashrc]

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

It is most often run when logging into a command-line shell or running 'su' to switch to another user. It use to set environment when user logged in.

114 questions
1
vote
1 answer

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 terminal is opened, not on login. And it seems that…
Buttle Butkus
  • 1,741
  • 8
  • 33
  • 45
1
vote
1 answer

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 same SSH session and also see where they were run…
sa289
  • 1,318
  • 2
  • 18
  • 44
1
vote
1 answer

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…
jwbensley
  • 4,202
  • 11
  • 58
  • 90
1
vote
2 answers

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 after logging in. Here is what I have tried…
Samiron
  • 123
  • 7
1
vote
3 answers

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 just affects that user.
Scottie T
  • 245
  • 1
  • 5
  • 10
1
vote
1 answer

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

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 approach (at least for bash) but I don't know if it is…
Trollhorn
  • 203
  • 3
  • 10
1
vote
3 answers

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,username=***,password=*** 0 0 but this is not…
Elitmiar
  • 775
  • 3
  • 15
  • 31
1
vote
1 answer

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 using Oracle SQLPlus on VMS, and the default…
Bryan
  • 7,628
  • 15
  • 69
  • 94
1
vote
1 answer

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: /Applications/XAMPP//xamppfiles/bin/php A quick check of…
Casey Flynn
  • 217
  • 4
  • 13
1
vote
1 answer

.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, root's copy gets sourced. If I login to myuser,…
Ian Dunn
  • 194
  • 13
1
vote
1 answer

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.bashrc and logged out and back in. # enable bash…
weston
  • 113
  • 3
1
vote
2 answers

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.
Narek
  • 245
  • 1
  • 4
  • 15
1
vote
1 answer

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 commands and stay logged in to new server. alias gr='ssh…
This_Is_Fun
  • 124
  • 1
  • 2
  • 11
1
vote
1 answer

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 password for su sudo whoami fill in Alice's sudo…
FLX
  • 141
  • 8
1
vote
1 answer

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 putting export PATH=$PATH:/my/path in /etc/bashrc…
draenen
  • 163
  • 4