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

learn more… | top users | synonyms

0
votes
1answer
17 views

Update 'changing' variables every time PS1 is called, i.e. every new prompt

The reason I need to be able to do this, is to have 'updating' variables in my PS1. I'd like to have my prompt span across the entire width of the terminal, not wrapping around or going down to a new ...
0
votes
0answers
16 views

how to get terminal to show root prompt in su

I am logged into a (normal) user, but when I go su : password my normal promt goes into showing me this instead of what it should. how to I fix this? ターミナル 10:15 AM (~) $ su Password: ...
0
votes
3answers
28 views

Add PATH to .bashrc

I am trying to install Anaconda on my Linux machine. Right or wrong, at the end of the instructions they say to add this line to the file .bashrc in your home directory: export ...
2
votes
2answers
129 views

Bash: #: command not found

I just moved to Arch Linux with KDE a week ago. Everything worked well until I installed ibus-unikey and ibus-qt, after that, whenever I open konsole, this error appears: bash: #: command not found ...
3
votes
2answers
75 views

Can I concatenate a bash alias?

Sample : to use Composer locally, I must write : php composer.phar After some locals installation of Composer, I want to alias it only "composer" but keeping absolute path with "pwd" command. I ...
19
votes
3answers
883 views

Why does bashrc check whether the current shell is interactive?

On my Arch install, /etc/bash.bashrc and /etc/skel/.bashrc contain these lines: # If not running interactively, don't do anything [[ $- != *i* ]] && return On Debian, /etc/bash.bashrc has: ...
0
votes
0answers
20 views

Debian: mvn command not found

I am attempting to install Maven in my Debian 7 environment, but even having followed the instructions from this video, I can't seem to get Maven working. I have the folder apache-maven-3.1.1 in my ...
3
votes
2answers
85 views

Handling duplicate programs names bash

I'm wondering if $PATH cascades entries. You'll all need to take a leap of faith with me here, but here it goes. Let's say we have a Java executable at /usr/bin/java but this version is very old and ...
1
vote
1answer
31 views

Capture Linux shell Commands to file

I'm trying to capture all Linux Shell command to some file. I tried to use the auditd service but it's not giving me the output I want. I searched a little and found some nice solution . Step 1: vi ...
1
vote
5answers
44 views

remove an added path from PATH?

in my ~/.bashrc in Linux , I have a line that adds some paths to PATH, something like: PATH=~/mydoc:~/mypython:"$PATH" The purpose of adding ~/mypython is to use my self-installed python, rather ...
0
votes
1answer
50 views

How to create a dynamic greeting?

Recently made the switch to Linux/command line, and I'm having trouble creating a dynamic greeting for terminal out of a list of predetermined possibilities. I tried the following, but it appears as ...
0
votes
1answer
24 views

Logged into RHEL 6 and profile settings are missing

I know there's not much detail I'll be able to provide, but if the info below could give you a hint of what is going on, please help. A colleague was sharing screen with me yesterday, using RHEL's ...
0
votes
1answer
55 views

Why don't I get my bash customizations when I log in normally?

My user's shell prompt is stuck as [bash-4.2]$ and many useful commands like ll don't work on that bash-4.2 shell. I tried the chsh command and usermod commands, but neither fixed this. I've checked ...
1
vote
1answer
32 views

A command that takes a single numeric argument and prints out the day of the week based on the formula

