It’s not a good idea to edit /etc/profile
for things like this, because you’ll lose all your changes whenever CentOS publishes an update for this file. This is exactly what /etc/profile.d
is for:
echo 'pathmunge /usr/lib/ruby-enterprise/bin' > /etc/profile.d/ree.sh
chmod +x /etc/profile.d/ree.sh
Log back in and enjoy your (safely) updated $PATH
:
echo $PATH
/usr/lib/ruby-enterprise/bin:/usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/root/bin
which ruby
/usr/lib/ruby-enterprise/bin/ruby
Instead of logging back in, you could reload the profile:
. /etc/profile
This will update the $PATH
variable.
Related Posts:
- No acceptable C compiler found in $PATH while installing the C compiler
- Failed to start LSB :Bring Up down Networking
- HAProxy vs. Nginx
- adb shell su works but adb root does not
- Nginx 403 forbidden for all files
- adb shell su works but adb root does not
- rndc: connect failed: 127.0.0.1#953: connection refused
- HAProxy vs. Nginx
- Why am I getting Permission Denied when trying to push a Sqlite file to my rooted Android device?
- How do you install Node.JS on CentOS?
- How do I update a CentOS server’s time from an authoritative time server?
- Best way to gracefully restart CentOS?
- How to extend an ext4 partition and filesystem?
- My /var/log/btmp file is huge! What should I do?
- Log all commands run by admins on production servers
- Centos 7 save iptables settings
- How to open port for a specific IP address with firewall-cmd on CentOS? [duplicate]
- :wq! command in vim
- How to use execvp()
- How to use execvp() to execute a command
- What is a reverse shell?
- javac is not recognized as an internal or external command, operable program or batch file [closed]
- javac is not recognized as an internal or external command, operable program or batch file [closed]
- Meaning of “! -S” in shell script
- “No such file or directory” but it exists
- How do I pause my shell script for a second before continuing?
- ssl_error_rx_record_too_long and Apache SSL [closed]
- How do I split a string on a delimiter in Bash?
- Access Denied for User ‘root’@’localhost’ (using password: YES) – No Privileges?
- How can I safely create a nested directory in Python?
- ssh : Permission denied (publickey,gssapi-with-mic)
- Access Denied for User ‘root’@’localhost’ (using password: YES) – No Privileges?
- How to execute a program or call a system command?
- In the shell, what does ” 2>&1 ” mean?
- Graphviz’s executables are not found (Python 3.4)
- ‘git’ is not recognized as an internal or external command
- Extract substring in Bash
- Where to place $PATH variable assertions in zsh?
- Ubuntu says “bash: ./program Permission denied” [closed]
- Should I put #! (shebang) in Python scripts, and what form should it take?
- CentOS vs. Ubuntu [closed]
- Should I put #! (shebang) in Python scripts, and what form should it take?
- ow can I find where Python is installed on Windows?
- Graphviz’s executables are not found (Python 3.4)
- ‘git’ is not recognized as an internal or external command
- Different between ./ , ../ , ../../ , ~/ on file path(URL) in asp.net
- In the shell, what does ” 2>&1 ” mean?
- How do I use a regex in a shell script?
- How do I copy a folder from remote to local using scp?
- How to concatenate string variables in Bash
- -bash: syntax error near unexpected token `)’
- Importing modules from parent folder
- How to grep for case insensitive string in a file?
- An example of how to use getopts in bash
- Importing modules from parent folder
- Difference between wait and sleep
- How to fix ingress 404 default backend
- How can I safely create a nested directory in Python?
- Multi-line string with extra space (preserved indentation)
- ImportError: No module named psycopg2
- How to delete from a text file, all lines that contain a specific string?
- Graphviz’s executables are not found (Python 3.4)
- Multi-line string with extra space (preserved indentation)
- No space left on device
- ImportError: DLL load failed: %1 is not a valid Win32 application. But the DLL’s are there
- ImportError: DLL load failed: %1 is not a valid Win32 application. But the DLL’s are there
- ‘\r’: command not found – .bashrc / .bash_profile [duplicate]
- How to mkdir only if a directory does not already exist?
- How can I recursively find all files in current and subfolders based on wildcard matching?
- How to perform grep operation on all files in a directory?
- Loop through an array of strings in Bash?
- ‘\r’: command not found – .bashrc / .bash_profile [duplicate]
- How can I check if a directory exists in a Bash shell script?
- How do I iterate over a range of numbers defined by variables in Bash?
- Why do people write #!/usr/bin/env python on the first line of a Python script?
- OS X: equivalent of Linux’s wget
- Error with pre-create check: “VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path”
- Error with pre-create check: “VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path”
- How to set ssh timeout?
- commands not found on zsh
- Setting up enviromental variables in Windows 10 to use java and javac
- subprocess.Popen(): OSError: [Errno 8] Exec format error in python?
- How to substitute shell variables in complex text files
- sudo: apt-get: command not found
- How do I iterate over a range of numbers defined by variables in Bash?
- adb is not recognized as internal or external command, operable program or batch file
- Why do people write #!/usr/bin/env python on the first line of a Python script?
- How to mkdir only if a directory does not already exist?
- OS X: equivalent of Linux’s wget
- Using find to locate files that match one of multiple patterns
- How can I recursively find all files in current and subfolders based on wildcard matching?
- MySQL root password change
- Curl command for https ( SSL )
- “unary operator expected” error in Bash if condition
- How to install “make” in ubuntu?
- How to exclude a directory in find . command
- What does “-ne” mean in bash?
- “sed” command in bash
- How can I declare and use Boolean variables in a shell script?
- How to reload .bashrc settings without logging out and back in again?