Questions tagged [bashrc]

The Bashrc file is used by the Bourne Again Shell in Unix/Linux to set environment variables and run commands.

It is most often run when logging into a command-line shell or running 'su' to switch to another user. It use to set environment when user logged in.

114 questions
0
votes
1 answer

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 PHP script actually using the php command eg php…
Dom
  • 458
  • 1
  • 5
  • 15
0
votes
0 answers

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 the machine, the prompt I made displays fine.…
0
votes
1 answer

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 skip or include certain lines: • Have certain lines in my…
YorSubs
  • 135
  • 7
0
votes
1 answer

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 prompt. when I run chamber I get chamber: command…
Joel
  • 1
0
votes
2 answers

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 to source it without it working. if [ -f…
0
votes
1 answer

Aliasing Server Name in SSH Command

This may be trivial, but I am not sure how do it safely and optimally. I have a few servers (AWS EC2) into which I ssh from the bash. Those server names are long. How can I alias them, so instead of typing the long thing, I can type something…
MadPhysicist
  • 133
  • 8
0
votes
0 answers

/etc/profile, /etc/bash.basrc, ~/.profile, ~/.bashrc are not read

I am a running "Ubuntu 16.04.6 LTS" Linux. I've installed/upgrade some packages, but i do not remember exactly which packages. Since this operation, i have lost ls coloration for all users and PS1 environnement variable (except root user). I have…
Bob5421
  • 319
  • 3
  • 8
  • 16
-1
votes
1 answer

Changing path to basedir of mysql

When-ever I need to start mysql from command line, I need to cd to the base directory and then use mysql command as shown below: # cd /home/ec2-user/percona-5.5.30-tokudb-7.0.1-fedora-x86_64/ # ./bin/mysql Welcome to the MySQL monitor. Commands…
shantanuo
  • 3,579
  • 8
  • 49
  • 66
-1
votes
3 answers

Set alias or environmental variable in Unix

I have a VPS and an associated IP address for it. I'm doing a lot of work with it in my bash shell and I'm wondering if there's some way I can create either an alias or a environmental shortcut for the IP address to avoid having to type it every…
Casey Flynn
  • 217
  • 4
  • 13
1 2 3 4 5 6 7
8