Home IT Linux Windows Database Network Programming Server Mobile  
  Home \ Linux \ Linux System Getting Started Learning: modify environment variables in Linux PATH     - Python closure and function objects (Programming)

- Linux network security strategy (Linux)

- Oracle creates split and splitstr functions (Database)

- How to achieve SSH without password login (Server)

- About Hibernate cache, you want the latest data have trouble even session.clear (Database)

- Nine artifact control disk partition under Linux (Linux)

- Dynamic programming Android (Programming)

- Loop arrays in C language is not easy to find a bug (Programming)

- Linux / Unix: chroot command examples to explain (Linux)

- TPCC-MySQL Benchmark (Database)

- UNIX file permissions in the "set user ID bit" (Linux)

- curl Usage: Being the first site header and status codes (Server)

- Using IntelliJ IDEA Import Spark Spark latest source code and compile the source code (Linux)

- How to Check notebook CPU temperature in Ubuntu (Linux)

- C ++ input and output summary _ Input (Programming)

- To upgrade combat MongoDB database replication sets and split versions (Database)

- Introduction and MongoDB CRUD (Database)

- How to use the on-screen keyboard in Linux (Linux)

- After you change the GRUB boot disk partition repair (Linux)

- MySQL combination Git achieve differential backups can be used in the production environment (Database)

  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.
- The temporary operation of the document mkstemp on Linux (Linux)
- To install and deploy Java applications under CentOS 6.5 (Linux)
- Thinking in Java study notes - Access modifiers (Programming)
- Configuring Proxy on a Unix terminal, accelerate Android Studio Construction (Linux)
- SQL Server automatic backup script (Database)
- Fedora 22 Server how to upgrade to Fedora 23 Beta Server (Linux)
- Oracle set and remove columns unavailable (Database)
- CentOS 6 / Linux su: Unable to set user ID: Resource temporarily unavailable (Linux)
- Linux kernel to achieve soft RPS network to receive soft interrupt load balancing to distribute (Linux)
- 7 JavaScript interview questions (Programming)
- Linux server alarms using Java (Server)
- Use Visual Studio to compile and use WinGDB remote debugging embedded Linux programs (Programming)
- Linux kernel update error, update-initramfs: failed Solution (Linux)
- Ubuntu 14.04 next upgrade to GNOME 3.12 (Linux)
- Linux iptables: Composition Rules (Linux)
- Oracle 10g, 11g database silent installation of small differences (Database)
- Linux /var/spool/ insufficient clientmqueue space solutions (Linux)
- MongoDB, Cassandra, HBase transaction design strategy (Database)
- Grub2: Save Your bootloader (Linux)
- Git build a team development environment operating drills (Linux)
  CopyRight 2002-2016 newfreesoft.com, All Rights Reserved.