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

learn more… | top users | synonyms

1
vote
1answer
29 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
56 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
207 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
70 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
114 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
89 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
41 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
42 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
33 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> ...
2
votes
1answer
62 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
36 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
47 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
55 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
58 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 ...
2
votes
1answer
132 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
43 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
262 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
38 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
132 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? ...
3
votes
1answer
365 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
37 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
77 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
215 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
121 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
66 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
89 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
38 views

making my UID work the same on all servers

I have a user id on 5 servers same user name. for one of the servers I have modified my .bashrc and added a bunch of new features to customize how my UID command line, etc work. What is the best way ...
0
votes
2answers
162 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
176 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
94 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
318 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
122 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
720 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
186 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
116 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
159 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 ...
0
votes
4answers
374 views

how to execute a bash script without typing ./ [duplicate]

It has been bugging me for a very long time and I'm really sick of it. For example there's a script called testscript that compares two directories. In class the prof can just type testscript dir1 ...
3
votes
2answers
94 views

What's a smart way to use/maintain two separate bash_profile's and vimrc's

I have two different setups I like to use in terminal and vim. One uses a light background and a somewhat fancy airline statusline in vim. The other uses a dark background and a more barebones vim ...
1
vote
1answer
501 views

Reload .bashrc file for parent shell

I'm creating a script for managing my dotfiles and I want to source my ~/.bashrcfile automaticaly for the current bash. But I found that when in my script write : source ~/.bashrc it will source ...
1
vote
2answers
722 views

Non-interactive shell expand alias

I'm having trouble getting aliases to expand on my hosting account when I run a command like: ssh user@server "bash -c \"alias\"" My .bashrc file is: echo .bashrc # .bashrc shopt -s ...
0
votes
1answer
19 views

bash_completion does not work in dtach

I start dtach from bash using the following command dtach -c /tmp/dt0 bash the problem is, before I started dtach, bash_completion worked. But once I start dtach, bash_completion does not work ...
-1
votes
1answer
625 views

Connect via SSH with hostname instead of username and hostname

Whenever I have to login to a remote server, I have to enter ssh username@hostname and subsequently a password. I want to save time by omitting some parameters whenever I try to login to a server. I ...
2
votes
1answer
105 views

Match empty line in an alias .bashrc

I would like to bind my empty line in my bash to a specific command (for example pwd, ls, ...), like so : $<enter> $/home/ I tried // ~/.bashrc alias ="pwd" But obviously this was ...
1
vote
1answer
530 views

.bashrc and .bash_profile not executed [closed]

I'm running RHEL5. I added simple alias command into ~/.bashrc. When I start a new terminal, nothing happens but source ~/.bashrc works so I know the syntax is correct. I also ...
2
votes
3answers
474 views

bashrc in custom folder [duplicate]

I want to cleanup my home folder and have managed to move out most of the configuration files to the .config folder. But, one file I'm not able to figure out is the .bashrc file. How can I specify ...
2
votes
1answer
134 views

Bash: How to get different color for the command line and its output? [duplicate]

Basically, I am trying to edit my .bashrc such that when I type ls or whatever I type on the console, it will be displayed in Green color. At the same time, all the results / output displayed by ls or ...