Home IT Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Linux System Getting Started Learning: modify environment variables in Linux PATH     - Java to achieve local fileCopy (Programming)

- Ubuntu install video playback software SMPlayer (Linux)

- Build your own Web server under Ubuntu Linux system (Server)

- State and Linux nf_conntrack TCP disconnect time (Programming)

- CentOS / RedHat system partition essential requirements and partition scheme (Linux)

- Binary search -Java achieve (Programming)

- Ubuntu Linux to create and increase the Swap partition tutorial (Linux)

- Linux batch copy data script (Linux)

- Protect your files, modify the Linux value Umask (Linux)

- Manually generate AWR reports (Database)

- Postgres-X2 deployment steps (Database)

- Ubuntu 14.04 next upgrade to GNOME 3.12 (Linux)

- Use in Linux ipmitool tool (Linux)

- jQuery update the content and method of use 3.0 (Programming)

- CentOS 5.11 Open VNC access (Linux)

- Ubuntu system process is bound CPU core (Linux)

- How to allow users to access only a specific database (MSSQL) (Database)

- SUSE Linux firewall configuration notes (Linux)

- Linux ls command (Linux)

- Ubuntu 14.04 build Gitlab (Linux)

  Linux System Getting Started Learning: modify environment variables in Linux PATH
  Add Date : 2018-11-21      
  Question: When I try to run a program, it prompts "command not found". But this program in / usr / local / bin. How do I add / usr / local / bin to my PATH variable, so I can not specify a path to run this command.

In Linux, PATH environment variable holds the time series of directories for user input in the search command. The value of the PATH variable by a series of absolute paths separated by semicolons composition. Each user has a specific PATH environment variable (initialized by the system-level PATH variable).

To check the user's environment variables, run the following command in user mode:

$ Echo $ PATH
Or run:

$ Env | grep PATH
PATH = / usr / lib64 / qt-3.3 / bin: / bin: / usr / bin: / usr / sbin: / sbin: / home / xmodulo / bin
If your command does not exist in any of the above within a directory, shell throws an error message: "command not found".

If you want to add an additional directory (eg: / usr / local / bin) to your PATH variable, you can use the following commands.

Modify the PATH environment variable for a specific user

If you want to add a new directory in the current logon session temporarily (eg: / usr / local / bin) to the user's default search path, you only need to enter the following command.

$ PATH = $ PATH: / usr / local / bin
Check if the PATH has been updated:

$ Echo $ PATH
PATH will remain valid in the current session after the update. However, the change will fail in the new session.

If you want to permanently change the PATH variable, open ~ / .bashrc (or ~ / .bash_profile) with the editor, and then add the following line at the end.

export PATH = $ PATH: / usr / local / bin
Then run the following line of permanent activation changes:

$ Source ~ / .bashrc (or source ~ / .bash_profile)

Change the system-level environment variables

If you want to permanently add the / usr / local / bin to the system PATH variable level, like this edit / etc / profile.

$ Sudo vi / etc / profile
export PATH = $ PATH: / usr / local / bin
After you log back in to update the environment variables will come into force.
- Linux System Getting Started Tutorial: Linux file permissions brief description (Linux)
- Android components series Activity (Programming)
- Oracle how to maintain the consistency of read? (Database)
- PuTTY Xming achieve the X11 forwarding ssh (Server)
- Seven kinds of NIC binding mode Detail (Linux)
- CentOS static IP network configuration (Linux)
- Talk Packages (Linux)
- Java transient keyword (Programming)
- How to use Android Studio to play more package names APK (Programming)
- Simple configuration shell scripts virtual machine environment experiment (Linux)
- Manually create Oracle Database Explanations (Database)
- Linux System shutdown procedures (Linux)
- Ora-00439: feature not enabled: managed standby (Database)
- Oracle archive log size than the size of the online journal of the much smaller (Database)
- RedHat 6.5 installation and deployment Openfire (Server)
- Towards Docker (Server)
- 12 novice Linux command must learn (Linux)
- 10 important Linux ps command combat (Linux)
- MySQL High Availability plan several options (Database)
- Linux install Maven and SVN client (Linux)
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.