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

learn more… | top users | synonyms

1
vote
0answers
9 views

Monitor exit code in tmux

Is there a way to update tmux window attributes based on command exit status? Similar to activity monitoring, I would like the title to change color when a command exits, say, green for success and ...
0
votes
3answers
55 views

How to execute source command from sh file

I have file called install.sh and within this file I write something to $HOME/.bashrc file and after that I must call source command. In terminal I can type source $HOME/.bashrc but I can't do this in ...
0
votes
1answer
34 views

Running script through bashrc causes nesting of tmux panes

I use the following tmux code in a script file tmux-dev.sh and add it to bash using bash /home/rohit/tmux-dev.sh : tmux new-session -d tmux split-window -h tmux split-window -v tmux -2 attach-session ...
0
votes
2answers
76 views

chmod – execute permission for non-admins?

I have used chmod to make all the contents of a directory executable. However, when I try to run one of the programs in that directory as a regular user (me), I get a "command not found" message. If ...
1
vote
1answer
29 views

make sudoers use their own history file

I just can't seem to get a simple answer to this one. All I am trying to do is get a sudoers to use their own history file, but if I set the history var in the .bashrc for root with $user, the $user ...
1
vote
0answers
25 views

Bash completion function for vim 'scp://' Paths

For easily editing remote files with vim, I currently use a few .vimrc and .bashrc additions to my environment. The bash-scripting side of it "misuses" the available standard _scp bash completion ...
0
votes
1answer
30 views

Problem with loading settings from .bashrc

I have got strange problem with terminal settings. I am Debian 3.16.7 user. I saw .bashrc file using ls -a but I couldn't open it (no file comunicate), so I restored it from /etc/skel/.bashrc. Now ...
0
votes
1answer
24 views

Extract source commands of an existing gnome terminal session? [duplicate]

I have a bit of a situation. One of my co-workers just overwrote everyone's bashrc and bash_profile files. My custom settings have been lost. However, I still have a terminal open which sourced my own ...
0
votes
1answer
56 views

How to update .bashrc with PATH

I have installed a new JRE on my RedHat linux system. lsb_release -i -r Distributor ID: CentOS Release: 6.5 I have updated the symbolic links pointing to the desired Java installation: ls -l ...
2
votes
1answer
133 views

When i run “sudo su” i get --bash: command not found for everything

I'm not good with command lines nor servers. But I needed to configure for work a AMI of EC2 AWS with LINUX So I've installed a lot of stuff, moved a lot of stuff around and then I realized that sudo ...
0
votes
1answer
21 views

Bash overwrites the first line when using custom PS1 prompt [duplicate]

My question is similar, but different to, this question. I have created a custom PS1 in my .bashrc, as follows: STARTCOLOR='\e[0;36m'; ENDCOLOR="\e[0m" export PS1="\n$STARTCOLOR\u@\h:\! <\t> ...
-1
votes
1answer
58 views

No such file or directory error when attempting to run shell script upon startup of console [closed]

I'm trying to run a shell script upon startup in cygwin. I have added these commands to my .bashrc file: $ echo 'export MAIN="D:/dev/Main" >> .bashrc > echo '.MAIN/Env/tpsScripts/devenv.sh ...
1
vote
0answers
406 views

CentOs7 Python 3.4 Install Method

This post relates to this question where I was asked to explain how I installed python3 on my system. I was attempting to install python3 on my system for development purposes. Something went wrong ...
0
votes
4answers
303 views

Where is .bashrc file found in Linux?

I am not finding my .bash_login and .bash_profile root@linux:~# locate .bash* /etc/bash.bashrc /etc/skel/.bashrc /etc/skel/.bashrc.original /home/noroot/.bashrc /home/noroot/.bashrc.original ...
0
votes
1answer
93 views

How can I set a bash_logout for all users?

I've run into an issue trying to set up a little bit of ASCII art to display upon connection and on logout. I can do this for one user with .bashrc and with .bash_logout, and set a login MOTD by ...
3
votes
1answer
100 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
52 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
22 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
43 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
122 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
71 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
106 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
168 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
56 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
193 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
71 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
72 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
435 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
120 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
234 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
264 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
116 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
73 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
65 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
128 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
72 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
298 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
138 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
79 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
500 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
64 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
878 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
62 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
146 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
1k 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 ...
1
vote
1answer
56 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
112 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
267 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
242 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 ...