Questions tagged [bashrc]
The Bashrc file is used by the Bourne Again Shell in Unix/Linux to set environment variables and run commands.
116 questions
0 votes
0 answers
182 views
Common alias for all users
I migrated all my users from Ubuntu 16.04 to Ubuntu 24.04 by adding them to /etc/passwd, /etc/group and /etc/shadow and then executing mkhomedir_helper for each user, see my blog for details. Today I ...
0 votes
2 answers
177 views
su command not set BASH_VERSION value and not load profile
I have a Ubuntu 20.04 LTS server version and have a strange problem creating a new user and use it in the shell from a ssh connection. The steps to reproduce it: Use he root account to create new ...
2 votes
1 answer
252 views
Why is my bash script not being sourced when opening new tmux pane?
The following logic in .bash_aliases to remove duplicate paths works fine when opening a new terminal: # prune duplicate paths PATHS=("PATH" "LD_LIBRARY_PATH" "C_INCLUDE_PATH&...
0 votes
1 answer
3k views
Refresh kerberos ticket instead of prompting for pam password
Using centralised auth against FreeIPA is working great. In order to use Kerberos SSO when using ssh, scp etc from jumphosts users must initiate their Kerberos tickets first with kinit. I've added ...
0 votes
2 answers
1k views
Use original linux user bashrc also as root user
I extended the bashrc file of my linux user. This file contains extra aliases, functions, whatever is useful. It's synchronized with a playbook across our 100+ servers. When i'm working on linux I ...
3 votes
1 answer
3k views
sourcing environment variable in bashrc: directly vs export from file yields different result - why
I am running systemd via user (i.e. enable-linger $USER) and I interact with services via systemctl --user I noticed a strange issue. Sourcing Type 1 In order for the above systemd to work for a user, ...
0 votes
1 answer
1k views
How to Make the IP Address Appear as Part of Bash Prompt?
Running an Amazon EC2 instance with Ubuntu 22.04. The elastic ip address is 52.120.94.72. I want the bash prompt to read like this (no space) [email protected]:~/working_directory$ Based on some ...
2 votes
1 answer
2k views
Starting Directory for Bash
I've a Docker container running. I connect to the container using a command like: docker exec -it container_name bash This logs in as root at /var/www/html. I want to know why this directory, and how ...
2 votes
3 answers
1k views
Saving the date to actual bash history file
When adding "HISTTIMEFORMAT" to bashrc, the timestamps of when a command was executed are made available when running the "history" command. But the timestamps themselves are not ...
1 vote
3 answers
5k views
Ubuntu 20.04: su command bash-autocomplete stopped working
I am using Ubuntu 20.04. The su autocomplete stopped working. For example when I type: su TabTab It lists the files and directories of the current directory, where as it should list the available ...
1 vote
1 answer
3k views
How to set a command alias that will be respected in a shebang
I run multiple versions of PHP on my Linux server. I've added an alias in my bashrc to point the php command to a specific version alias php='/usr/bin/php7.3'. This works as expected when I execute a ...
0 votes
0 answers
102 views
Custom bash prompt failing when home directory is remote
0 I am trying to configure a custom prompt for RHEL 8 users. It works very nice when the users have local home directories. However, I'm mounting home directories via pam_mount (nfs4). When ssh'ing to ...
0 votes
1 answer
455 views
Exclude or Include certain profile lines during a tmux session start
In my .bash_profile, I have a line to start tmux only if it is present on the system with: [ -z $TMUX ] && export TERM=xterm-256color && exec tmux In a similar vein, I would like to ...
0 votes
1 answer
405 views
assigning aliases in .bashrc via echo '...' >> .bashrc
running cat .bashrc gives me these two lines at the end: alias remove='rm -i' alias chamber='ls -a -i -l' when I run remove followed by a file name I get a successful removal with confirmation ...
0 votes
2 answers
2k views
Global use of 'aliases' on Debian 10
I've been trying to add global use of aliases on my Debian 10 instance with no luck. What I've already attempted is adding my aliases to /etc/bash.bashrc as well as adding this snippet to /etc/profile ...