Questions tagged [bashrc]

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

Filter by
Sorted by
Tagged with
0
votes
2answers
38 views

Why am I seeing this in the terminal?

I have installed miniconda, psi4 some days ago. But I have found them not so interesting. So I uninstalled them. But after that, I am seeing this bash: export: `PATH-/home/soumyadip/miniconda/bin:/...
-2
votes
2answers
48 views

Call an app from a bash script Ubuntu

I have an app in a specific installed on my Ubuntu machine which is installed in /usr/local/MYPROGRAM/bin/myapp and when I try using myfn in my bash script mybashscript.sh it gives an error saying ...
1
vote
1answer
31 views

Question on modifying shell initialization files to color root's prompt red during “su”

I am in the midst of learning Linux, specifically the BASH Shell. I have been trying to edit the initialization files so that whenever I su into root, my prompt will turn red. I am using the code ...
0
votes
1answer
17 views

Remove line that calls “composer” from bash file

When I run composer I get this bash: /opt/cpanel/composer/bin/composer: No such file or directory I'm trying to find where my bash profile (the file that contains my PATH is. I'm on Centos 6. I ...
0
votes
2answers
36 views

Can't initialize environment variables for i3 exec script

I have a script called display, which sets my desktop background using feh. It does so with the following line: feh --bg-scale $WALLPAPER & The environment variable $WALLPAPER is initialized in ...
0
votes
0answers
89 views

.sh file error No such file or directory [on hold]

I've a .sh file script that I try to run. The problem occures at line 28. The Terminal outputs: filename.sh 28: filename.sh: /usr/bin/bunzip2: No such file or directory I've looked in the /usr/bin ...
-1
votes
2answers
35 views

Limit User To Run Specific Commands

I have a user test1 that i want to limit it to only run specific commands. I found this solution and I tested it (logged in with test1 and ran some random commands. none of them worked but date) and ...
3
votes
1answer
51 views

Disabling home folder symbol (~) in command line prompt

How can I set Bash so that in the command line prompt the home folder is spelled out (e.g. /Users/John) instead of displayed with the ~ symbol?
1
vote
1answer
58 views

Why does my bash terminal startup run the same set of commands twice?

I'm on a Mac and whenever I start up my terminal app the initial startup prints the following: Picked up _JAVA_OPTIONS: -XX:MaxPermSize=4G -Xmx4G Java HotSpot(TM) 64-Bit Server VM warning: ignoring ...
0
votes
0answers
29 views

Changing the location of .bashrc in MINGW64 / git bash?

So here is how I am attempting to move the location of my bashrc file which is shoehorned into Windows! Yay! someuser@somehost MINGW64 ~ $ mv ~/.bashrc ~/OneDrive someuser@somehost MINGW64 ~ $ ln -...
0
votes
1answer
26 views

explanation of PS1 in bashrc

PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' I tried experimenting with this line a lot and was able to get a few characters, but I still ...
0
votes
0answers
23 views

Real-time color change in terminal (before user sends the command)

I could not find a better way to write the title, so sorry if it is not as specific as it should. For my case, I would like to make the first word (that we know it will be separated of the rest of ...
0
votes
1answer
33 views

bash.bashrc not loading when doing a su to another user on ubuntu 19

When I switch to another user using su myuser it doesnt load any bashrc it seems. As my command line only has the $ symbol as I want it to have the username in the command line like how when I login ...
-3
votes
2answers
111 views

.bashrc syntax error: unexpected end of file

Everytime I run terminal I get this error message ".bashrc syntax error: unexpected end of file" So I started commenting parts of it to know the issue and I guess it was in the below if condition. I ...
1
vote
1answer
22 views

How to reference and combine alias values

Pretty darn simple I would have expected. I have a large .bashrc file I made years ago where everything is spelled out for values on my alias's. I want to reduce the size of the file and make use of ...
0
votes
1answer
43 views

After the edit of ~/.bashrc file: ll command not found

I was installing Hadoop on my Ubuntu. This is my PATH now echo $PATH /usr/lib/jvm/java-1.11.0-openjdk-amd64/bin:/home/miki/.local/bin:/opt/hadoop-3.2.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/...
0
votes
0answers
18 views

Aliases for Networking Commands

I need to run a legacy script on some newer systems, without installing packages or loading binaries. The script uses some of the older networking and SysV init commands. Is there a set of aliases ...
0
votes
1answer
32 views

How to close/kill SSH connection when bash shell exits?

We are writing an application. As a part of it, we have to provide SSH access to each clients. In this process, we are providing SSH access to the client using a web UI. This ssh session is invoked ...
0
votes
1answer
21 views

Modifying bashrc with xrandr doesn't work?

I added the following line to my bashrc: alias b="xrandr --output HDMI-1 --brightness" When I open another terminal and run b, b 0.1, or b 1 it says that command "b" is not found. I have a similar ...
18
votes
1answer
1k views

bash does not know the letter 'p' [duplicate]

My bash does not know the letter p. zsh does though. When I type a p in bash, it simply ignores it, and even pasting in text that contains a p will result in no p in the pasted text. This behavior ...
0
votes
0answers
65 views

.bashrc is write only on remote server [duplicate]

One of the servers that I work on has read-only permissions on .bashrc and .bash_profile. This can't be changed with chmod or sudo chmod. To get around this restriction, I would like to source my own ...
1
vote
1answer
29 views

How to remove path from terminal prompt in Debian?

From command line, long directory paths can take up the entire line: Similar questions have been asked: Hides directory path in terminal Remove "PWD" from terminal Remove full path from terminal ...
1
vote
1answer
116 views

Automatically copy files to external USB drive when connected to laptop

I want to copy some files/folders to a USB Flash Drive, SSD, or HDD after I connect them to my laptop. I don't want to detect the USB, do extra stuff, etc.. I just want to run a script from my ...
1
vote
1answer
93 views

alias to turn on/off openvpn

I do have a list of *.ovpn configuration inside the directory of /etc/openvpn/ovpn_tcp/ inside that directory i do have a bash script called go include the following code which will pickup random ...
0
votes
1answer
140 views

Weird behavior of su command

Everytime I run su command on this box, I constantly see the weird messages below. Switching user do eventually continue, but why are these messages showing? <Server>:~ # su - -bash: eval: line ...
0
votes
1answer
81 views

How can I run a new terminal with bash, but with a custom bashrc?

I open a new terminal with bash as follows. gnome-terminal -x bash gnome-terminal -e bash gnome-terminal -- bash Somewhere I read that to use a custom BASH RC file, you have to run: bash --login &...
0
votes
2answers
62 views

Confused about Configuring Linux Path Environment /etc/profile.d/*.sh being Executed Twice?

I am trying to set PKG_CONFIG_PATH to CentOS here are the code I tried export |grep PKG_CONFIG_PATH no output, normal... echo "$PKG_CONFIG_PATH" :/usr/local/lib/pkgconfig why there is output here??...
1
vote
2answers
61 views

Bash recursive call fails

I am writing a function in ./bashrc to switch environment variables, commands, etc. This function is supposed to set up the necessary variables then call itself. Instead I get bash: ./bash: No such ...
0
votes
0answers
35 views

How can I kill my custom bash 'for loop' function with a keyboard shortcut?

I am trying to kill my custom bashrc function below: xmacroloop () { for (( i=0; i<$1; i++ )) do bash -c 'notify-send "Playing back xmacro_1 on $DISPLAY" ; xmacroplay "$DISPLAY" < ~/.cache/...
0
votes
1answer
95 views

Bash prompt special character not expanded in PS1

I'm trying to set my PS1 environment variable based on runtime condition, so I use the PROMPT_COMMAND to do so. Suppose I want to change my bash prompt based on $? value, my .bashrc would look like ...
0
votes
1answer
174 views

Setting Colors in ~/.bashrc [CentOS 7]

I'm trying to set colors within my .bashrc. I would like my background to be black, bash prompt text to be white and input text to be lime green. I have this so far: export PS1="[\e[1;37;40m[\u@\W]\$ ...
1
vote
1answer
56 views

Added command(s) to .bashrc, how to apply to users retroactively?

I have a rhel 7 server that users will be connecting to, and I created ALL the users/groups then realize I needed to add a command to /etc/skel/.bashrc such that it executes upon login, but this doesn'...
1
vote
1answer
40 views

Implications of using a plain string command instead of a function in .bashrc (particularly for PROMPT_COMMAND and PS1)

I have trouble understanding: How is .bashrc parsed How are bash functions constructed I try to customize my terminal prompt. My .bashrc make use of PROMPT_COMMAND like this (it's actually much more ...
0
votes
0answers
25 views

How to efficiently track .bashrc (and similar) with git? [duplicate]

I would like to keep my .bashrc file in a gitlab repo, for obvious reasons. However, it sits in my home directory. Initialising a git repo in my home repo seems unweildly, as it then looks at ...
1
vote
0answers
42 views

su - <username> hangs if I added a line in /etc/bashrc

I added this line to /etc/bashrc file export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/glibc-2.14/lib I log in as root throw SSH normally, but if I wanted to change my user by su - myusername the ...
-1
votes
2answers
202 views

sudo without sudo, implying sudo in script

I made some scripts containing some functions which by design needs sudo permission. I have added those path in .bashrc for Linux and .bash_profile for MacOS so that it can be called from anywhere. ...
1
vote
1answer
127 views

Set to non-default user group upon login in bash

Upon login with .bashrc, how to set the user's group to a non-default one, say targetgroup? Specifically, my problem is that I can execute, on the command line: newgrp - targetgroup but when I ...
1
vote
2answers
39 views

wrong echo command

I am having a little problem with my ubuntu16.04 terminal. I wanted to have access to a data-base through the use of the : echo source /Infos/bd/config11 >> .bashrc echo source /Infos/bd/...
0
votes
0answers
23 views

Can some or all profile/login scripts be bypassed on local console login?

The situation I'm thinking of is that something in /etc/profile or ~/.profile or ~/.login or similar is causing you to be logged out immediately or some other problem/mischief, and you're at a text-...
0
votes
2answers
50 views

Bash Shell takes variable amount of time to load

I use bash on Ubuntu 18.04. I have added a lot of functions and a lot of scripts are sourced in my bashrc. I am able to time the total time it takes to load my terminal, sometimes it takes 0.9 seconds ...
1
vote
1answer
44 views

Modifying the default bashrc alert command

I was scrolling through my bashrc (bored) and I got interested in the alert command that is concatenated in there by default. It's practical and everything, but it requires you to type ; alert at the ...
0
votes
1answer
1k views

How to change default text edior for virsh edit? (setting EDITOR env variable didn't work)

I recently installed virt-manager on an Arch Linux install, and unlike under Ubuntu, I was not prompted to choose a text editor on the first launch of virsh-edit. Instead, the XML file was opened in ...
1
vote
1answer
660 views

Set up .bash_profile and .bashrc for local and remote access

I've noticed that when I open a terminal on my ubuntu machine locally, it sources .bashrc, but when I connect via ssh, it sources .bash_profile. I added a line in .bashrc to source .bash_profile so I ...
0
votes
0answers
79 views

Modifying .bashrc to send history to syslog, problems with quotes

Attempting to enable logging of bash commands to syslog, including the ip of the logged in ssh user. The end goal is to have a script which will echo 'export PROMPT_COMMAND=....'' >> ~/.bashrc ...
2
votes
1answer
106 views

how to pipe to a sourced function in bashrc file?

we all know how to pipe to shell scripts and installed programs like grep,awk ... but what about a sourced function in .bashrc or .zshrc ? this is a test function : function fff(){ echo "$@" } ...
0
votes
0answers
21 views

Bash promt (.bashrc) working not properly if added color [duplicate]

Before I used Zsh and some themes are not work properly, I thought that because of Zsh, but when I returned to Bash shell it still got same problem. Here is the problem: It doesn't jump right into the ...
0
votes
0answers
50 views

Sourced .bashrc detection

At the user level is there a way for me to craft a sort of 'tripwire' in my .bashrc file to detect if another user has sourced my .bashrc? What I would like to do is have some sort of log created ...
0
votes
2answers
69 views

How to remove first segment or segments from PATH in shell script [duplicate]

I wanted to remove a CUDA directory from PATH by a sh script. The directories are showed by doing echo $PATH /usr/local/cuda-9.0/bin:/usr/sbin:/usr/bin: I want only: /usr/sbin:/usr/bin: My script ...
1
vote
1answer
234 views

Switch capslock and ctrl with config file on ubuntu 18.04

Recently, I tried to switch capslock and ctrl on my Ubuntu 18.04. I did it by add the following line into my .bashrc: # swap capslock and ctrl /usr/bin/setxkbmap -option "ctrl:swapcaps" This worked,...
0
votes
1answer
87 views

Bash prompt configuration

I've recently switched to Parrot linux and I'm very happy with it, but there's just one thing, this default fancy bash prompt is really ugly. I used zsh before, and for some reasons I want to go back ...