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]
- How to use execvp()
- How to use execvp() to execute a command
- 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
- How can I safely create a nested directory in Python?
- ‘git’ is not recognized as an internal or external command
- Extract substring in Bash
- ow can I find where Python is installed on Windows?
- Graphviz’s executables are not found (Python 3.4)
- In the shell, what does ” 2>&1 ” mean?
- How do I copy a folder from remote to local using scp?
- How to concatenate string variables in Bash
- How to grep for case insensitive string in a file?
- Difference between wait and sleep
- How to fix ingress 404 default backend
- Multi-line string with extra space (preserved indentation)
- ImportError: No module named psycopg2
- How to mkdir only if a directory does not already exist?
- Why do people write #!/usr/bin/env python on the first line of a Python script?
- Error with pre-create check: “VBoxManage not found. Make sure VirtualBox is installed and VBoxManage is in the path”
- commands not found on zsh
- How to reload .bashrc settings without logging out and back in again?
- How can I declare and use Boolean variables in a shell script?
- How to get an absolute file path in Python
- Environment variable to control java.io.tmpdir?
- How to get the filename without the extension from a path in Python?
- How can I compare numbers in Bash?
- Why am I getting a FileNotFoundError?
- Meaning of $? (dollar question mark) in shell scripts
- How to import a module given the full path?
- VirtualBox: mount.vboxsf: mounting failed with the error: No such device
- How to check if an environment variable exists and get its value?
- How do I edit $PATH (.bash_profile) on OS X?
- How to read a file into a variable in shell?
- Run a string as a command within a Bash script
- Implementing shell in C and need help handling input/output redirection
- Create a new file in git bash
- conditional binary operator expected in shell script
- How to specify the private SSH-key to use when executing shell command on Git?
- Is there any simple way to benchmark Python script?
- Block Comments in a Shell Script
- Writing a simple shell in C using fork/execvp
- Speed up rsync with Simultaneous/Concurrent File Transfers?
- Multi-dimensional arrays in Bash
- Implementation of multiple pipes in C
- Variable interpolation in the shell
- chmod: changing permissions of ‘my_script.sh’: Operation not permitted
- What’s the meaning of the parameter -e for bash shell command line?
- What does set -e mean in a bash script?
- Check existence of input argument in a Bash shell script
- Associative arrays in Shell scripts
- source command not found in sh shell
- How to parse XML in Bash?
- How do I know the script file name in a Bash script?
- How can I debug the TTFB in WP?
- WordPress Multisite with multiple domains using Nginx
- Multisite behind Varnish
- WordPress PHP error handling and reporting in production environment
- How to combine javascript files without plugins?
- WordPress salts set in config and database
- Repeatable configuration package
- What should be disabled to run on an internal network with no access to the Internet?
- No configuration file found and no installation code available. Exiting
- Error establishing a database connection on Installation
- How do I hide out of stock products from homepage but not from catalog?
- Configuring Propel to Work with Multisite
- automatic plugin install availability: server configuration
- Users – remove ‘send password’ checkbox
- Cannot access WordPress website from external IP while internally it is working properly [closed]
- How to visit php file in my custom directory under site root directory
- get_bloginfo prints IP instead of url
- Scripts external to WordPress cause 404 errors
- Can I set a global base path for get_template_part?
- Unable to update plug-ins – Undefined index a:1:{s:3:”ssl”;b:1;} in class-requests.php on line 213
- Move site root directory on debian
- On IIS, stop WordPress from resaving my web.config file when I enter the Permalinks config page
- how to server over http and https with one installation
- When does `cron.daily` run?
- What is “-bash: !”: event not found”
- Colors in bash after piping through less?
- “POSSIBLE BREAK-IN ATTEMPT!” in /var/log/secure — what does this mean?
- Why the sites dropdown in multi-site installation is different from the list of sites when seen full page?