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

learn more… | top users | synonyms

0
votes
1answer
16 views

PROMPT_DIRTRIM not working

I have the following in my .bash_profile: PROMPT_DIRTRIM=3 export PS1='$ \u in \w: ' However, when I navigate deep within a directory, the path doesn't shorten. This is what the prompt shows: $ ...
3
votes
4answers
2k 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 ...
1
vote
2answers
23 views

Append a “finished” command after a specific command is used

I'm using Bash. I have a build command that I run a few times a day. I also have a command called "beep" that I use to alert me when a command finishes. So normally I do "build arg1 arg2; beep" and it'...
0
votes
1answer
56 views

I need to know about 'source' and the use of 'bashrc' in context to installing any package in ROS

I am trying to install Robot Operating system (ROS)in my system. At some point I need to use the following: echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc Then the following source ~/....
0
votes
0answers
58 views

how to stop .bashrc editing itself

Since using ROS I found myself wanting to run a specific command every time I started the terminal: source ~/catkin_ws/devel/setup.bash so I looked for advice on how to do this. The thing to do ...
25
votes
9answers
21k views

How can I set my default shell to start up tmux

I would like my default bash shell to go straight into tmux instead of my always having to type tmux every time.
1
vote
1answer
25 views

How to reset bash bindings? [duplicate]

I wanted to create bash binding so that ctrl+backspace deletes word in terminal. But I somehow ended up screwing up my backspace and now it doesn't work, it outputs character. I know I can list all ...
0
votes
0answers
20 views

Why is bash ignoring my colours? [duplicate]

I have my ls colours set in my .bashrc as #Bash colours 120 TERM='xterm-256color' 121 122 # Directory Colours 123 LS_COLORS=$LS_COLORS:'di=36' ; export LS_COLORS #Cyan 124 #File Colours 125 ...
1
vote
1answer
28 views

trigger vi mode key binding in normal mode only

I've created some custom key bindings for bash vi mode. They trigger while I'm in insert mode and I want them instead to trigger when I'm in normal mode. I'm using vi mode set -o vi in a terminal ...
2
votes
1answer
39 views

Can I use an environment variable to define an alias?

I'm using an automation engine to run perl scripts. script_X requires a wrapper script so it's run like: wrapper_script script_X --parameters But the automation engine can't understand that ...
1
vote
0answers
35 views

Added anaconda2 lib to LD_LIBRARY_PATH, results in “no version information available” warning

To compile a program (Caffe) I added my anaconda2 libraries to .bashrc as follows: export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/anaconda2/lib/ However, now when I run ls or find I get the ...
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
0answers
53 views

How can I find where tmux is installed on my computer? I would like it to autostart when bash starts

I know that this exists. But it isn't working, and when I try to find tmux in the "bin" directories of my computer, it doesn't find it. How is it working when I enter tmux into terminal then? UPDATE:...
1
vote
0answers
14 views

RH software collections enable for command run with sudo

We are using RH software collections for python34 and have the following in /etc/profile.d/scl_enable_python34.sh source scl_source enable rh-python34 This works perfectly for interactive users. ...
3
votes
2answers
77 views

regenerate .bashrc from current shell