days=('Sunday''Monday') days=('Tuesday''Wednesday') days=('Thursday''Friday') days=('Saturday') for numbers in "S@"; do if [ $numbers -ge 0 ]; then result=$(($numbers ...
3
votes
1answer
42 views

Start all terminal sessions within /usr/bin/script

I would like to expend some disk space recording all input and output to my terminal sessions; /usr/bin/script appears to be fairly good at that. I would like to make it so all new shell sessions ...
1
vote
1answer
44 views

How can I use debian_chroot in bashrc to identify the chroot env?

I see the following in ~/.bashrc : if [ -z "${debian_chroot:-}" ] && [ -r /etc/debian_chroot ]; then debian_chroot=$(cat /etc/debian_chroot) fi which means if the variable is ...
3
votes
1answer
77 views

To export or not to export bash PS1 variable

I just spent a lot of time reading up on login and interactive shells and why one should or should not set environment variables, shell functions, etc. in the various profile and bashrc files. In this ...
0
votes
0answers
29 views

Fill the name of last-run program in Bash

Suppose I execute some command: ls -l ~/some_dir. I would like to create an alias, such that I could execute man with the name of the last-run program as a parameter, i.e., man ls in this case. ...
0
votes
1answer
28 views

Bash: Tab completion with cdable_vars

I've been relying on this hack for jumping around in the file system for a couple of years before finding out today that I can do the same thing using native Bash by activating the option cdable_vars. ...
0
votes
1answer
75 views

How to remove the return code from the terminal prompt in Sugar on a Stick?

I am using Sugar on a Stick (Fedora 23) 0.106 for i686 as a distro. Here's the link to the website of this distro: https://sugarlabs.org When I use the terminal I get a very weird behaviour. For ...
3
votes
2answers
345 views

what is the command [ -s “$NVM_DIR/nvm.sh” ] && . “$NVM_DIR/nvm.sh” doing

I found the following command in the .profile file while installing node through nvm: [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh" I want to know what is the the purpose of [] and ...
0
votes
0answers
61 views

Bash prompt time is not always updating

Before I start, this is not a question about how to customize PS1. I have already customized mine and I'm quite happy with it. I usually work in a remote server with SuperPuTTY, which allows me to ...
2
votes
1answer
32 views

building code from source and adding them to your path

Typically on Debian when you install things from the repository, they just work. It sets up things just fine and life is good. This is great for things that are up to date in the repository. I am ...
0
votes
1answer
47 views

unexpected EOF error while running bash_profile [closed]

I am a newbie to Linux and I am trying to install a software in my university cluster via ssh login from my PC. So, I first login via ssh, and then according to the software documentation I add the ...
2
votes
2answers
159 views

How do I get ~/.bashrc to execute all scripts in my ~/Shell directory using a loop?

I have shell scripts in my ~/Shell directory that I want to be run whenever Bash is started up as my usual user account. So what I have done is added the following to ~/.bashrc: for i in `find ...
2
votes
4answers
226 views

How do I append multiple lines involving variables to the end of a bash script?

I would like to add: function ps_mem { python /home/vagrant/ps_mem/ps_mem.py -p $@ } To the end of ~/.bashrc from the command-line. I have tried using: printf "function ps_mem {\n python ...
2
votes
1answer
162 views

Extract hostnames from non-hashed ssh known_hosts

I would like to extract hostnames/ips from .ssh/known_hosts file in all (known) format conditions: Hostname only hostname pubkey Hostname with ip: hostname,1.1.1.1 pubkey Hostname with ip that is ...
0
votes
1answer
139 views

Can fbterm support 256 colors?

I have Arch without X and want to make my console solarized. I think I can't do that in tty, so I had installed fbterm and tried to play with fbtermrc, bashrc etc. $ tput colors 256 $ ...
4
votes
1answer
127 views

Load aliases from .bashrc file while using sudo

I have set aliases for a few programs in the .bashrc file, and they work fine without sudo and they don't with sudo. Is there a way to get those aliases work with sudo? For example: nano text.txt ...
1
vote
2answers
216 views

.bashrc file syntax error near unexpected token `('

I have been using the following lines in my bashrc file for quite some time now and suddenly now I have an error. Here are the lines: make() { /usr/bin/make "$@" 2>&1 | sed -E -e ...
2
votes
1answer
52 views

Bash autocompletion for an alias

This is in my .bashrc: alias p='sudo apt-get'; complete -F _apt_get p I've found the autocompletion only works if I've used autocompletion for apt-get at least once before trying to use it with the ...
1
vote
1answer
87 views

PS1 from .bashrc overridden somewhere else

I'm trying to use a custom PS1 line, including colors and git repo information, on a Red Hat Enterprise Linux 6 machine. I have a predefined version I'm successfully using on other systems running ...
1
vote
1answer
49 views

~/.bashrc script not run correctly on ssh login, does work correctly with source ~/.bashrc

To keep track of which ssh connection I have open in different tabs I use the following ~/.bashrc script: function set-title() { if [[ -z "$ORIG" ]]; then ORIG=$PS1 fi TITLE="\[\e]2;$@\a\]" ...
0
votes
2answers
64 views

aliases do not work in bash - login shell

I have an alias defined in ~/.bashrc and ~/.bash_profile as: alias e='echo' When I run the command as: bash -c 'e hello' It shows error as: bash: e: command not found But from an interactive ...
1
vote
1answer
87 views

How to change the color scheme of the prompt based on user?

My current prompt is colorized and edited as so - #!/bin/bash # GIT Prompt help if tput setaf 1 &> /dev/null; then tput sgr0; # reset colors bold=$(tput bold); reset=$(tput sgr0); ...
2
votes
3answers
491 views

sudo command doesn't source /root/.bashrc

I have added a custom path to PATH variable in my /root/.bashrc file When i do sudo su; echo $PATH, it shows the entry, '/path/to/custom/bins'. But i do sudo sh -c 'echo $PATH', it shows, ...
3
votes
0answers
69 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 ...
2
votes
2answers
659 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
101 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
115 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
43 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
51 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
63 views

Problem with loading settings from .bashrc

I have a strange problem with terminal settings. I am a Debian 3.16.7 user. I saw the .bashrc file using ls -a but I couldn't open it (no file comunicate), so I restored it from /etc/skel/.bashrc. ...
0
votes
1answer
28 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
225 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
2k views

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

I'm not good with command lines or 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
93 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
199 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
1k 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
6k 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 ...