.bashrc is the primary configuration file for the bash shell.

learn more… | top users | synonyms

3
votes
1answer
24 views

Bash prompt: using \[ and \] within PROMPT_COMMAND

I'm working on a bash prompt. I'm also trying to create the prompt intelligently, so that it will be easily readable and maintainable. That means not having one huge export PS1. Various sources ...
1
vote
1answer
28 views

Bashrc PS1 error

I created a nice PS1 for bash with http://bashrcgenerator.com/, but something seems to go wrong. The terminal emulator shows me some random, characters which means that PS1 probably has a syntax ...
2
votes
1answer
16 views

What controls the home directory in applications like Geeqie and Thunar?

I have a line in my .bashrc that cd's to a specific directory. For as long as I can remember, this only changed the directory in which terminal sessions began. But then at some point recently, GUI ...
1
vote
2answers
27 views

Separate bashrc file for ssh sessions to avoid Unison Errors

Recently my Unison started throwing up some strange error whenever I tried to sync between my laptop and my PC. I realized that I had added a line in bashrc that would print my pending tasks whenever ...
1
vote
2answers
76 views

bash - Why does type -a execute “$(printf 'a')” and is it possible to get back the original alias? [duplicate]

After i ask this question 2 days ago, i decided to make this alias in my ~/.bashrc: alias catvu="LC_ALL=C sed \"$(printf 's/[^\t -\176\200-\377]/^&/g')\"|LC_ALL=C tr '\0-\10\13-\37\177' ...
2
votes
1answer
45 views

change terminal appearance according to server

I have 2 different serves (all running Linux) to which I connect via ssh . After login all terminal background looks same. I want to have different color theme or background for different servers. For ...
0
votes
0answers
71 views

SCP won't copy files due to output in .bashrc

I just uploaded my linux (mint to v. 17.1), and now I cannot upload files to a cluster via scp anymore. I understand that .bashrc cannot output anything during the process for it confuses scp, so when ...
0
votes
0answers
42 views

Using brew: curl version error, “Incompatible library version” for libcurl.4.dylib

I used to have a working version of homebrew but then something broke today related to curl and libcurl.4.dylib— possibly a version or file location issue. I'm on Mac OS X 10.9.5 (Mavericks). For ...
1
vote
1answer
48 views

How can I prepending a character for every output of a command?

I'm running commands which I want to specifically group them by every command, as shown in the example below. Tried printing with echo -e '| $line' but it only affects commands that output the text ...
4
votes
1answer
174 views

bashrc lazy substitution

How does one get ~/.bashrc aliases to evaluate $() substitutions at run time, instead of at the time that ~/.bashrc is executed (when opening a terminal)? I run this command often enough that I would ...
1
vote
1answer
34 views

Set default permissions so only owner can read, execute and write for every new file and directory

I added this to my ~/.bashrc file: umask 077 So that every new file and directory has by default read, write and execute permissions. It does work with directories, but files only have write and ...
1
vote
2answers
57 views

How do I make a BASH loop

I'm very new to bash and Linux and I was wondering how I could make a bash loop so that when it runs, it will ask you how many times to run, and it will run that many times. I did it in LUA but I ...
2
votes
3answers
236 views

Why root does not source .bash_profile?

Everytime I try to login as root using su (not su -), it doesn't source .bash_profile in user1's home directory. Basically my /var/root directory doesn't have .bash_profile, so I put a copy of ...
2
votes
2answers
75 views

Can I recover my .bash_profile from an open Terminal tab?

I'm actually using a Macbook Pro, and am quite new to non-Windows OS' (I know, for shame!), and I've made the mistake of overwriting my bash profile, instead of appending to it... (n00b!). What I do ...
4
votes
2answers
138 views

Can 'ssh <host> <command>' be configured to always load server-side startup files?

I would like run remote ssh commands and have them always load server-side startup files by default. I am looking for a solution that does not require: configuration by root adding extra boiler ...
-1
votes
3answers
106 views

How to toggle between vim buffer and command shell screen in vim?

I find it annoying to constantly press Ctrl-Z and then fg to go between these screens (where command terminal is the command line that you used to invoke vim from). It also generates unwanted fg ...
0
votes
2answers
62 views

Why doesn't `sudo su -l -c “java”` work even though `sudo su -l -c “echo $PATH”` displays the location of the java binary? [duplicate]