So I stupidly inadvertently destroyed ~/.bashrc. If I have open terminals with the settings that were previously there, is there a way to export the current settings back to a new .bashrc? (I've tried ...
1
vote
2answers
504 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 "s/...
1
vote
1answer
48 views

Debian : Setting path for Node with root accessible globally

I have downloaded NodeJS setup and have it inside at /home/deploy/nodejs. I am trying to set its path, but it's not working out. I am logged in as root, and I would like to access nodejs and npm ...
2
votes
1answer
506 views

How to use history commands with readonly PROMPT_COMMAND?

I'm sometimes logged in on a host which I do not control and where PROMPT_COMMAND is readonly. Is there some way to work around this to run history commands anyway, for example using PS1? I've tried ...
1
vote
1answer
33 views

Where are the places the PROMPT_COMMAND variable could be set?

I installed drush and as part of the installation it makes some changes to the PROMPT ... # Optional. Enrich the bash startup file with completion and aliases. drush init ... Whenever I execute an ...
0
votes
1answer
50 views

Showing color in log output using tail command when using Cygwin?

I have a debian install that runs an application server. I ssh into this debian install from a Windows computer using cygwin and with the application server running I use tail -f to monitor the log ...
0
votes
1answer
23 views

Mess with an export PATH

I have tried to include INTEL PARALLEL COMPOSER to my .bashrc.But something went wrong.Now I can not use gedit or vi editor. milenko@milenko-HP-Compaq-6830s:~$ gedit .bashrc Command 'gedit' is ...
6
votes
1answer
3k views

Problems with automatically starting screen on SSH login

I'm looking at http://taint.org/wk/RemoteLoginAutoScreen to setup my server so it autostarts a screen session when I login via SSH. I have added the following to my .bashrc: # Auto-screen invocation....
0
votes
1answer
33 views

Using export USER=myName doesn't change the output of whoami

I saw this example $ whoami MatsP $ g++ -Wall -std=c++0x getenv.cpp $ ./a.out MatsP $ export USER=DonaldDuck $ ./a.out DonaldDuck but for me it doesn't work. I am in a Debian machine. I used ...
1
vote
1answer
187 views

Why doesn't my bash terminal recognize any command in the shell? [closed]

Upon the request of some users, I decided to add all the intermediate steps and results to my initial post so that users can better walk me through a solution. This is added under the headline ...
3
votes
1answer
126 views

Does “color” in TERM always mean I can use colors?

Should the following always indicate that I can use escape sequences and tput to colorize things? if [[ $TERM == *"color"* ]]; then true else false fi
1
vote
1answer
40 views

How can I source several files into my .bashrc?

I want to write my functions each in separate files, for easier version control, and source the whole lot of them in my .bashrc. Is there a more robust way than e.g. . ~/.bash_functions/*.sh ?
0
votes
2answers
65 views

ls, mv, cp, cat, vi, command not found

I was trying to add a new path to my bashrc file but I have seemed to messed something up. after I $ source ~/.bashrc I no longer can use the commands ls, mv, cp, cat, vi, and probably others that I ...
387
votes
8answers
728k views

How to correctly add a path to PATH?

I'm wondering where a new path has to be added to the PATH environment variable. I know this can be accomplished by editing .bashrc (for example), but it's not clear how to do this. This way: export ...
1
vote
1answer
62 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 ...
2
votes
3answers
108 views

Trying to understand .bashrc, env, and export

Disclaimer: Using bash. I just need some confirmation / correction on my understanding of these things: env is basically displaying the current environmental variables that are accessible to my ...
1
vote
1answer
44 views

How to execute in-line commands through ssh

I'm struggling to execute commands through ssh, especially aliased command. The alias I need is ldocker which is set in the remote .bashrc. So far I tried: $ssh bugs2 '. .bashrc && echo "--"...
3
votes
1answer
42 views

Sourcing .bashrc from ssh after removing the prompt string check

I have a .bashrc file that needs to be sourced non-interactively. The problem is that on the file there is this return statement preventing from sourcing by code: [ -z "$PS1" ] && return ...
2
votes
2answers
40 views

How can Bash determine if it is running due to an rsync over ssh?

I need my Bash init scripts to be able to distinguish between having been invoked like ssh me@host /some/complicated/operation, and having been invoked like rsync -e ssh /src me@host:/dest In the ...
15
votes
8answers
29k views

Doing simple math on the command line using bash functions: $1 divided by $2 (using bc perhaps)

Sometimes I need to divide one number by another. It would be great if I could just define a bash function for this. So far, I am forced to use expressions like echo 'scale=25;65320/670' | bc but ...
1
vote
0answers
150 views

tmux not executing ~/.bash_profile on start up

I searched the net and many people complained that tmux wasn't executing their .bashrc. The solution thats suggested everywhere was to source .bashrc from within .bash_profile cos tmux launches bash ...
-2
votes
1answer
57 views

bash: syntax error near unexpected token `“firsttry.c”' [closed]

My code--- #include <stdio.h> int main(void) { printf("hello, world\n"); } and I get bash: syntax error near unexpected token `"firsttry.c"'
0
votes
1answer
63 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: \033[1;...
0
votes
3answers
112 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 PATH="/home/...
2
votes
2answers
183 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
173 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 ...
22
votes
3answers
1k 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
98 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
96 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 ...
19
votes
3answers
3k views

How can I create a local function in my bashrc?

My .bashrc had some code that was repetitive so I used a function to simplify it do_stuff() { local version=$1 export FOO_${version}_X="17" export FOO_${version}_Y="42" } do_stuff '5.1' ...
1
vote
5answers
54 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
85 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
27 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
64 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
39 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
86 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 (...