I have a server with Java binaries from a tarball on a custom location, and the following in /etc/bash.bashrc: export JAVA_HOME=/path/to/java/home export PATH=$JAVA_HOME/bin:$PATH When I run sudo ...
0
votes
1answer
50 views

How to read bash config when working with SSH remote sessions [duplicate]

I have a Node.js app which I want to deploy on my VM machine. Before starting the app, I want to set few commands which should be read before the app is started. I placed those commands inside ...
0
votes
0answers
39 views

Error while setting up environment for running swift

I am getting the following error when running the script remakerings # remakerings Traceback (most recent call last): File "/usr/local/bin/swift-ring-builder", line 5, in <module> ...
3
votes
1answer
84 views

Invoke subshell command with loaded rcfile

I have some Python code that does: (this is a simplified version) shell = os.environ['SHELL'] os.environ['PATH'] = ... # some new PATH value if call(shell, '-c', ...
1
vote
1answer
41 views

Why does tmux mess up my Ubuntu login, though it works ok once logged in for new windows?

Why, after a Ubuntu 14.04 software update, does have exec tmux in my .bashrc lead to not being able to log in (though previously it worked fine for years) and how to fix ? Investigation: I recently ...
1
vote
2answers
76 views

When is /etc/bash.bashrc invoked?

What is this file anyway? Documentation makes no mention of it. And it's not supposed to be run automatically (version 4.3, 2 February 2014): Invoked as an interactive login shell, or with --login ...
0
votes
1answer
83 views

Create a service in Debian that sources a bash startup script

The server is running Debian 7 Wheezy without systemd. I have a user in Debian with Perlbrew installed into their home directory. The user is running a Mojolicious app. In order for the app to work, ...
1
vote
1answer
63 views

My terminal is pure white // removal of the things spf13 has done to my Ubuntu

I have installed spf13 by using the command: curl http://j.mp/spf13-vim3 -L -o - | sh I didn't liked what I got, so I tried to get rid of it. I managed to get to my previous VIM configuration, but ...
3
votes
1answer
212 views

How to print last login time?

I'd like to know how to set in .bashrc file to print the last login time of users when logging into another user in terminal. I do know that with who or last, but I'd like something a little more ...
2
votes
1answer
50 views

bashrc behaviour differs when opening a session or opening a terminal

I'm using RHEL 6.6. I got a problem configuring my .bashrc file. I have a sudo su - dummy followed by an exit in it. When I open a terminal, the current user is changes to dummy. If I type exit, I go ...
2
votes
2answers
322 views

How to create permanent aliases on Unix-like systems?

I am looking for a simple way to create a permanent alias for all users. So ~/.bashrc or ~/.bash_profile is not an option. Hasn't anybody created a program for this? I think it should be a very ...
0
votes
0answers
26 views

Bash script results in errors like “: command not found”. Using Sublime Text to edit the file in Windows [duplicate]

I had a ~/.bash_profile which I wanted to move to somewhere where it'll be executed for all users, including the root. I was led to /etc/profile which worked great. I appended my script there and it ...
0
votes
1answer
45 views

Single call in .bashrc starting two daemon processes

I am using CentOS 6.6 and would like /OtagoHarbour/executables/inotifydropboxcopy to start as a daemon when I boot the computer and log in. I put the following in ~/.bashrc # User specific aliases ...
3
votes
1answer
133 views

What does . ~/.bashrc command do? [duplicate]

I was viewing my .bash_profile file, and I saw this written inside a block of if statement: if [ -f ~/.bashrc ]; then . ~/.bashrc Can someone explain what the second line is actually doing? ...
4
votes
1answer
572 views

Can I run a command loaded from .bashrc with sudo?

I have some custom functions and aliases defined in my .bashrc file. Sometimes I need to execute whem as root. I then do something like: $ sudo custom_cmd 80 ...
0
votes
1answer
41 views

Universal .bashrc alias showing results of sysytemctl start command

This is small .bashrc alias that allows me to see results of starting service alias systemctl start apache='systemctl start apache && echo SUCCESS || echo failure' How can i modify to work ...
1
vote
1answer
82 views

Command prompt (PS1) including the number of files in directory (both hidden and regular entries)

I have finally come up with a favourite PS1 format but I find it takes too long to load. I need help optimizing... The part that is slowing it down is when I call the external commands in the prompt. ...
6
votes
3answers
227 views

How to call a “sub” .inputrc? (Like in .bashrc, where you can “source sub_script.sh”)

My ~/.bashrc contains exactly one line: source my_config/my_actual_bashrc.sh Is there an equivalent with .inputrc, so my customizations can be in a separate location, and "called" by ~/.inputrc?
1
vote
0answers
165 views

Unable to source .profile and .nvm/nvm.sh from .bashrc

I have configured my Ubuntu 14.04 with dotfiles found here Mathias Dotfiles. Everything is going smooth, I installed both RVM(Ruby Version Manager) and NVM(Node Version Manager). In order for both of ...
0
votes
0answers
84 views

Dynamically Source Bash & Profile Files Across Multiple Enviornments

I'd like to come up with a way to always source the user's profile and bash configuration files upon a interactive login or non-interactive login despite what file structure they may have. It would ...
0
votes
2answers
24 views

What is the meaning of the directory specified by '//'? [duplicate]

What is the meaning of the directory specified by '//'? It can be accessed by typing in 'cd //' at the comand prompt. I have tried this on mac 10.9.5 and Centos 6. It shows the contents for the ...
0
votes
0answers
27 views

Broken mkdir command [duplicate]

I made an alias in my .bash_profile file with the same name as mkdir. It looked like this. alias mkdir='function _blah(){ mkdir "$1"; cd "$1" };_blah' After removing it, i notice that mkdir still ...
1
vote
1answer
98 views

Alias for perl script

So far while surfing web I've discovered nice addition to my gpg password generator and I've decided to adjust my alias with these commands. Here is the code gpg --gen-random 1 20 | perl -ne'print ...
0
votes
0answers
38 views

Bash ignore “update” command

I have this in my .bashrc export HISTTIMEFORMAT="%Y/%m/%d - %H:%M:%S - " export HISTIGNORE="&:[ ]*:reload:update" export HISTCONTROL=ignoreboth:erasedups shopt -s autocd shopt -s cmdhist shopt ...
0
votes
2answers
40 views

making my UID work the same on all servers

I have a user id on 5 servers with the same user name. On one of the servers I have modified my .bashrc and added a bunch of new features to customize my need. What is the best way for me to have ...
0
votes
2answers
212 views

bash NOT reading .bashrc on RHEL 6

machine A --RHEL 7 and updated. machine B -- RHEL 6 and updated. If I do this on A (RHEL 7) ssh B I get in, like I should, but my .bashrc has NOT been run. This is new behavior to me. I want ...
0
votes
1answer
198 views

Debian Segmentation Fault

After editing .bashrc I had "Segmentation fault" as an error. This is what I added to bashrc: if [ -f ~/.bashrc ]; then source ~/.bashrc fi # If not running interactively, don't do anything [ -z ...
3
votes
1answer
113 views

Bash scripts ran from from gnome/nautilus don't have enviroment variables

In my ~/.bashrc and ~/.profile I have some variables set to some filepaths: export MY_VAR1="/path/to/somewhere" In my ~/bin/ (which is added to my PATH) I have a few scripts that rely on those ...
2
votes
1answer
361 views

Opening multiple tabs in gnome-terminal, having them automatically password-lessly ssh to servers and do so using alias from my bashrc file

I regularly have to ssh into four or so servers we run, at the same time. I have aliased these like. SERVER1=root@server1 alias sshserver1='ssh -t ${SERVER1} "bash -rcfile .my_bashrc"' # Above line ...
0
votes
2answers
145 views

How to get the ~/.bashrc to work in the native terminal application in Centos? [closed]

The problem I had was to get the .bashrc and .bash_profile and/or .profile scripts to execute by default when using the native Gnome terminal application. I found a number of references which told me ...
2
votes
1answer
879 views

Jenkins does not use system's locales

I got a interesting behavior in Jenkins. Jenkins' shell does not use my systems locales. Jenkins runs as user jenkins on my system. Logged in as jenkins via SSH: locale displayed: ...
1
vote
2answers
222 views

How to fix corrupted bash-completion in command substitution?

it seems my bash-completion got corrupted. Every time I try to use command substitution, for example when I type ls $(ls Deskto<Tab> ..result is.. ls $(ls Desktobash unexpected eof while ...
0
votes
1answer
125 views

Bash Script - Disable Wireless Connections

OS: Arch Linux Network Manager: Netctl I am trying to write a bash script that will disable all current network connections and turn off wifi on my system. I currently have the following, but after ...
1
vote
3answers
198 views

How long do the contents of the .bash_history file last?

How can I modify the contents of my bash_history file? What values or variables control how long the history lasts? Are there any other things I can change to provide finer control of my BASH ...